Skip to content

Instantly share code, notes, and snippets.

View eladb's full-sized avatar
🤖

Elad Ben-Israel eladb

🤖
View GitHub Profile
@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 / 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 / gist:2980244
Created June 23, 2012 22:05
mylittlepaas - GET / (with banner)
$ curl http://ec2xxx.compute.amazonaws.com
# # ###### # # #### # # #### ##### # #####
# # # # # # # # # # # # # # # #
###### ##### # # # # # # # # # # # # #
# # # # # # # ### # ## # # # ##### # # #
# # # # # # # ### ## ## # # # # # # #
# # ###### ###### ###### #### # # # #### # # ###### #####
@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 / 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: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 / 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:2979574
Created June 23, 2012 19:17
mylittlepaas - commit trigger
$ git commit -am 'Adding post-receive hook endpoint'
[master 54b0128] Adding post-receive hook endpoint
1 files changed, 7 insertions(+), 1 deletions(-)
$ git push origin master
Counting objects: 5, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 538 bytes, done.
Total 3 (delta 1), reused 0 (delta 0)
To [email protected]:eladb/mylittlepaas2.git
@eladb
eladb / gist:2979066
Created June 23, 2012 17:11
mylittlepaas - clone hello world
$ git clone [email protected]:eladb/mylittlepaas.git
Cloning into mylittlepaas...
@eladb
eladb / gist:2979060
Created June 23, 2012 17:10
mylittlepaas - GET / (v2)
$ curl http://ec2-11-111-11-111.eu-west-1.compute.amazonaws.com
Hello, little PaaS (v2)