I hereby claim:
- I am gavinengel on github.
- I am gavinengel (https://keybase.io/gavinengel) on keybase.
- I have a public key whose fingerprint is A25A 07F1 A0C7 CAF9 1836 FA5E 2898 73B1 4558 D9C9
To claim this, I am signing this object:
#!/usr/bin/env python | |
import sys | |
import csv | |
tabin = csv.reader(sys.stdin, dialect=csv.excel_tab) | |
commaout = csv.writer(sys.stdout, dialect=csv.excel) | |
for row in tabin: | |
commaout.writerow(row) |
// jQuery | |
$('button').click(function(){ | |
$('h1, h2, p').addClass('blue') | |
$('div').removeClass('important') | |
$('h3').toggleClass('error') | |
$('#foo').attr('alt', 'Lorem Ipsum') | |
}); | |
// Eventscript | |
button:click { |
#!/usr/bin/env node | |
// source: https://gist.github.com/gavinengel/98c069197baf6a55dd2b | |
// example usage: $ pm2 start jade-watch.js; | |
var shelld = 'jade -w index.jade' // EDIT ONLY THIS LINE | |
var terminal = require('oh-my-terminal') | |
terminal.exec(shelld, function(err, stdout, stderr) { | |
if(err) console.log(err) | |
else console.log(stdout) + console.log(stderr) ; | |
}); |
I hereby claim:
To claim this, I am signing this object:
#!/usr/bin/env node | |
/** | |
* hash the std and in (6) base64 for appending to a password, perhaps yearly | |
* example: base password is `foobarbaz`, and this year's append is: tU68/+, final password is: `foobarbaztU68/+`, | |
* this means you can use a single `base password` | |
* 64^6 = 68,719,476,736 so it makes each password very difficult to "guess" | |
*/ | |
var fs = require('fs') | |
var crypto = require('crypto') | |
var home = process.env['HOME'] |
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
. ~/.bashrc | |
mkdir ~/local | |
mkdir ~/node-latest-install | |
cd ~/node-latest-install | |
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
./configure --prefix=~/local | |
make install # ok, fine, this step probably takes more than 30 seconds... | |
curl https://www.npmjs.org/install.sh | sh |
# productive Docker host? | |
1. https://coreos.com/os/docs/latest/booting-on-ec2.html and select HVM AMI | |
2. create single node (open TCP and UDP all) | |
3. ssh into node | |
4. install Rancher, see below | |
### |
#!/bin/sh | |
# you want to be able to do browser testing, but in an automated way. here is how! | |
# Step 1: create your selenium script, using https://saucelabs.github.io/sb-sauce-plugin/, Firefox, and your text editor. | |
# Step 2: install some npm's: | |
# I was able to install selenium-standalone without sudo, using this method https://gist.github.com/gavinengel/1842179837823dc25730 | |
lib; | |
npm install selenium-standalone; |
Despite being derived from classical MVC pattern JavaScript and the environment it runs in makes Javascript MVC implementation have its own twists. Lets see how typical web MVC functions and then dive into simple, concrete JavaScript MVC implementation.
Typical server-side MVC implementation has one MVC stack layered behind the singe point of entry. This single point of entry means that all HTTP requests, e.g. http://www.example.com or http://www.example.com/whichever-page/ etc., are routed, by a server configuration, through one point or, to be bold, one file, e.g. index.php.
At that point, there would be an implementation of Front Controller pattern which analyzes HTTP request (URI at first place) and based on it decides which class (Controller) and its method (Action) are to be invoked as a response to the request (method is name for function and member is name for a variable when part of the class/object).
var css = "text-shadow: -1px -1px hsl(0,100%,50%), 1px 1px hsl(5.4, 100%, 50%), 3px 2px hsl(10.8, 100%, 50%), 5px 3px hsl(16.2, 100%, 50%), 7px 4px hsl(21.6, 100%, 50%), 9px 5px hsl(27, 100%, 50%), 11px 6px hsl(32.4, 100%, 50%), 13px 7px hsl(37.8, 100%, 50%), 14px 8px hsl(43.2, 100%, 50%), 16px 9px hsl(48.6, 100%, 50%), 18px 10px hsl(54, 100%, 50%), 20px 11px hsl(59.4, 100%, 50%), 22px 12px hsl(64.8, 100%, 50%), 23px 13px hsl(70.2, 100%, 50%), 25px 14px hsl(75.6, 100%, 50%), 27px 15px hsl(81, 100%, 50%), 28px 16px hsl(86.4, 100%, 50%), 30px 17px hsl(91.8, 100%, 50%), 32px 18px hsl(97.2, 100%, 50%), 33px 19px hsl(102.6, 100%, 50%), 35px 20px hsl(108, 100%, 50%), 36px 21px hsl(113.4, 100%, 50%), 38px 22px hsl(118.8, 100%, 50%), 39px 23px hsl(124.2, 100%, 50%), 41px 24px hsl(129.6, 100%, 50%), 42px 25px hsl(135, 100%, 50%), 43px 26px hsl(140.4, 100%, 50%), 45px 27px hsl(145.8, 100%, 50%), 46px 28px hsl(151.2, 100%, 50%), 47px 29px hsl(156.6, 100%, 50%), 48px 30px hsl(162, 100%, 50%), 49px 31px hsl(167.4, 100%, 5 |