Skip to content

Instantly share code, notes, and snippets.

View zph's full-sized avatar

Zander Hill zph

View GitHub Profile
# Variables to replace in urls below
username = 'your_username_here_without_at_symbol'
key = 'public_key_from_dev'
application_token = 'very_long_application_token'
# This needs to be parsed as JSON for all of the 'id' fields. These are the board_hashes
url_for_board_hashes = "https://api.trello.com/1/members/#{username}/boards?&key=#{key}&token=#{application_token}"
#
# Loop over each board_hash and call the following url
#!/usr/bin/env ruby
require 'net/nntp'
# Environment: ruby-1.9.3-p286/bin/ruby
# ruby-net-nntp (1.0.0)
nntp = Net::NNTP.new
nntp.host = 'localhost' # also default
nntp.port = 119 # default port
welcome = nntp.connect
puts welcome
OKResponse === welcome
@zph
zph / .vimrc
Created January 13, 2013 06:12
function! FoldingOn()
nnoremap <Space> za
set foldmethod=indent
autocmd FileType ruby,haml,eruby,yaml,html,javascript,sass set foldmethod=syntax et
" Set all folds to open
" execute "normal zR"
endfunction
command! FoldingOn call FoldingOn()

Ruby, Pry, Tmux, and Magic (aka Slimux)

Who am I? I'm Zander or some variation of ZPH for sites like Github (ZPH) or Twitter (@_ZPH)

Tools Under Discussion:

-Ruby - Programming Language http://www.ruby-lang.org/en/

-Pry Gem - A Library for Ruby that provides a REPL session (ie interactive Ruby environment)

@zph
zph / gist:4588491
Created January 21, 2013 19:19 — forked from Gregg/gist:968534

Screencasting Framework

The following document is a written account of the Code School screencasting framework. It should be used as a reference of the accompanying screencast on the topic.

Why you should care about screencasting?

You're probably aren't going to take the time to read this document if you're not interested, but there are a lot of nice side effects caused by learning how to create quality screencasts.

  1. Communicating more effectively - At Envy Labs we produce screencasts for our clients all the time. Whether it's demoing a new feature or for a presentation for an invester, they're often much more effective and pleasent than a phone call or screen sharing.
Error when trying to setup Spree on OSX Dev Machine
===
/Users/zph/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/x86_64-darwin12.2.0/psych.bundle: warning: already initialized constant ANY
/Users/zph/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/x86_64-darwin12.2.0/psych.bundle: warning: already initialized constant UTF8
/Users/zph/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/x86_64-darwin12.2.0/psych.bundle: warning: already initialized constant UTF16LE
/Users/zph/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/x86_64-darwin12.2.0/psych.bundle: warning: already initialized constant UTF16BE
/Users/zph/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/psych/nodes/stream.rb:12: warning: already initialized constant ANY
/Users/zph/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/psych/nodes/stream.rb:15: warning: already initialized constant UTF8
/Users/zph/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/psych/nodes/stream.rb:18: warning: already initialized constant UTF16LE
/Users/zph/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/psych/nodes/st
@zph
zph / gist_error.md
Created January 24, 2013 01:58
Gist Error on Github

Error Description: Clicking on 'Your Gists' leads me to an error page.

Start Page: https://gist.github.com Login State: Logged In

Full Description: Clicking 'Your Gist' leads me to see the following error once the subsequent page loads (url: https://gist.github.com/zph)

'Whoops. We seem to have missed the gist of that gist you were looking for.'

# Re-write for run by @_ZPH
# OO Ruby
gem = File.open('Gemfile').readlines.reject { |l| l =~ /lame/ }.join
File.write('Gemfile', gem)
# obtuse bash
grep -v "lame" Gemfile > !!3.new && mv !!3{.new,}
# ruby one liner
ruby -i -ne 'print unless /lame/' Gemfile
@zph
zph / .vimrc
Created January 25, 2013 19:17
" Open Marked.app
" only works on OSX with Marked.app installed
imap <Leader>m <ESC>:!open -a Marked.app %<CR><CR>
nmap <Leader>m :!open -a Marked.app %<CR><CR>
#!/usr/bin/env ruby
# Slow process, CPU intensive, and takes up extra storage space
# But allows using DASH to easily reference RubyGem Rdocs!!!
`gem list | cut -d'(' -f1`.split("\n").map(&:rstrip).each do |g|
`gem rdoc #{g} --rdoc --overwrite`
puts "#{g} rdoc generated"
end