Skip to content

Instantly share code, notes, and snippets.

View rnagle's full-sized avatar

Ryan Nagle rnagle

View GitHub Profile
@rnagle
rnagle / gist:3948066
Created October 24, 2012 18:55
Freezer
#!/bin/bash
#
# Create a local copy of a website, suitable
# for upload to S3 as a static archive.
#
# Provide the domain name you wish to archive
# as the first argument.
#
# For example:
_____ ___ _ __ __
|_ _| __| /_\ | \/ |
| | | _| / _ \| |\/| |
|_|_|___/_/_\_\_| |_|
|_ _| _ \_ _| _ )
| | | /| || _ \
|_| |_|_\___|___/
/_\ | _ \ _ \/ __|
/ _ \| _/ _/\__ \
/_/ \_\_| |_| |___/
@rnagle
rnagle / simple_carousel.js
Created October 1, 2012 19:03
Simple Carousel
@rnagle
rnagle / otf_get_attachment_image_src.php
Created April 12, 2012 12:46
WordPress: Generate thumbnails on-the-fly
<?php
/*
* Check for thumb of $size and generate it if it doesn't exist.
*
* @param int $post_id Post ID for which you want to retrieve thumbnail
* @param string $size Name of thumbnail size to check for; same as
* the slug used to add custom thumb sizes with add_image_size().
* @return array An array containing: array( 0 => url, 1 => width, 2 => height )
*
@rnagle
rnagle / chartbeat.js
Created December 7, 2011 21:34
Chartbeat.js
var Chartbeat = function(opts) {
if (!opts)
throw new Error("Chartbeat: Please specify an api key and host!");
if (!opts.api_key)
throw new Error("Chartbeat: Please specify an api key!");
if (!opts.host)
throw new Error("Chartbeat: Please specify a host!");
this.creds = {
@rnagle
rnagle / ferrari.py
Created March 15, 2011 00:26
Nick's Ferrari
# Nick's Ferrari
from urllib import urlopen
f = urlopen('http://www.textfiles.com/art/ferrari.art')
ferrari = f.read()
print ''
print ferrari