Skip to content

Instantly share code, notes, and snippets.

@nukemberg
nukemberg / knife.sh
Created June 28, 2011 07:51 — forked from ches/knife
bash completion for Chef's knife command (updated for 0.10)
# vim: ft=sh:ts=4:sw=4:autoindent:expandtab:
# Author: Avishai Ish-Shalom <avishai@fewbytes.com>
# We need to specify GNU sed for OS X, BSDs, etc.
if [[ "$(uname -s)" == "Darwin" ]]; then
SED=gsed
else
SED=sed
fi
@enaeher
enaeher / tiered_archives.rb
Created September 5, 2011 21:49
Tiered Archives plugin
# A quick and dirty plugin for Jekyll by Eli Naeher
#
# This plugin creates a site.years template variable which allow you to group archive links by year and month.
# The structure of site.years is:
# site.years = 2001=>[[post1, post2...], [...]], 2002=>[...]
#
# Usage should look something like this:
# {% for year in site.years %}
# <h2>Year {{ year.first.first.date | date: "%Y" }}</h2>
@jobicoppola
jobicoppola / knife
Created October 11, 2011 16:29 — forked from nukemberg/knife.sh
bash completion for Chef's knife command (updated for 0.10)
# vim: ft=sh:ts=4:sw=4:autoindent:expandtab:
# Author: Avishai Ish-Shalom <avishai@fewbytes.com>
# We need to specify GNU sed for OS X, BSDs, etc.
if [[ "$(uname -s)" == "Darwin" ]]; then
SED=gsed
else
SED=sed
fi
@yieldthought
yieldthought / gist:1334618
Created November 2, 2011 19:25
screen status line
hardstatus alwayslastline
hardstatus string '%{gk}[ %{G}%H %{g}][%= %{wk}%?%-Lw%?%{=b kR} (%{W}%n*%f %t%?(%u)%?%{=b kR})%{= kw}%?%+Lw%?%?%= %{g}][%{Y}%l%{g}] %{=b C}[ %m/%d %c ]%{W}'
@ravasthi
ravasthi / favicon.html
Created January 7, 2012 17:53
Favicon code
<!-- Favicons and touch icons -->
<!-- For retina-display iPads -->
<link href="/assets/images/apple-touch-icon-xlarge.png" rel="apple-touch-icon-precomposed" sizes="144x144" type="image/png"/>
<!-- For retina-display iPhones -->
<link href="/assets/images/apple-touch-icon-large.png" rel="apple-touch-icon-precomposed" sizes="114x114" type="image/png"/>
<!-- For iPad 1 -->
<link href="/assets/images/apple-touch-icon-medium.png" rel="apple-touch-icon-precomposed" sizes="72x72" type="image/png"/>
<!-- For iPhone 3G, iPod Touch and Android -->
<link href="/assets/images/apple-touch-icon-small.png" rel="apple-touch-icon-precomposed" type="image/png"/>
<!-- For Nokia -->
@bmann
bmann / tumblr.rb
Created January 18, 2012 08:56 — forked from derek-watson/tumblr.rb
Tumblr to Jekyll migration (Octopress / link blog edition)
#!/usr/bin/env ruby
# Script to import tumblr posts into local markdown posts ready to be consumed by Jekyll.
# Inspired by New Bamboo's post http://blog.new-bamboo.co.uk/2009/2/20/migrating-from-mephisto-to-jekyll
# Supports post types: regular, quote, link, photo, video and audio
# Saves local copies of images
# via gist at https://gist.github.com/867468
require 'rubygems'
require 'open-uri'
@iphoting
iphoting / build-php.sh
Created May 10, 2012 04:06
Precompile Heroku PHP Binaries
#!/bin/bash
# use AMI ami-04c9306d
# run this script as root.
## EDIT
export S3_BUCKET="heroku-buildpack-php-tyler"
export LIBMCRYPT_VERSION="2.5.8"
export PHP_VERSION="5.4.1"
export APC_VERSION="3.1.10"
export PHPREDIS_VERSION="2.2.1"
@iphoting
iphoting / get-input-encoder.php
Created May 18, 2012 07:43
RESTful PHP Mail Interface
#!/usr/bin/env php
<?php
$ss = 'changeit';
$rand = mt_rand();
$input = array(
"shared" => sha1($ss . $rand),
"salt" => $rand,
"to" => 'test@test.com',
"subject" => "This is a test subject.",
@iphoting
iphoting / simple_http_server.ru
Created July 25, 2012 04:06
Simple HTTP Server for Ruby
#!/usr/bin/env rackup
#\ -E deployment
# Description:
#
# Start a simple static HTTP server for the current directory.
#
# Prerequisites:
#
# gem install 'rack'
@iphoting
iphoting / tumblr_video_downloader.sh
Created October 12, 2012 04:23
Tumblr Video Downloader
#!/usr/bin/env bash
#
# This scripts searches for a video_file link from the a Tumblr
# video premalink page and uses wget to download the video file.
#
# Requirements: curl, 7.21.2 or newer.
#
if [ -z "$1" ];
then