This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript: (function () { | |
var root = $(document.getElementsByTagName('body')); | |
var watchers = []; | |
var f = function (element) { | |
if (element.data().hasOwnProperty('$scope')) { | |
angular.forEach(element.data().$scope.$$watchers, function (watcher) { | |
watchers.push(watcher); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tap phinze/cask | |
tap caskroom/versions | |
tap KevinSjoberg/formulas | |
install brew-cask | |
install git | |
install node | |
install imagemagick | |
install m | |
install mongodb |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Runs a fn on the initial value of some prop on the current scope, runs on following changes. | |
// Server Side | |
app.get('/wat', function *(next) { | |
this.body = { wat: "WAT" }; | |
yield next; | |
}); | |
// Client Side | |
$scope.test = 'Initval'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// $scope.obj = { a: "A", b: "B" }; | |
var pWatch = function (obj, prop, cb) { | |
return $scope.$watch(obj + "." + prop, function () { | |
cb.apply(this, arguments); | |
}); | |
}; | |
// $scope.pWatch('obj', 'a', function (oldV, newV) { | |
// do stuffs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function arr (i) { return i ? arr(i-1).concat(i) : [] } | |
_.each(arr(100), function (x) { | |
console.log((x % 3 === 0 ? 'Fizz' : '')+(x % 5 === 0 ? 'Buzz' : '') || x); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# [[ -r ~/.bash_prompt ]] && source ~/.bash_prompt | |
# [[ -s ~/.bashrc ]] && source ~/.bashrc | |
# [[ -s ~/.exports ]] && source ~/.exports | |
for file in ~/.{bash_prompt,bashrc,exports}; do | |
[ -r "$file" ] && source "$file" | |
done | |
alias rdbm="be rake db:migrate" | |
alias rdbt="be rake db:test:prepare" | |
alias seed="be rake db:seed" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defun answerInvite(v, e) { | |
var val = e.el.value; | |
var id = snapshot(v.data).event.id; | |
server.request({method: "put", path: "events/" + id + "/invitation", | |
body: {status: val}}) | |
.then(partial(logIt, v)); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.controller("GalleryCtrl", [ | |
'$scope', | |
'Restangular', | |
'$templateCache', | |
function($scope, Restangular, $templateCache) { | |
$scope.imgBase = Restangular.all('images'); | |
$scope.galleriesBase = Restangular.all('galleries'); | |
$scope.galleries = null; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I'm having a go at testing my Angular application. Here's my setup: | |
* Rails Backend & Folder Structure | |
* AngularJS(v.1.1.5) | |
* Restangular | |
* UI-Router | |
* Karma | |
* Jasmine | |
NewerOlder