This file contains 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
// pseudocode | |
angular.service('$eventBus', function() { | |
var listeners = {}; | |
var mainBus = function(scope) { | |
return new ChildBus(mainBus, scope); | |
}; | |
mainBus.emit = function(type) { | |
var args = Array.prototype.slice.call(arguments, 1); |
This file contains 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
#!/bin/sh | |
# | |
# Simple script for rewriting history :-D | |
# Might be helpful when using "rebasing" strategy to keep your history nice and flat... | |
# | |
# Instalation | |
# >> sudo bash -c "curl https://raw.github.com/gist/1341268/git-edit.sh > /usr/local/bin/git-edit" | |
# >> sudo chmod a+x /usr/local/bin/git-edit | |
# | |
# Usage |
This file contains 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
// GOOGLE3 usage - bigger projects | |
var MyController = function($scope, $location) { | |
// controller's private state | |
this.$location = $location; | |
this.some = 12; | |
this.$scope = $scope; | |
// methods accessible from template | |
// these methods (defined in constructor) should contain only few logic, |
This file contains 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
import java.util.HashMap; | |
import java.util.HashSet; | |
import java.util.Map; | |
import java.util.Set; | |
class Pair<First,Second> { | |
First first; | |
Second second; |
This file contains 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
/** | |
* @license AngularJS | |
* (c) 2010-2012 AngularJS http://angularjs.org | |
* License: MIT | |
*/ | |
/** | |
* Backward compatibility module for AngularJS | |
* @author Vojta Jina <vojta.jina@gmail.com> | |
* |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script type="text/javascript" src="http://code.angularjs.org/0.10.6/angular-scenario-0.10.6.js" ng:autotest></script> | |
<script type="text/javascript"> | |
angular.scenario.dsl('appElement', function() { | |
return function(selector, fn) { | |
return this.addFutureAction('element ' + selector, function($window, $document, done) { | |
fn.call(this, $window.angular.element(selector)); | |
done(); |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script type="text/javascript" src="/build/angular-scenario.js" ng:autotest></script> | |
<script type="text/javascript"> | |
// this is just copy of browser().navigateTo() | |
// the only difference is this implementation accepts future value | |
angular.scenario.dsl('goToFutureUrl', function() { | |
return function(futureUrl) { | |
var application = this.application; |
This file contains 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
<!DOCTYPE html> | |
<html id="ng-app" ng-app> | |
<head> | |
<title></title> | |
<script type="text/javascript" src="http://code.angularjs.org/0.10.6/angular-0.10.6.min.js"></script> | |
<script type="text/javascript"> | |
function Main() { | |
var $scope = this; | |
$scope.persons = []; | |
for(var i = 0; i < 5000; i++) { |
This file contains 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
<!doctype html> | |
<html> | |
<head> | |
<title>angular-zrm</title> | |
<script src="http://ci.angularjs.org/job/angular.js-vojta/167/artifact/build/pkg/0.10.7-3173d860/angular-0.10.7-3173d860.min.js"></script> | |
<script src="foo-controller.js"></script> | |
</head> | |
<body ng:app> | |
<div ng:controller="FooController"> | |
<button ng:click="clear()">Clear</button> |
This file contains 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
)]}', | |
[{ | |
"name": "one" | |
}, { | |
"name": "two" | |
}] |