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
def notify(msg) | |
system("notify-send", msg) | |
end | |
Signal.trap("HUP") { | |
3.downto(1) { |n| notify("#{n}..."); sleep 1 } | |
notify("DEATH!") | |
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
/*! | |
* jQuery throttle / debounce - v1.1 - 3/7/2010 | |
* http://benalman.com/projects/jquery-throttle-debounce-plugin/ | |
* | |
* Copyright (c) 2010 "Cowboy" Ben Alman | |
* Dual licensed under the MIT and GPL licenses. | |
* http://benalman.com/about/license/ | |
*/ | |
// Script: jQuery throttle / debounce: Sometimes, less is more! |
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
class Binding | |
def +(other) | |
self.eval do | |
other.eval do | |
binding | |
end | |
end | |
end | |
end |
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
require 'set' | |
require 'pp' | |
require 'date' | |
require 'pry' | |
class Index | |
include Enumerable | |
def initialize |
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
class EpiTest | |
def self.inherited(base) | |
at_exit { base.new.run_my_tests_bitch! } | |
end | |
class Fail < Exception; end | |
def assert(thing) | |
raise Fail.new(caller_locations[0]) unless thing |
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
// ==UserScript== | |
// @name YouTube: Click a username and see their videos! | |
// @namespace http://github.com/epitron/ | |
// @version 0.1 | |
// @description When you click a username, instead of seeing that lame youtube user's "summary" page, you get their actual list of videos (sorted by date). | |
// @include /^https?://(?:www\.)?(?:youtube\.com)/.*/ | |
// @copyright 2013 epitron | |
// ==/UserScript== | |
(function() { |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <unistd.h> | |
#include <fcntl.h> | |
#include <errno.h> | |
#include <linux/input.h> | |
#include <linux/uinput.h> | |
#define die(str, args...) do { \ |
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
def rle_regexp(s) | |
s.scan(/(.)(\1*)/).map {|c, extra| [c, extra.size+1] } | |
end | |
def rle_each_char(s) | |
result = [] | |
last = nil | |
count = 0 |
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
require 'pp' | |
class ProxyController < ApplicationController | |
# Example headers: | |
# {"GATEWAY_INTERFACE"=>"CGI/1.1", | |
# "PATH_INFO"=>"/proxy/http:/google.com", | |
# "QUERY_STRING"=>"", | |
# "REMOTE_ADDR"=>"127.0.0.1", | |
# "REMOTE_HOST"=>"127.0.0.1", |
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
$ gem install -V pry-plus coolline | |
HEAD https://api.rubygems.org/latest_specs.4.8.gz | |
302 Moved Temporarily | |
HEAD https://s3.amazonaws.com/production.s3.rubygems.org/latest_specs.4.8.gz | |
304 Not Modified | |
HEAD https://api.rubygems.org/specs.4.8.gz | |
302 Moved Temporarily | |
HEAD https://s3.amazonaws.com/production.s3.rubygems.org/specs.4.8.gz | |
304 Not Modified | |
GET https://api.rubygems.org/quick/Marshal.4.8/json-1.5.5-java.gemspec.rz |