This file contains 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
{ | |
"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>"}], |
This file contains 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 foo(a=[]): | |
a.append(1) | |
return a | |
foo() # => [1] | |
foo() # => [1, 1] | |
foo() # => [1, 1, 1] |
This file contains 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 Parent | |
def foo | |
"Parent#foo" | |
end | |
alias :bar :foo | |
end | |
class Child < Parent | |
def foo | |
"Child#foo" |
This file contains 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 Benerator | |
def initialize(&block) | |
@block = block | |
end | |
def next | |
as_array.shift | |
end | |
def as_array |
This file contains 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 'openssl' | |
require 'socket' | |
Thread.abort_on_exception = true | |
server = TCPServer.new(1993) | |
n = 0 | |
loop do | |
client = server.accept | |
n += 1 |
This file contains 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
$("<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(); }, |
This file contains 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
rsync -av --delete --exclude-from="$HOME/exclude.rsync" "$HOME" <server>:<backup dir>/ |
This file contains 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
:w !sudo tee % |
This file contains 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
old() | |
{ | |
command=$1 | |
shift | |
$(which -a $command | head -n 2 | tail -n 1) $@ | |
} |
This file contains 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
head -n 2 | tail -n 1 |
OlderNewer