This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo npm install nodemon -g | |
nodemon server.coffee | |
open stand-alone.html | |
stand-alone.html?room1 | |
stand-alone.html?room2 | |
stand-alone.html?room3 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
require 'open3' | |
require 'colorize' | |
# CODE | |
@actions = {} | |
def action(id, name, &block) | |
@actions[id] = { name:name, func:block } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
# create .git/hooks/post-commit | |
# chmod +x .git/hooks/post-commit | |
# http://githooks.com/ | |
# to test if it works just run ".git/hooks/post-commit" and it should post last git commit | |
require 'net/http' | |
require 'uri' | |
require 'colorize' # gem install colorize |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module StringBase | |
KEYS = 'bcdfghjklmnpqrstvwxyz' | |
def self.encode( value ) | |
ring = Hash[KEYS.chars.map.with_index.to_a.map(&:reverse)] | |
base = KEYS.length | |
result = [] | |
until value == 0 | |
result << ring[ value % base ] | |
value /= base |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
require 'colorize' | |
colors = [:green, :red, :yelow, :blue] | |
$stdin.each_line do |l| | |
for el, i in ARGV.each_with_index | |
next unless l =~ /#{el}/ | |
print l.send(colors[i]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
find = ARGV.join(' ') | |
unless find =~ /\w/ | |
print "WHAT: Finds text via grep -r, trims long reponses, pretty print and open file interface\n" | |
print "USAGE: ./finds [text to find in realtive path without quotes]\n" | |
print "EXAMPLE: ./finds def avatar\n" | |
print "@dux 2014\n" | |
exit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
[email protected] | |
REMOTE_DB_NAME=db_production | |
REMOTE_DB_USER=db_user | |
REMOTE_DB_PASS=db_pass | |
LOCAL_DB=db_local | |
echo $REMOTE_DB_PASS | pbcopy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// GOOD bookmarklet, copy and paste | |
javascript:elms=['masthead-positioner-height-offset', 'content', 'footer-container', 'masthead-positioner'];for (i in elms) { var e=document.getElementById(elms[i]); if (e) e.parentNode.removeChild(e); };document.getElementById('player-api').setAttribute('class','player-api');window.exTFS=function(){ s = document.body.clientHeight-1; document.getElementById('player-api').setAttribute('style','position:absolute;top:0px; left:0px; width:100%; min-height:'+s+'px;z-index:100000000000');document.getElementById('movie_player').setAttribute('style','min-height:'+s+'px;');void(document.getElementsByTagName('video')[0].setAttribute('style','width:100%;min-height:'+s+'px;'))};window.onresize=exTFS;exTFS(); | |
// annotated source | |
elms=['masthead-positioner-height-offset', 'content', 'footer-container', 'masthead-positioner']; | |
for (i in elms) { var e=document.getElementById(elms[i]); if (e) e.parentNode.removeChild(e); } | |
document.getElementById('player-api').setAttribute('class','player- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
require 'colorize' | |
@locations = [] | |
def generate_file( file_name, data ) | |
if File.exist?(file_name) | |
info = 'exists'.red | |
else |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
require 'colorize' | |
require 'optparse' | |
options = {} | |
op = OptionParser.new do |opts| | |
opts.banner = "Usage: git-stat.rb [options]" | |
opts.on("-d", "--days N", Integer, "In last x days") do |v| | |
options[:days] = v |