Skip to content

Instantly share code, notes, and snippets.

View georgeh's full-sized avatar

George Hotelling georgeh

View GitHub Profile
@georgeh
georgeh / gist:8317224
Created January 8, 2014 14:08
Angular dependency injection
angular.module('module')
.factory('myService', function($scope, $http, otherService) {
// ...
});
// is the same as
angular.module('module')
.factory('myService', ['$scope', '$http', 'otherService', function(scopy, ಠ_ಠ, $scope) {
// scopy == Angular's $scope
// ಠ_ಠ == Angular's $http
@georgeh
georgeh / values.dot
Created October 11, 2013 17:16
Compare PHP values for truthiness - to generate http://i.imgur.com/B8R3PVK.png
graph values {
"''" -- "0"
"''" -- "0.0"
"''" -- "false"
"''" -- "null"
"'0'" -- "'0.0'"
"'0'" -- "0"
"'0'" -- "0.0"
"'0'" -- "false"
"'0.0'" -- "0"