Skip to content

Instantly share code, notes, and snippets.

View zph's full-sized avatar

Zander Hill zph

View GitHub Profile
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 [email protected]
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
@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]

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 / 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.

#!/bin/sh
SPACE="SERVER$(spacefinder | sed 's/Current Space ID: //')"
mvim --serverlist | grep $SPACE
if [ $? -eq 1 ]
then
mvim --servername $SPACE $*
else
mvim --servername $SPACE --remote $*
fi

Bearded's Hourly Contract

Date: [[Date of Document]] Between [Our Company] and [Your Company]

Summary

We’re not big on formality, but sometimes it’s best to have a few simple things written down so that we’re all on the same page. In this contract you won’t find complicated legal terms or large passages of unreadable text. We have no desire to trick you into signing something that you might later regret. We do want what’s best for the safety of both parties, now and in the future.

@zph
zph / bob.rb
Created August 14, 2013 13:53 — forked from rlb3/bob.rb
require 'ripper'
def Object.const_missing(name)
klass = const_set name, Class.new
klass.class_eval do
def method_missing name, *args
file, line_num, _ = caller[0].split(':')
file_contents = File.open(file).read
@zph
zph / _readme.md
Created August 19, 2013 18:41 — forked from mislav/_readme.md

I use tmux splits (panes). Inside one of these panes there's a Vim process, and it has its own splits (windows).

In Vim I have key bindings C-h/j/k/l set to switch windows in the given direction. (Vim default mappings for windows switching are the same, but prefixed with C-W.) I'd like to use the same keystrokes for switching tmux panes.

An extra goal that I've solved with a dirty hack is to toggle between last active panes with C-\.

Here's how it should work:

@zph
zph / gitcommit
Created September 24, 2013 17:55 — forked from sbrauer/gitcommit
#!/usr/bin/env ruby
# A wrapper around "git commit" that provides a template message
# conforming to RentPath conventions.
# Assumes branches are named with the following components separated
# by underscores:
# 1. developer initials (one or more of these components are allowed)
# 2. story number
# 3. free text description (optional; may contain underscores)
# Examples:
# "sb_12345_fix_serious_bug"
@zph
zph / log.txt
Created November 5, 2013 15:50 — forked from mislav/log.txt
480 git commit -v
397 git status -sb
120 git add -p
53 git push
52 git diff
47 noglob bundle exec
45 ls -G
45 git branch -v
45 bundle
39 git push -u