Skip to content

Instantly share code, notes, and snippets.

@amadden80
amadden80 / gist:11197535
Last active August 29, 2015 14:00
git-hook-fix
cd ~/code/wdi/WDI_NYC_Apr14_Proto/.git/hooks
mv pre-commit pre-commit-temp.sample
cd ../..
# Make the file the way they "should" be
git add -A
git commit -m "git hook hack"
cd ~/code/wdi/WDI_NYC_Apr14_Proto/.git/hooks
mv pre-commit-temp.sample pre-commit
@amadden80
amadden80 / gist:11197738
Last active August 29, 2015 14:00
git-hook-hack
# Move ALL the files and folders to where they "Should" be BEFORE running this!!!
# Copy/Paste this from within the root of the repo:
# curl 'https://gist.githubusercontent.com/amadden80/11197738/raw/898d5382af2608c087b5b4dbc0c9aec070c6d39e/gistfile1.sh' | bash
mv .git/hooks/pre-commit .git/hooks/pre-commit-temp.sample
git add -A
git commit -m "pre-hook hack"
mv .git/hooks/pre-commit-temp.sample .git/hooks/pre-commit
module MTA
def self.set_mta_data
cleaned_mta_data = {}
lines_name_color.each do |name_color|
cleaned_mta_data[name_color[0]] = {
name: name_color[0],
color: name_color[1],
@amadden80
amadden80 / MTA.rb
Created June 1, 2014 20:54
mta data
module MTA
def self.set_mta_data
cleaned_mta_data = {}
lines_name_color.each do |name_color|
cleaned_mta_data[name_color[0]] = {
name: name_color[0],
color: name_color[1],
@amadden80
amadden80 / do.sh
Created October 12, 2014 12:38
Digital Ocean - Ruby & Postgresql
sudo apt-get -y install ruby-dev
sudo apt-get -y install postgresql
sudo apt-get -y install postgresql-contrib
sudo apt-get -y install libpq-dev
sudo apt-get -y install build-essential
touch ~/.psql_history
sudo -u postgres createuser --superuser $USER
@amadden80
amadden80 / gist:40eb8068717fbc13a1fb
Created October 22, 2014 20:54
require csv so it works for both mac and linux
begin
require 'CSV'
rescue
require 'csv'
end
@amadden80
amadden80 / dating.js
Last active August 29, 2015 14:10
Dating Helpers
// Flamer
$('body').on('keydown', function(e){
var key = e.keyCode;
if (key==37){
$('button.green').first().click()
}else if(key==39){
$('button.red').first().click()
}
})
@amadden80
amadden80 / server.js
Created December 31, 2014 18:26
Small Node Static File Server
var port = parseInt(process.argv[2]) || 8000;
var http = require('http');
var fs = require('fs');
var path = require('path');
http.createServer(function (request, response) {
var filePath = request.url;
@amadden80
amadden80 / hackhtml.js
Last active August 29, 2015 14:13
Hack Some HTML!!!
// Copy Paste into JS console for ANY website...
var images = document.getElementsByTagName('img')
for (var i = 0; i < images.length; i++) {
images[i].src = 'http://andrewmadden.com/pageContent/images/face.png' ;
}
@amadden80
amadden80 / server.rb
Created January 13, 2015 18:03
Simple Ruby Server
require 'socket'
server = TCPServer.new 2000
loop do
client = server.accept
if request = client.gets
puts "\n------ request ------"