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
/** | |
* Module dependencies. | |
*/ | |
var strftime = require('strftime'); | |
/** | |
* Creates the `record` function for `collection`. | |
* |
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
# | |
# Multistage. | |
# | |
set :stages, %w(production staging) | |
set :default_stage, "production" | |
require 'capistrano/ext/multistage' | |
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
module.exports = function (redis, code) { | |
var cache = null; | |
return function (keys, args, done) { | |
if (!cache) load(code, curry(evalsha, keys, args, done)) | |
else evalsha(cache, keys, args, done); | |
}; | |
function curry(fn) { |
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
var isOldIE = (function(){ | |
var comment = '<!--[if IE]><i><![endif]-->'; | |
var div = document.createElement('div'); | |
div.innerHTML = comment; | |
return !!div.getElementsByTagName('i').length; | |
})(); |
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
type Message struct { | |
codec uint32 | |
meta uint8 | |
body string | |
} |
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
<input type="text" ng-model="search" placeholder="filter..." /> | |
<div ng-repeat="item in items | filter:search"> | |
<!-- goodness --> | |
</div> |
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
/** | |
* Dependencies. | |
*/ | |
var Domain = require('domain'); | |
var http = require('http'); | |
var app = require('..'); | |
/** |
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
$httpProvider.responseInterceptors.push(function($window){ | |
return function(promise){ | |
return promise.then(function(){ | |
// session is valid, carry along... | |
return promise; | |
}, function(error){ | |
if (error.status == 401) { | |
// invalid session, need to re-login... | |
$window.location = '/login'; | |
} |
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(){ | |
var ScopeShare = angular.module('ScopeShare', []); | |
ScopeShare | |
.controller('FormController', function($scope){ | |
$scope.user = {}; | |
$scope.submit = function(){ | |
console.log(JSON.stringify($scope.user)); | |
}; |
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
var a = { hello: 'world' }; | |
var b = {}; | |
// has no own property "hello" | |
console.log(b.hello); // undefined | |
// set __proto__ to b, so "hello" will resolve | |
b.__proto__ = a; | |
console.log(b.hello); // hello |