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
# minimize the use of these for better copy | |
# am,is,are,was,were,be,being,been,become,became,has,have,had,do,does,did,may,might,must,can,could,shall,should,will,would | |
\Aam\A\|\Ais\A\|\Aare\A\|\Awas\A\|\Awere\A\|\Abe\A\|\Abeing\A\|\Abeen\A\|\Abecome\A\|\Abecame\A\|\Ahas\A\|\Ahave\A\|\Ahad\A\|\Ado\A\|\Adoes\A\|\Adid\A\|\Amay\A\|\Amight\A\|\Amust\A\|\Acan\A\|\Acould\A\|\Ashall\A\|\Ashould\A\|\Awill\A\|\Awould |
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
cd project | |
rvm --rvmrc --create 1.9.2@project | |
cd ../project # confirm rvm with y | |
ruby -v # confirm version |
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
sudo kextunload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport | |
sudo kextload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport |
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
# because we don't have findsn with fslint, we need to do it ourselves | |
# find . -type f -exec basename {} \; | \ # get the name of the file. could be substituted to do hashes here | |
# sort | \ # prep for counting | |
# uniq -c | \ # count occurences | |
# grep -v "^[ \t]*1 " | \ # mind the formatting | |
# awk '{print $2}' | \ # get only the file names, not the counts | |
# xargs -I {} find . -name '{}*' # find the location of the duplicates | |
find . -type f -exec basename {} \; | \ |
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/ruby | |
# Finds the difference between a file and X changes ago | |
# gitdifflast path/to/file 2 | |
# would be the difference between this version and two changes ago (when the file actually changed not just commits) | |
# this distinguishes between the last change and the last commit | |
# use "git diff HEAD@{1} path/to/file" or "git diff HEAD^ path/to/file" for that | |
file = ARGV.shift | |
change_increment = ARGV.shift.to_i |
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
describe "console" do | |
it "should run" do | |
binding.pry | |
end | |
end | |
#> spork | |
#> rspec --drb spec/models/console_spec.rb |
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
Latency Comparison Numbers Time Light Distance Approximate Light Distance | |
-------------------------- ---- -------------- -------------------------- | |
L1 cache reference 0.5 ns 0.15 m Diagonal across your smartphone | |
Branch mispredict 5 ns 1.5 m Height of Natalie Portman | |
L2 cache reference 7 ns 2.1 m Height of Shaq | |
Mutex lock/unlock 25 ns 7.5 m Height of a school flag pole | |
Main memory reference 100 ns 30 m Half a Manhattan city block (North/South) | |
Compress 1K bytes with Zippy 3,000 ns 900 m Width of Central Park | |
Send 1K bytes over 1 Gbps network 10,000 ns 3,000 m Width of Manhattan | |
Read 4K randomly from SSD* 150,000 ns 45,000 m NYC to Hempstead on Long Island |
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
<html ng-app="myApp"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>Basic App</title> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css"> |
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
Get the previous commit hash from the last line of .git/logs/HEAD | |
Replace .git/refs/heads/yourbranch with it | |
"git status" should now work. Note the files changed (you will copy them later) | |
Push this repo elsewhere (a different branch on origin) | |
Remove the .git directory | |
Pull that repo back out to a different directory | |
Copy over the noted files to that directory | |
Commit them |
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
# Ruby 1.9.2 | |
Random.new.rand(10..15) # 10, 11, 12, 13, 14, 15 | |
Random.new.rand(10...15) # 10, 11, 12, 13, 14 | |
# Ruby >1.9.2 | |
rand(10..15) |