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('uuid'); | |
var uuid = function () { | |
var parts = new Array(4); | |
// a - unix timestamp | |
var time = Math.round(new Date().getTime() / 1000); | |
parts[0] = time.toString(16).substring(0, 8); |
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 http = require('http'); | |
var gzip = require('http-gzip'); | |
var server = http.createServer(function (req, res) { | |
gzip(req, res); | |
res.writeHead(200, { | |
'content-type': 'text/plain' | |
}); | |
res.write('I am gonna be gzip encoded, dude!'); |
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
/** | |
* @constructor | |
*/ | |
function Injector() { | |
/** | |
* @type {!Object.<string, function(Injector=): !Object>} | |
*/ | |
this.factories = {}; |
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 () { | |
if (!Object.defineProperty) return; | |
Object.defineProperty(Function.prototype, 'initializing', { | |
value: false, | |
writable: true | |
}); | |
Object.defineProperty(Function.prototype, '$super', { | |
value: function () { |
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
/** | |
* Shortcut Library | |
* -- | |
* @version 2.01.B | |
* @author Binny V A | |
* @modifier Jan Kuča <jan@jankuca.com> | |
* @license BSD | |
*/ | |
(function (window) { | |
var document = window.document; |
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 HTTPS = require('https'); | |
var QueryString = require('querystring'); | |
/** | |
* Facebook API Wrapper | |
* @constructor | |
* @param {Object} info Info about the Facebook application | |
*/ | |
var Client = function (info) { | |
if (!info.id) { |
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]; |
NewerOlder