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
limit = ARGV[0].to_i | |
limit.times {|i| system "say #{limit-i} bottles of beer on the wall, #{limit-i} bottles of beer. Take one down, pass it around, #{limit-(i+1)} bottles of beer on the wall."} |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
# ---------------------------------------------------------------------- | |
# PROMPT | |
# ---------------------------------------------------------------------- | |
function parse_git_dirty { | |
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit, working directory clean" ]] && echo "*" | |
} | |
function parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/(\1$(parse_git_dirty))/" | |
} |
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
# ------------------------------------ | |
# Open Browser to URL | |
# ------------------------------------ | |
unset gd | |
gdCall(){ | |
unalias gd | |
open "http://bringvictory.com/" | |
if [[ "$#" -ge 1 ]]; then | |
echo "wat" |
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 'benchmark/ips' | |
module ExtraMath | |
def self.build_math(attr_name) | |
attr_name = attr_name.to_s | |
class_eval %Q{ | |
def #{attr_name}(x) | |
x + x | |
end | |
} |
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
hardstatus alwayslastline | |
hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B} %m-%d %{W}%c %{g}]' |
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
%s/\(Foo::SubFoo::.*\.name\)/"#{\1}"/g | |
[ | |
Foo::SubFoo::One, | |
Foo::SubFoo::Two, | |
Foo::SubFoo::Three, | |
Foo::SubFoo::Four | |
] | |
# => |
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
const daysAgo = ((days, date) => { let d = date || new Date(); d.setDate(d.getDate() - (days || 1)); return d; }); | |
const hoursAgo = ((hours, date) => { let d = date || new Date(); d.setHours(d.getHours() - (hours || 1)); return d; }); | |
const mintuesAgo = ((mins, date) => { let d = date || new Date(); d.setMinutes(d.getMinutes() - (mins || 1)); return d; }); |
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
#!/usr/bin/env ruby | |
require 'pry' | |
class PropParser | |
HEX = %w(8 9 A B C D E F) | |
attr_reader :colors | |
def self.execute(source_file, out_file) |
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
CREATE USER postgres; | |
SELECT rolname FROM pg_roles; | |
ALTER USER postgres WITH CREATEUSER; |
OlderNewer