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
class Dispatcher { | |
register(listener) { | |
this.listener = listener; | |
} | |
dispatch(action) { | |
if (this.listener) { | |
this.listener(action); | |
} |
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
var hbs = require('express-hbs'), | |
api = require('core/server/api'), | |
_ = require('lodash'), | |
async = require('express-hbs/lib/async'), // To redefine `registerAsyncHelper` | |
registerAsyncHelper; | |
// Redefine `registerAsyncHelper` from `express-hbs` | |
registerAsyncHelper = function (name, fn) { | |
hbs.handlebars.registerHelper(name, function (context, options) { | |
// Pass `[context, options]` as arg instead of `context` only |
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
module.exports = function (Handlebars) { | |
/*! ****************************** | |
Handlebars helpers | |
*******************************/ | |
// debug helper | |
// usage: {{debug}} or {{debug someValue}} | |
// from: @commondream (http://thinkvitamin.com/code/handlebars-js-part-3-tips-and-tricks/) | |
Handlebars.registerHelper("debug", function(optionalValue) { | |
console.log("Current Context"); |
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
# List all installed Apple Developer certificates | |
security find-certificate -a -c "Developer" login.keychain | grep '"labl"' | cut -d'"' -f4 | |
# List installed .mobileprovision files | |
ls ~/Library/MobileDevice/Provisioning\ Profiles/ | |
# Get plist from a .mobileprovision file | |
openssl smime -inform der -verify -noverify -in $mobileprovision_file |
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 | |
REPO_DIRNAME=$PWD | |
REPO_BASENAME=$(basename $REPO_DIRNAME) | |
REPO_BASENAME=${REPO_BASENAME%.git} | |
if [ $REPO_BASENAME = "gitolite-admin" ]; then |
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
$a = function () { | |
echo 'x'; | |
}; | |
$a(); |
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
goog.provide('VKontakte'); | |
goog.require('goog.crypt.Md5'); | |
VKontakte = function (user_id, app_id, app_secret) { | |
this.user_id_ = user_id; | |
this.app_id_ = app_id; | |
this.app_secret_ = app_secret; | |
}; |
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
- (void)connect { | |
NSHost *host = [NSHost hostWithName:@"example.com"]; | |
// iStream and oStream are instance variables | |
[NSStream getStreamsToHost:host port:2000 inputStream:&iStream | |
outputStream:&oStream]; | |
[iStream retain]; | |
[oStream retain]; | |
[iStream setDelegate:self]; | |
[oStream setDelegate:self]; |
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
function ApiController() { | |
Controller.call(this); | |
} | |
ApiController.prototype = Object.create(Controller.prototype); | |
ApiController.prototype.error = function (status, message) { | |
this.render(status, { 'error': message }); | |
}; |
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
var darkside = require('darkside'); | |
var IndexController = function () { | |
darkside.base(this, darkside.ViewController); | |
}; | |
util.inherits(IndexController, darkside.ViewController); | |
NewerOlder