Skip to content

Instantly share code, notes, and snippets.

View zachhale's full-sized avatar
🚴‍♂️
Riding my bike

Zach Hale zachhale

🚴‍♂️
Riding my bike
View GitHub Profile
@zachhale
zachhale / zerigo_to_aws_route53.rb
Created February 22, 2017 20:19 — forked from crashburn65/zerigo_to_aws_route53.rb
quick and dirty ruby script to copy dns from zerigo to amazon aws route 53 (route53). allows users to migrate ALL zones from zerigo over to Route53
#!/usr/local/rvm/rubies/ruby-1.9.2-p180/bin/ruby
require 'rubygems'
require 'zerigo_dns'
require 'route53'
Zerigo::DNS::Base.user = 'username@email.com'
Zerigo::DNS::Base.api_key = 'yourkeyhere'
# iterate through all domain names
@zachhale
zachhale / goldfish_review.mkdn
Last active August 29, 2015 14:02
Goldfish Mac and Cheese Review

These will ruin your tastebuds

A review of Pepperidge Farm Goldfish Macaroni and Cheese

I bought this on a whim after having a lengthy conversation with my coworkers about an anonymous comment someone left on a survey tool we use where we wondered if their comment consisting of the word "goldfish" 7,200 times meant that they wanted a giant fish tank full of living goldfish or if they were actually requesting a large box of goldfish crackers. We think they mean't crackers.

I went to the store a few minutes later and what do you know, goldfish mac and cheese ON SALE! Fantastic, I'm buying that.

2 weeks later ... working from home, I figure why not, I'll try them.

{ scopeName = 'source';
patterns = (
{ name = 'source.invalid.trailing-whitespace';
match = '((?<=[^\s\t])[\t\s]*)$';
captures = { 1 = { name = 'invalid.trailing-whitespace'; }; };
},
);
}
sudo vim /Library/LaunchDaemons/org.redis.redis-server.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.redis.redis-server</string>
<key>Program</key>
@zachhale
zachhale / payflow_recurring.rb
Created March 10, 2010 20:45
Class extension for ActiveMerchant's PayPalGateway to add recurring billing code.
# http://blog.vuzit.com/2008/08/01/paypal-website-payments-pro-us-with-recurring-billing-and-activemerchant/
# The MIT License
#
# Copyright (c) 2008 Vuzit.com, Chris Cera, Tobias Luetke
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
require 'erb'
@user = "Zach"
template = <<-TEMPLATE
Howdy <%= @user %>!
TEMPLATE
ERB.new(template).result(binding)
class Hash
def requires!(*args)
args.flatten.each do |arg|
raise ArgumentError, "#{arg} is required" unless has_key?(arg)
end
end
end
task :generate_static_pages => :environment do
ActionController::Dispatcher.define_dispatcher_callbacks(true) # same as config.cache_classes = true
class PreGenerateController < ApplicationController
layout 'secure'
def show
render :action => params[:id]
end
end
# requires rails environment to be loaded
include ActionView::Helpers::UrlHelper
include ActionController::UrlWriter
include ActionView::Helpers::TagHelper
default_url_options[:host] = 'www.website.com'
alias ss="/rails/.shortcuts/ss.rb"