Skip to content

Instantly share code, notes, and snippets.

View eladb's full-sized avatar
🤖

Elad Ben-Israel eladb

🤖
View GitHub Profile
@eladb
eladb / package.json
Created June 23, 2012 19:25
mylittlepaas - async module
{
"author": "Elad Ben-Israel <[email protected]>",
"name": "mylittlepaas",
"description": "Root repository of my little PaaS",
"version": "0.0.0",
"repository": {
"type": "git",
"url": "git://github.com/eladb/mylittlepaas.git"
},
"main": "app",
@eladb
eladb / gist:2980212
Created June 23, 2012 21:56
mylittlepaas - npm shrinkwrap
$ npm install
npm http GET https://registry.npmjs.org/asciimo/0.3.1
npm http 200 https://registry.npmjs.org/asciimo/0.3.1
npm http GET https://registry.npmjs.org/asciimo/-/asciimo-0.3.1.tgz
npm http 200 https://registry.npmjs.org/asciimo/-/asciimo-0.3.1.tgz
npm WARN excluding symbolic link fonts/Cursive.flf -> slscript.flf
npm http GET https://registry.npmjs.org/colors
npm http 304 https://registry.npmjs.org/colors
[email protected] ./node_modules/asciimo
└── [email protected]
@eladb
eladb / app.js
Created June 23, 2012 21:57
mylittlepaas - app with asciimo
var http = require('http');
var urlparse = require('url').parse;
var asciimo = require('asciimo').Figlet;
http.createServer(function(req, res) {
if (req.url === '/mysupersecretdeploymentendpoint' && req.method === 'POST') {
console.log('Post-receive trigger. Exiting in 1.5 second');
setTimeout(function() { process.exit(1); }, 1500);
return res.end();
}
@eladb
eladb / gist:2980228
Created June 23, 2012 21:59
mylittlepaas - commit with module
$ git add app.js npm-shrinkwrap.json package.json
$ git commit -m 'asciimo'
[master d901bff] asciimo
3 files changed, 24 insertions(+), 3 deletions(-)
create mode 100644 npm-shrinkwrap.json
$ git push origin master
Counting objects: 8, done.
Delta compression using up to 4 threads.
@eladb
eladb / gist:2980244
Created June 23, 2012 22:05
mylittlepaas - GET / (with banner)
$ curl http://ec2xxx.compute.amazonaws.com
# # ###### # # #### # # #### ##### # #####
# # # # # # # # # # # # # # # #
###### ##### # # # # # # # # # # # # #
# # # # # # # ### # ## # # # ##### # # #
# # # # # # # ### ## ## # # # # # # #
# # ###### ###### ###### #### # # # #### # # ###### #####
@eladb
eladb / gist:2980597
Created June 23, 2012 23:51
mylittlepaas - ec2 user data
#!/bin/bash
# install node and friends
apt-add-repository -y ppa:chris-lea/node.js
apt-get update
apt-get install -y python-software-properties nodejs npm git make g++
# install girror (https://github.com/eladb/node-girror)
npm install -g girror
@eladb
eladb / hello.js
Created July 4, 2012 08:55
cantest - hello
// a simple drawing function
module.exports = function(ctx) {
ctx.fillStyle = 'red';
ctx.fillRect(10, 10, 100, 100);
ctx.fillStyle = 'blue';
ctx.fillRect(20, 20, 80, 80);
};
@eladb
eladb / hello-test.js
Created July 4, 2012 09:04
cantest - hello-test
var Canvas = require('canvas');
var hello = require('./hello');
// tests the `hello` rendering function
module.exports = function() {
var canvas = new Canvas(120, 120);
var ctx = canvas.getContext('2d');
// call `hello` to do it's magic
hello(ctx);
@eladb
eladb / hello-2.js
Created July 4, 2012 09:19
cantest - hello-2.js
// a simple drawing function
module.exports = function(ctx) {
ctx.fillStyle = 'red';
ctx.fillRect(10, 10, 100, 100);
ctx.fillStyle = 'blue';
ctx.fillRect(20, 20, 90, 90); // make inner box bigger
};
@eladb
eladb / install.sh
Created September 1, 2012 08:11
Hello uijs
#!/bin/bash
mkdir -p ~/uijsdev
cd ~/uijsdev
git clone [email protected]:eladb/uijs
git clone [email protected]:eladb/uijs-controls
git clone [email protected]:eladb/uijs-devtools
cd uijs-devtools
npm install -g .
cd ../uijs
npm link