Skip to content
View railsconf_schedule.rb
$("<script/>", {type: "text/javascript", src: "https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.2/moment.min.js"}).appendTo(document.body);
$(".session-content a").on("click", function() { event.stopPropagation(); });
$(".session-content").on("click", function() {
var session = $(this),
title = session.find(".session-title"),
details = title.find("a")[0].href,
speaker = session.find(".speaker-name"),
room = $("th").eq(session.parent().index()),
text = function(el) { return el.text().trim(); },
View outlook_proxy.rb
require 'openssl'
require 'socket'
Thread.abort_on_exception = true
server = TCPServer.new(1993)
n = 0
loop do
client = server.accept
n += 1
View 0_enumerator.rb
class Benerator
def initialize(&block)
@block = block
end
def next
as_array.shift
end
def as_array
View alias.rb
class Parent
def foo
"Parent#foo"
end
alias :bar :foo
end
class Child < Parent
def foo
"Child#foo"
View python.py
def foo(a=[]):
a.append(1)
return a
foo() # => [1]
foo() # => [1, 1]
foo() # => [1, 1, 1]
View gist:4b8fa67efb8e0c650fbc
{
"java": {
"jdk_version": "7",
"oracle": {"accept_oracle_download_terms": "true"},
"accept_license_agreement": "true",
"install_flavor": "oracle"
},
"elasticsearch": {
"nginx": {
"users": [{"username": "salesloft", "password": "<haha you wish>"}],
View sqrtSums.hs
sqrtSums :: Double -> Int
sqrtSums x = length (takeWhile (<x) (scanl1 (+) (map sqrt [1..]))) + 1
View gist:7807702
$ time ls -lh > ~/files.txt
real 186m14.030s
user 0m9.361s
sys 43m37.939s
View gist:7356242
ve() {
local curdir ve
curdir="$PWD"
[ -z "$1" ] && ve="ve" || ve="$1"
while ! ls -d "$ve" >/dev/null 2>&1; do
if [ "$PWD" == "/" ]; then
echo "Cannot find a '$ve' directory on the current path" >&2
cd $curdir
return -1
fi
View gist:5214764
[alias]
pep8 = !git status -s | awk '{print $2}' | grep '.py' | xargs pep8
pyflakes = !git status -s | awk '{print $2}' | grep '.py' | xargs pyflakes
Something went wrong with that request. Please try again.