Skip to content

Instantly share code, notes, and snippets.

View zph's full-sized avatar

Zander Hill zph

View GitHub Profile
#!/usr/bin/env ruby
`gem list | cut -d'(' -f1`.split("\n").map(&:rstrip).each { |g| `gem rdoc #{g} --rdoc --overwrite` ; puts "#{g} rdoc generated"}
@zph
zph / notes.md
Last active December 16, 2015 11:38

Twelephone API reqs

Should presence be case sensitive? B/c it is:

 $ curl -X GET http://api.twelephone.com/presence/_zph
  {"online":false}
 $ curl -X GET http://api.twelephone.com/presence/_ZPH
  {"online":true}

Profile request errored out with the following "curl: (52) Empty reply from server" after a long delay

Optimizing Your Life
by BRENNAN DUNN APRIL 24, 2013
It’s pretty obvious that we didn’t evolve to sit in front of screens all day. The idea of being sedentary is something relatively recent — our ancestors were out ploughing or foraging, and only the sick and handicap stayed in one place for very long. So it’s no wonder that after a day of sitting at the computer, our necks get strained. Our backs ache. Our heads throb.
I’m pretty certain I won’t be abandoning my life in front of a MacBook anytime soon, but feeling shitty sucks. And while there are a lot of band-aids like chiropractors, ice packs, heat packs, massage, and drugs, they’re all just patches. The underlying problem isn’t addressed.
About a year ago, I was going looking through some internet forum and read something that really stood out: “How to get fit: Lift things and move around, don’t eat too much, and sleep a lot.” And while there are tens of thousands of books, blog posts, videos, and whatever else that prescribes how to look better and fe
--- optimizing_life_original.txt 2013-04-24 22:18:04.000000000 -0400
+++ optimizing_life_original_edited.txt 2013-04-24 22:20:14.000000000 -0400
@@ -21,7 +21,7 @@
My arms are bigger, my chest is more defined, and my belly’s disappearing. Abs are more a result of diet (you’ll have abs if you can reach 10-12% body fat), and I’m hoping to be there by the end of summer.
-Cardio: I’m not a huge fan of cardio. It has it’s role, but have you ever noticed how frail long distance runners are? On my rest days, I’ll do sprints around the block — a form of high intensity interval training (HIIT), where you move as quickly as possible for 10 or 20 seconds.
+Cardio: I’m not a huge fan of cardio. It has its role, but have you ever noticed how frail long distance runners are? On my rest days, I’ll do sprints around the block — a form of high intensity interval training (HIIT), where you move as quickly as possible for 10 or 20 seconds.
module Buff
class Encode
def self.encode(arg)
raise_error_for_incorrect_input(arg)
arg = arg[:schedules] if arg.respond_to?(:keys)
output = []
arg.each_with_index do |item, index|
process_schedule(output, item, index)
end
output.join("&")
@zph
zph / blogpost.rb
Last active December 17, 2015 18:39
# Generate Client object
client = Buff::Client.new("SUPERSECRET_API_TOKEN")
# Send requests from Client object
client.profiles
client.updates_by_profile_id(profile_id, status: :sent)
# require 'rubygems' # not necessary with ruby 1.9 but included for completeness
# require 'twilio-ruby'
# # put your own credentials here
# account_sid = 'ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
# auth_token = 'yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy'
# # set up a client to talk to the Twilio REST API
# @client = Twilio.new( account_sid, auth_token )
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
#!/usr/bin/env ruby
#
require 'open-uri'
if ARGV.empty?
puts "#{__FILE__} requires a Github username"
exit(1)
else
USER = ARGV[0].dup
end
#!/bin/sh
# Make pair user and add them to the pair grp on box
### sudo adduser --disabled-password pair
# Add yourself to pair grp on box
### sudo usermod -a -G pair zander
# Setup pair user with the following /home/pair/.bash_profile
### /home/pair/.bash_profile
### https://gist.github.com/5726432
PAIR=$1