Posts

Showing posts from May, 2015

Project: DuckSauce Notes Part 5

I've been secretly working on this project again (of course there's my game I am still working). However I wanted to take a step back and look at what this project has done for me. The biggest thing is that it has done is get me to question my work follow and think about how to improve it.

This project must
create filescreate templatesclean up code build manual.New Approach
Working with the chrome work-space has its limits and it appears there is a method to set the contents of a particular however it is not implemented and is filed as a bug. This is a long outstanding bug so chances are slim.

The guts
https://github.com/GoogleChrome/chrome-app-samples/blob/master/samples/filesystem-access/js/app.js

Reference
https://www.npmjs.org/package/livereload
https://github.com/livereload/livereload-extensions/tree/master/Chrome/LiveReload

Resources
https://github.com/GoogleChrome/chrome-app-samples/tree/master/samples/filesystem-access
http://stackoverflow.com/a/15197993/1265036

Make d3js Responsive

Image
This is probably the most popular quesition I see and is somewhat my main concern as far as things go with one of my projects. Now this isn't a perfect solution but its doesn't depend on jquery or anything else. So it keeps things in the d3js scope which is really what I want since I don't always include jquery in all of my projects.
function resize() { //Top Nav has a bottom padding for 50px's width = window.innerWidth, height = window.innerHeight; svg.attr("width", width).attr("height", height); force.size([width, height]).resume(); } window.addEventListener('resize', resize()); var svg = d3.select("body").append("svg") //.attr("viewBox", "0 0 " + width + " " + height) //.attr("preserveAspectRatio", "xMidYMid meet");
     I didn't include the comments in my project but I think others might and I feel they are v…

Chrome App: Can't Open app within a tab

Image
Currently using chrome 43 so this issue currently does exist but also is an very old one from the looks of it. It might seems silly to create an chrome app that simple opens up a link in a new tab but I thought it was so basic for my personally needs that it wouldn't be a problem. Plus I didn't plan on releasing most of the custom apps I created, simple just wanted to clean up some bookmarks and make them feel more like apps. There's also the possiblity to leverage them to be offline but that's outside the scope.

What I've tried
"window.open() in chrome.app.runtime.onLaunched",
chrome.tabs.create (this is only for extentions but worth a shot)

    With the current bit of code I have thisn't what I see (image above) anymore but instead the tab just closes and nothing happens...

Alternative solution
   One of the basic ways around this is drag and drop a url in the chrome app panel, but I really don't like this approach plus the icon doesn't work sinc…

Notes: Creating an Automated Testing Framework W/ Selenium

Image
Recently finished watching all the videos on Selenium on automated testing and looking forward adding this framework to all my web applications tests. The rest of my knowledge can be found on the Login-Automation project (I took the example and created it around google's login instead of the wordpress example show).



Types of Testing Unit TestingAt the code level, code first! Such as "Mocking" or D.I.Integration TestingNo need for mocking but still code.Black-box Automate Testing (BAT)Testing in a scope from a user Regression - "worked yesterday"Absolute Requirements!LeverageCommon failures Recorded brittle tests - weakly attached and simple changes break the tests, manual fixes.Not Building A Framework - Start out good, but end up the same problem.Writing Test like Code - Passed off to not programmers and slow degrade.Solution      Separate automation framework and simple tests. Test drive creation of the framework. System under Test (SUT) Architecture - No di…

AngularJS: ng-model cannot be assigned to functions

Image
This was one of the errors I faced when I started out with Angularjs, and the problem comes from thinking like Jquery developer still. I still use Jquery heavly in a few of my personal projects but have been avoiding this issue complete since.

Common error: nonassign Non-Assignable Expression


Solutions
One approach is to use directives to solve the issue and another is to use ng-init from what I've seen but I prefer using directives instead. http://jsfiddle.net/z5z9s/ - an example using ng-init (not by me).

Resources
AngularJS - ngModel cannot be assigned to function - Stack Overflow
http://stackoverflow.com/a/17793772/1265036

Project: Aptitude-Words Update 1.2.5

Image
Recently returned to my chrome extension because I had some features I wanted to see and needed improving. I like to pretend I'm the only person who really uses this extension because I really don't know who my users are or what they would like to see but I'm open to suggestions. There is stats for the extension on weekly users but I don't think much of it.

You will need to re-enable with this update since I added Google Analytics but not using it yet.
Features ( Live now!)
Trash button (rather than click checkbox)Donation button (I'm doing this with all my free apps)This is a one time purchase in the app, I'm looking to get rich.Redrawing words after delete.In the Future  New Logo (working on the art with a material design look).Google Analytics (I'm curious to know what popular words ppl are captured.)Page to display - word of the day, logic to prevent bad words from showing so dont try it...Reordering words - Just a really nice thing to have but watc…

Aspnet: legacyHMACWarning

Image
Stumbled across this bad boy in the webconfig in an old project and was curious what it's purpose was. Since the comments didn't really help and I spent some time on to uncover its secrets.
"This prevents the Windows Event Log from logging the HMAC1 that is being used (when 
the other party needs it).When targeting ASP.NET MVC 3, this assemblyBinding makes MVC 1 and 2 references relink to MVC 3 so libraries such as DotNetOpenAuth that compile against MVC1." The comments don't really help, in fact only rises more quesitions. Why is the DontNetOpenAuth ever compiling against MVC1?


DotNetOpenAuth with MVC 4.0 - "Yes, DNOA is built against MVC 1.0, and this is by design so that it works against all versions of MVC (given the appropriate redirects). This is purely an MVC version thing -- not a .NET 4.0 thing"

Resources
HMACSHA512 Class (System.Security.Cryptography)

UI-grid: Bootstrap Styled and Dynamic Height for Pagination

Image
If you've looked at my catalog-demo, you might have noticed that I used UI-grid instead of Ng-grid. I still work on a few ng-grids but I've started to really use ui-grids.




Code:
$scope.gridOptions.onRegisterApi = function(gridApi){ gridApi.pagination.on.paginationChanged($scope, function (pageNumber, pageSize) { var newHeight = (pageSize * 30) + 68; angular.element(document.getElementsByClassName('grid')[0]).css('height', newHeight + 'px'); console.log('get pageSize - ', pageSize); }); };
Solution: https://fassetar.github.io/blog-examples/uigrid-responsiveheight/

Notes
To get the grid's height multiple the grid by 30px and the page size. Then add 68 to prevent the scroll-wheel moving the grid ever so slightly. Set the default for you're page size in css as well. The css I created to make the grid look like a bootstrap table is very basic and proba…

UI-grid: Bootstrap Styled and Dynamic Height for Pagination

Image
If you've looked at my catalog-demo, you might have noticed that I used UI-grid instead of Ng-grid. I still work on a few ng-grids but I've started to really use ui-grids.




Code:
$scope.gridOptions.onRegisterApi = function(gridApi){ gridApi.pagination.on.paginationChanged($scope, function (pageNumber, pageSize) { var newHeight = (pageSize * 30) + 68; angular.element(document.getElementsByClassName('grid')[0]).css('height', newHeight + 'px'); console.log('get pageSize - ', pageSize); }); };
Solution:

Notes
To get the grid's height multiple the grid by 30px and the page size. Then add 68 to prevent the scroll-wheel moving the grid ever so slightly. Set the default for you're page size in css as well. The css I created to make the grid look like a bootstrap table is very basic and probably could use a lot more styling. Like the column controls could l…

The Three Types of Content with Web Development

Image
Background
I don't know if anyone else thinks about content theway I do and I'm always challenging myself to see if my thoughts hold true with others. This way idea might seem simple but it goes way back in college when I was just starting out and learning to code. During one of my classes I asked myself the old question "What is static? When is it static?" From all my experience and development in the field, I've came up with this approach which I think is based off current technologies but mostly on my experencies with cms technologies. This article goes really inhand with my other article on The Four Components of a Web Application.

Details
The way I've answered both questions is by treating everything as dynamic (to some degree) and to imagine that everything eventually becomes static.Whether its a database query or whatever; to some degree everything becomes "out dated". So at what cost is it worth it to make something more dynamic or static? If y…