Skip to content

Instantly share code, notes, and snippets.

View Kerrick's full-sized avatar

Kerrick Long Kerrick

View GitHub Profile
@nathos
nathos / amazon_url_stripper.rb
Created October 1, 2009 18:44
Amazon URL stripper
affiliate_id = "nathos-20"
ARGF.each do |f|
f = f.scan(/(?:http:\/\/(?:www\.){0,1}amazon\.com(?:\/.*){0,1}(?:\/dp\/|\/gp\/product\/))(.*?)(?:\/.*|$)/i)
shorturl = "http://www.amazon.com/dp/" + f.to_s + "/ref=nosim/" + affiliate_id
if shorturl == ("http://www.amazon.com/dp//ref=nosim/" + affiliate_id)
puts "Not a valid Amazon URL"
else
puts shorturl
end
@attebury
attebury / status.sh
Created June 16, 2011 14:52
GeekTool website monitor
#!/bin/bash
# GeekTool script to display status of websites you monitor. See http://projects.tynsoe.org/en/geektool/
# Displays name of site if there's no error. Adds "!!!!" in front of unavailable site.
# Sends an email when a site is unavailable.
ARRAY=(
'awebsite.com'
'anotherwebsite.com'
'onemore.com'
)
@pyrat
pyrat / branch_rename.textile
Created September 5, 2011 20:14
renaming git branches locally and on github
git branch -m master legacy 
git branch -m dev master

Set default branch in admin not master.
Delete the remote master branch on GitHub.

git push origin :master
@sebastianseilund
sebastianseilund / merged_array.js
Last active December 20, 2015 07:58
An implementation of a merged array in Ember.js that combines items from multiple source arrays so you can easily list them together in your Handlebars templates. Read the blog post at the [Billy's Billing Developer Blog](http://dev.billysbilling.com/blog/How-to-merge-multiple-data-sources-into-one-array-in-Ember-js)
/**
* `Ember.MergedArray` is an array that observes multiple other arrays (called source arrays) for changes and includes
* all items from all source arrays in an efficient way.
*
* Usage:
*
* ```javascript
* var obj = Ember.Object.create({
* people: [
* {
@machty
machty / new-router-examples.md
Last active April 16, 2020 22:03
How to do cool stuff with the new Router API
@tomhicks
tomhicks / plink-plonk.js
Last active March 18, 2024 02:23
Listen to your web pages
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active April 19, 2024 11:00
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application: