Skip to content

Instantly share code, notes, and snippets.

View gigafied's full-sized avatar

Taka Kojima gigafied

View GitHub Profile
var app = express.createServer();
app.configure(function(){
app.set('views', this.root_dir + "/" + this.template_dir);
app.set('view engine', this.template_engine);
app.use(express.bodyParser());
app.use(express.methodOverride());
app.use(app.router);
app.use(express.static(this.root_dir + "/" + this.static_dir));
});
@gigafied
gigafied / gist:1766037
Created February 8, 2012 06:24
RED Boilerplate Features + Requirements

####Requirements:

  • Scalable module system. Ability to easily create and maintain modules/components for use in projects.

  • Base boilerplate simplified & stripped down to bare essentials.

  • JavaScript based. This gives any frontend dev the ability to contribute easily if they so desire.

  • Dependency management without kludging up project repos. Config files and whatnot should be checked into the repo, actual node modules or other dependencies, should not.

@gigafied
gigafied / README.md
Created February 10, 2012 06:12 — forked from dlo/README.md
Array.remove prototype function

This is a small snippet that gives Javascript arrays the (much-needed) ability to remove elements based on value. Example:

items = [1,2,3,3,4,4,5];
items.remove(3); // => [1,2,4,4,5]
@gigafied
gigafied / gist:1822865
Created February 14, 2012 02:47
npm-debug.log re: npm install express@2.5.8
info it worked if it ends with ok
verbose cli [ 'node', '/usr/local/bin/npm', 'install', 'express@2.5.8' ]
info using npm@1.1.0-3
info using node@v0.6.10
verbose config file /Users/taka.kojima/.npmrc
verbose config file /usr/local/etc/npmrc
verbose config file /usr/local/lib/node_modules/npm/npmrc
verbose caching /Users/taka.kojima/Projects/tmp/node_modules/ender/package.json
verbose loadDefaults ender@0.8.5
verbose cache add [ 'express@2.5.8', null ]
@gigafied
gigafied / gist:1829852
Created February 14, 2012 20:10
EaselJS - Bitmap class sample
minion.define("easel.display", {
Bitmap : minion.extend("easel.DisplayObject", {
image: null,
snapToPixel: true,
init : function (imageOrUri) {
this.__super(imageOrUri);
@gigafied
gigafied / gist:1831065
Created February 14, 2012 22:27
Lots of execs in node
var commands = [];
commands.push("git -v");
commands.push("git -v");
commands.push("git -v");
commands.push("git -v");
commands.push("git -v");
commands.push("git -v");
commands.push("git -v");
@gigafied
gigafied / exec-queue.js
Created February 14, 2012 23:05
Node.js ExecQueue
/*jslint node: true, onevar: false */
/*global jake, desc, task */
var ExecQueue = function (silent) {
this.commands = [];
this.silent = silent;
};
ExecQueue.prototype.add = function () {
for (var i = 0; i < arguments.length; i ++) {
@gigafied
gigafied / gist:1832647
Created February 15, 2012 02:27
== use cases
function createBox1 (width, height, x, y) {
x = x || 100;
y = y || 200;
return {width: width, height: height, x: x, y: y};
}
function createBox2 (width, height, x, y) {
@gigafied
gigafied / current.js
Created February 21, 2012 21:38
Minion - Formats
minion.define("example.module", {
require : [
"f00.module.ModuleA",
"f00.module.ModuleB"
],
SomeModule : minion.extend("f00.module.BaseModule", {
init : function () {
@gigafied
gigafied / gist:1935833
Created February 28, 2012 22:52
Private vars with Rosy
var red = red || {};
red.Module = Class.extend({
init : function (aVal, bVal) {
/* All private variables have to live here. */
var a;
var b;