Skip to content

Instantly share code, notes, and snippets.

View chrishunt's full-sized avatar
🏕️
Adventuring

Chris Hunt chrishunt

🏕️
Adventuring
View GitHub Profile
def test_proc
Proc.new { return }.call
puts 'Never see this...'
end
def test_lambda
lambda { return }.call
puts 'Do see this...'
@chrishunt
chrishunt / instagram_download.md
Created December 8, 2012 17:00
Download Instagram Photos

Download High Resolution Instagram Photos

  1. Go to http://statigr.am/yourlogin
  2. Scroll down as many times as it is needed to have all yor pictures thumbnails displayed
  3. In the JS Console, grab all images
```javascript
$(".lienPhotoGrid a img").each(function(index) { console.log($(this).attr('src')) })
```
  1. Copy all image urls to a file
@chrishunt
chrishunt / arity.rb
Last active December 14, 2015 13:58
def foo(x, y); end
def bar(x, y = 2); end
def baz(x = 1, y = 2); end
method(:foo).arity #=> 2
method(:bar).arity #=> -2
method(:baz).arity #=> -1
def buz(x, y: 2); end
def pat(x: 1, y: 2); end
@chrishunt
chrishunt / .vimrc
Created April 8, 2013 17:45
Run specs with ,t
" Run specs with ',t' via Gary Bernhardt
function! RunTests(filename)
" Write the file and run tests for the given filename
:w
:silent !clear
if match(a:filename, '\.feature$') != -1
exec ":!script/features " . a:filename
else
if filereadable("script/test")
exec ":!script/test " . a:filename
@chrishunt
chrishunt / Gemfile
Last active December 16, 2015 00:28
Fake service for testing
source 'https://rubygems.org'
gem 'foreman'
gem 'sinatra'
@chrishunt
chrishunt / arabic.yml
Last active December 16, 2015 07:28
i18n in Ruby
arabic:
hello: "مرحبا العالم!"
@chrishunt
chrishunt / README.md
Last active December 16, 2015 09:29
_why ?
$ curl -o pspc16 https://dl.dropboxusercontent.com/u/856934/pspcl6
$ chmod +x pspc16
$ gem install snoop terminal-notifier
$ ruby why.rb
@chrishunt
chrishunt / house_hunting.rb
Last active December 16, 2015 16:19
Be notified when a new house matching your criteria is posted to Craigslist
# Be notified when a new house matching your criteria is posted to Craigslist
require 'snoop'
MAX_RENT = 1900
BEDROOMS = 2
CITY = 'portland'
CATS = true
DOGS = true
@chrishunt
chrishunt / .gitconfig.sh
Last active December 17, 2015 02:28
Delete merged branches with `git bam`
[alias]
bam = "!source ~/.githelpers && delete_local_merged_branches"
bamr = "!source ~/.githelpers && delete_remote_merged_branches"
@chrishunt
chrishunt / gist:5537390
Last active December 17, 2015 02:39
Remove trailing whitespace for all files in a project using vim
:args `git grep -l .`
:argdo :%s/\s\+$//gc | w