Skip to content

Instantly share code, notes, and snippets.

View tim-smart's full-sized avatar

Tim tim-smart

View GitHub Profile
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=4.4.3.2.1.000.000
TARGET_PRODUCT=full_mako
TARGET_BUILD_VARIANT=codefirex
TARGET_BUILD_TYPE=development
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
TARGET_CPU_VARIANT=krait
TARGET_CFX_CLANG_VERSION=3.5
;(function($) {
var $els = $('.js-vertical-center');
var fns = [];
$els.each(function(i, el) {
var $el = $(el);
fns.push(function() {
var elHeight = $el.height();
$el.css({
exports.AutoLoader = function() {};
AutoLoader.prototype.autoload = function(type, filePath, includeAsType) {
var obj = undefined;
if(includeAsType === undefined) includeAsType = true;
this.__defineGetter__(type, function(){
if(!obj){
obj = require(filePath);
if(includeAsType) obj = obj[type];
}
tim@tim-laptop ~ $ ab -c 100 -n 1000 http://localhost:8000/fostle/static/images/fade_bg.gif
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking localhost (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
exports.hotRequire = function(variable, path, prop = null) {
if ("string" === typeof prop)
module.parent.exports.scope[variable] = require(path)[prop];
else
module.parent.exports.scope[variable] = require(path);
(function(variable, path, prop) {
process.watchFile(path, function() {
if ("string" === typeof prop)
module.parent.exports.scope[variable] = require(path)[prop];
// Automatic parse querystrings. If "^/home" is specified,
// it will also check for "^/home?somedata=test"
Get(["^/(home)(.*)", "^/(news)(.*)"], function(details, regexMatch) {
details.params["help"];
...
}
Post(..., function(details, regexMatch) {
details.params["username"];
...
var http = require('http'),
sys = require('sys'),
path = require('path'),
posix = require('posix'),
events = require('events');
var Walker = function() {
this._counter = 0;
};
Walker.prototype = {
var Walker = require('./walker').Walker;
var walker = new Walker();
walker.walk('/home/test/', function(structure) {
// structure now contains dir tree
// The directory / filename
structure.name;
var vars = {};
exports.hot = function(path) {
vars = require(path);
process.watchFile(path + ".js", function() {
process.mixin(vars, require.unCache(path));
});
return vars;
var sys, path, file, random;
require({
"sys": sys,
"path": path,
"file": file,
"./module": random
}, function() {
//Call main function etc
main();