Skip to content

Instantly share code, notes, and snippets.

View zph's full-sized avatar

Zander Hill zph

View GitHub Profile
@zph
zph / ctags.md
Last active December 20, 2015 11:19 — forked from wikimatze/ctags.md

Working effectively with ctags has been a topic I avoided for a long time because I was too lazy to invest the time to learn about it.

I was working on my application and needed to constantly consult Padrino's API docs in the browser. It would have been more effective if I could do the searching directly in Padrino's code on GitHub. Even better would be if I didn't have to leave the terminal and could stay in the flow of coding. It's possible with ctags!

What is ctags

ctags is a tool which make it easy for you to shift rapidly through code.

Ruby MRI 1.9.3 Results

[gpetrie] $ ruby -v
ruby 1.9.3p429 (2013-05-15 revision 40747) [x86_64-darwin11.4.2]

[gpetrie] $ ruby wunderground.rb
Current temperature in Cedar Rapids is: 77.0
@zph
zph / import.rb
Created June 18, 2013 04:11 — forked from baldowl/import.rb
require 'rubygems'
require 'nokogiri'
require 'fileutils'
require 'date'
require 'uri'
# usage: ruby import.rb my-blog.xml
# my-blog.xml is a file from Settings -> Basic -> Export in blogger.
data = File.read ARGV[0]
Hello! Glad we can get a pair session going. Here's some easy instructions to make things a bit easier.
Join the Google+ hangout and then make a ssh connection to my EC2 pair instance. I have copied your public key from github so you shouldn't need a password to login.
ssh pair@pair.jimnanney.com
Or if you add this to your ~/.ssh/config file you will be able to forward your keys to enable github checkout and in, and remotely view rails apps in your browser on your own machine and can just use the ssh command 'ssh pair' The local forwards allow you to view any rails app we work on within your own browser at localhost:3000 or 5000
Host pair
Reluctantly crouched at the command line
keyboards clicking and clacking in time
the green bar flashes, the vim pops up
churning, and burning, they yearn for server up
they deftly maneuver and regex to rename
fingers flying fast keyboards in flame
reckless and wild, they commit and they push
their prowess is potent though they sit on their tush.
as they speed through the release, the deploy goes out
they all get up and pour themselves stout
# 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 / 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.
@zph
zph / .vimrc
Created December 20, 2012 05:19 — forked from skwp/.vimrc
" Run the current file in a ConqueTerm, great for ruby tests
let g:ConqueTerm_InsertOnEnter = 0
let g:ConqueTerm_CWInsert = 1
nmap <silent> <Leader>r :call RunRubyCurrentFileConque()<CR>
nmap <silent> <Leader>R :call RunRakeConque()<CR>
nmap <silent> <Leader>c :execute 'ConqueTermSplit script/console'<CR>
nmap <silent> <Leader>i :execute 'ConqueTermSplit pry'<CR>
nmap <silent> <Leader>b :execute 'ConqueTermSplit /bin/bash --login'<CR>
nmap <silent> <Leader>S :call RunRspecCurrentFileConque()<CR>
@zph
zph / trello-cards-from-csv.rb
Created October 5, 2012 19:33 — forked from joshmcarthur/trello-cards-from-csv.rb
A Ruby script to import Trello cards from a CSV file
#!/usr/bin/env ruby
# You can skip this bit if you wish - you will need the 'ruby-trello' gem installed, and
# optionally, 'foreman' to run the script with.
require 'bundler/setup'
Bundler.require
require 'trello'
require 'csv'
@zph
zph / rspec-syntax-cheat-sheet.rb
Created August 25, 2012 12:56 — forked from dnagir/rspec-syntax-cheat-sheet.rb
RSpec 2 syntax cheat sheet by example
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below)
module Player
describe MovieList, "with optional description" do
it "is pending example, so that you can write ones quickly"
it "is already working example that we want to suspend from failing temporarily" do
pending("working on another feature that temporarily breaks this one")