Skip to content

Instantly share code, notes, and snippets.

@jney
jney / nokogiri.sh
Created September 20, 2011 14:08 — forked from retr0h/gist:1001477
RVM + HomeBrew + Nokogiri
#!/bin/sh
##
# to install :
# $ curl -L "https://gist.github.com/gists/path/to/raw/gist/nokogiri.sh" | sh
set -e
echo "installing libraries"
brew install libxml2
@jney
jney / gist:1562752
Created January 4, 2012 23:14
recipe
# Application Generator Template
# Modifies a Rails app to use Mongoid and OmniAuth
# Usage: rails new APP_NAME -m http://gist.github.com/path/to/this/raw/gist -T -O
# Information and a tutorial:
# http://github.com/RailsApps/rails3-mongoid-omniauth/
# Generated using the rails_apps_composer gem:
# https://github.com/RailsApps/rails_apps_composer/
sudo tcpdump -s 1024 -l -i eth0 -n -A host $DOMAIN and port 80 -w $OUTPUT
#!/usr/bin/env ruby
filename = case ARGV.size
when 0 then '.env'
when 1 then ARGV.first
else raise 'Too much arguments'
end
envs = File.read(filename).split("\n").join(" ")
#!/usr/bin/perl
my $device_id = $ARGV[0];
`xinput list-props ${device_id}` =~ /Synaptics Off \((\d+)\).*(\d)/;
my $param_id = $1;
my $param_status = abs($2 - 1);
system("xinput", "set-prop", $device_id, $param_id, $param_status);
@jney
jney / cv.tex
Created October 22, 2012 22:17
\documentclass[11pt]{article}
\usepackage[margin=2.5cm]{geometry}
\usepackage[utf8x]{inputenc}
\usepackage{hyperref}
\usepackage{enumitem}
\setdescription{labelsep=\textwidth}
\usepackage{array, xcolor}
\definecolor{lightgray}{gray}{0.8}
\newcolumntype{L}{>{\raggedleft}p{0.14\textwidth}}
\newcolumntype{R}{p{0.8\textwidth}}
touch "db/migrate/$(date +%m%d%Y%H%M%S)_create_user.rb"
package main
import (
"fmt"
"sync"
"time"
)
func main() {
var wg sync.WaitGroup
CREATE OR REPLACE FUNCTION notify_changes() RETURNS trigger AS $notify_changes$
DECLARE
CHANNEL TEXT;
ID TEXT;
JSON TEXT;
BEGIN
CHANNEL := 'changes';
IF (TG_OP = 'DELETE') THEN
ID := OLD.id;
ELSE