Skip to content

Instantly share code, notes, and snippets.

View gavinengel's full-sized avatar

Gavin Engel gavinengel

View GitHub Profile
@gavinengel
gavinengel / index.js
Created August 26, 2015 18:53
generate a six char password suffix (64bit)
#!/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']
@gavinengel
gavinengel / openshift-mysql.sh
Created August 10, 2014 02:16
OpenShift MySQL CLI
#!/bin/sh
# connect to database for administration
mysql -h $OPENSHIFT_MYSQL_DB_HOST -P ${OPENSHIFT_MYSQL_DB_PORT:-3306} -u ${OPENSHIFT_MYSQL_DB_USERNAME:-'admin'} --password="$OPENSHIFT_MYSQL_DB_PASSWORD" ${OPENSHIFT_APP_NAME};
@gavinengel
gavinengel / feedback-bindingjs
Created January 2, 2015 18:09
for bindingjs
gavin@localhost:~/Desktop/bindingjs$ grunt
Running "jshint:grunt" (jshint) task
>> 10 files lint free.
Running "eslint:grunt" (eslint) task
Running "jsonlint:grunt" (jsonlint) task
>> 3 files lint free.
Running "mkdir:grunt" (mkdir) task
@gavinengel
gavinengel / bashresults
Created January 2, 2015 19:24
feedback2-bindingjs
gavin@localhost:~/Desktop/bjs/bindingjs-0.9.1$ grunt --force
Running "jshint:grunt" (jshint) task
>> 10 files lint free.
Running "eslint:grunt" (eslint) task
Running "jsonlint:grunt" (jsonlint) task
>> 3 files lint free.
Running "mkdir:grunt" (mkdir) task
@gavinengel
gavinengel / class-and-attr-manipulation.js
Last active August 29, 2015 14:18
Eventscript (proposed concise, nested script for DOM event handling) vs Javascript
// jQuery
$('button').click(function(){
$('h1, h2, p').addClass('blue')
$('div').removeClass('important')
$('h3').toggleClass('error')
$('#foo').attr('alt', 'Lorem Ipsum')
});
// Eventscript
button:click {
@gavinengel
gavinengel / daemonic.stub.js
Last active August 29, 2015 14:20
daemonic: wrapper stub for turning a normall shell command into a node.js daemon
#!/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) ;
});
@gavinengel
gavinengel / keybase.md
Created May 27, 2015 01:45
keybase.md

Keybase proof

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:

@gavinengel
gavinengel / node-and-npm-in-30-seconds.sh
Created December 8, 2015 18:49 — forked from isaacs/node-and-npm-in-30-seconds.sh
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
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
@gavinengel
gavinengel / cloud9-error
Created August 19, 2013 06:11
Cloud9 Error
#### commands used to setup virtual machine, per:
#### https://github.com/ajaxorg/cloud9/issues/2905#issuecomment-22685063 ####
sudo apt-get install -y build-essential g++ curl libssl-dev apache2-utils git libxml2-dev;
# to get package 'add-apt-repository'
sudo apt-get install software-properties-common
sudo apt-get install python-software-properties
# adding node.js
@gavinengel
gavinengel / SassMeister-input.scss
Created November 12, 2013 19:56
Generated by SassMeister.com.
// ----
// Sass (v3.3.0.rc.1)
// Compass (v0.13.alpha.10)
// ----
@import "breakup";
$breakup-breakpoints: (
'thin' '(max-width: 35.999em)',