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
It's simple. Just type in: | |
git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit -- | |
I guess that's a bit too long, eh? Let's just make an alias. Copy and paste the line below on your terminal: | |
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --" | |
And every time you need to see your log, just type in | |
git lg |
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
function fish_prompt -d "Write out the prompt" | |
printf '%s' (vcprompt) (set_color $fish_color_cwd) (prompt_pwd) (set_color normal) ' > ' | |
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
require 'oauth' | |
require 'json' | |
consumer_key = 'etdTVJFmBsqOjZITP_MqJQ' | |
consumer_secret = 'S1DUC0OqdRWrbvuhjVuF5QI3cEY' | |
token = 'm_fA4dzJ78ppRTrd2otSPFOTEx2Q_J4c' | |
token_secret = 'hL8scdaQ0gRMLPOj5ZCF7Wg3XvA' | |
api_host = 'api.yelp.com' |
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
library("hash") | |
# States treated as going democratic with probability 1 | |
DemStates <- hash() | |
.set(DemStates, "WA"=12, "OR"=7, "CA"=55, "NM"=5, | |
"MN"=10, "WI"=10, "MI"=16, "IL"=20, | |
"PA"=20, "MD"=10, "DC"=3, "DE"=3, | |
"NJ"=14, "CT"=7, "RI"=4, "MA"=11, | |
"VT"=3,"ME"=4,"HI"=4, "NY"=29) |
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
<!-- Add the following lines to theme's html code right before </head> --> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script> | |
<script src="http://static.tumblr.com/fpifyru/VCxlv9xwi/writecapture.js"></script> | |
<script src="http://static.tumblr.com/fpifyru/AKFlv9zdu/embedgist.js"></script> | |
<!-- | |
Usage: just add <div class="gist">[gist URL]</div> | |
Example: <div class="gist">https://gist.github.com/1395926</div> | |
--> |
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
library('hash') | |
states = hash() | |
.set(states, | |
"CO" = 0.8, "FL" = 0.5, "IA" = 0.84, "NBC2" = 0.87, | |
"NH" = 0.85, "NC" = 0.74, "VA" = 0.79, "AZ" = 0.98, | |
"MNC2" = 0.95, "MI" = 0.99, "MT" = 0.98, "NV" = 0.93, | |
"NM" = 0.99, "OH" = 0.91, "PA" = 0.99, "WI" = 0.97) | |
run.simulation <- function() |
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
library('grid') | |
pushViewport(viewport(layout = grid.layout(4, 1))) | |
print(a, vp = viewport(layout.pos.row = 1, layout.pos.col = 1)) | |
print(b, vp = viewport(layout.pos.row = 2, layout.pos.col = 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
irb(main):002:0> def convert_to_annual(ary) | |
irb(main):003:1> len = ary.length | |
irb(main):004:1> rem = len % 12 | |
irb(main):005:1> idx = len / 12 | |
irb(main):006:1> ret = idx.times.map { |i| ary[i..(i+11)].reduce(:+) } | |
irb(main):007:1> ret << ary[(len - rem)..(len)].reduce(:+) | |
irb(main):008:1> ret | |
irb(main):009:1> 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
filepath = "#{Rails.root.join('tmp')}/new" | |
File.open(filepath, "wb") do |f| | |
f.write open(@account.logo.url).read | |
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
Showing /Users/thomasvladeck/Git/bh_pro/app/views/proposals/_cover_sheet.xlsx.axlsx where line #6 raised: | |
No such file or directory - /uploads/account/logo/1/me_climbing_mountains.jpg | |
Extracted source (around line #6): | |
3 | |
4 | |
5 | |
6 | |
7 | |
8 |
OlderNewer