Skip to content

Instantly share code, notes, and snippets.

@pgib
pgib / outside_temp.rb
Created November 10, 2011 23:58
Get me some temperatures for screen's backtick!
#!/usr/bin/env ruby
# encoding: UTF-8
require 'rubygems'
# https://github.com/jnunemaker/google-weather/
# gem install google-weather
require 'google_weather'
# usage: outside_temp.rb [City,Province|Postal Code]
if ARGV.size == 0
@pgib
pgib / autocompiler.sh
Created November 8, 2011 00:42
.less autocompiler
#!/bin/sh
branch=`git status | head -n 1 | awk '{print $4}'`
# this assumes you have a master stylesheet that includes others
master="styles.less"
echo "Watching for changes in all .less files in the ${branch} branch."
echo "Note: changing branches will stop this script."
echo ""
@pgib
pgib / haml_renamer.sh
Created October 26, 2011 20:16
Rename all .haml to .html.haml
#!/bin/sh
for h in `find . -name '*.haml'`; do
if ! echo $h | grep -q ".html.haml"; then
hh=`echo $h | sed -e s/.haml/.html.haml/`
if [ -e $hh ]; then
echo "Can't rename $h to $hh because $hh already exists. :("
else
@pgib
pgib / archive_github_repo.sh
Created October 17, 2011 22:48
Put this in your shell's respective dot profile and smoke it!
archive_github_repo()
{
if [ ! -d .git ]; then
echo "You must run this from within the root of your git repo."
exit 1
fi
pwd=`pwd`
repo_url=`git config --local --get remote.origin.url`
repo_name=`echo $repo_url | awk -F / '{print $2}' | sed -e s/.git//`
@pgib
pgib / nginx.rb
Last active September 27, 2015 15:47
Update to nginx 1.2.6; add nginx-upload-progress-module
require 'formula'
class Nginx < Formula
homepage 'http://nginx.org/'
url 'http://nginx.org/download/nginx-1.2.6.tar.gz'
sha1 '432059b668e3f018eab61f99c7cc727db88464e8'
devel do
url 'http://nginx.org/download/nginx-1.3.10.tar.gz'
sha1 '11cd44bc0479594fd2e5f7a65bf8f2c36ad5ec1e'
@pgib
pgib / mydevices.html
Created October 14, 2011 22:40
Commented out code in Lion Server's My Devices
<!-- <div class="profile">
<div class="name">First Ad-Hoc</div>
<p class="description">This adds some stuff to your device.</p>
<a href="http://apple.com"><div class="button"><canvas></canvas></div></a>
<p class="getJoin">Get</p>
</div>
<div class="profile">
<div class="name">Second Ad-Hoc</div>
<p class="description">This adds some different stuff to your device.</p>
<a href="http://apple.com"><div class="button"><canvas></canvas></div></a>
@pgib
pgib / create-branch.sh
Created August 26, 2011 17:55
Put this in your shell's respective dot profile and smoke it!
# create a new git branch
function create-branch
{
local branchtype=$1
local name=$2
local issue=$3
date=`date +%Y%m%d`
if [ $# -lt 2 ]; then
@pgib
pgib / brew doctor
Created May 12, 2011 05:45
brew install -v little-cms
$ brew doctor
Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected dylibs:
/usr/local/lib/libdvdcss.2.0.7.dylib
/usr/local/lib/libdvdcss.2.dylib
@pgib
pgib / gist:965951
Created May 11, 2011 05:15
`brew install -v imagemagick` output
$ brew install imagemagick
Also installing dependencies: jpeg, little-cms
==> Downloading http://www.ijg.org/files/jpegsrc.v8c.tar.gz
File already downloaded and cached to /Users/patrick/Library/Caches/Homebrew
==> ./configure --prefix=/usr/local/Cellar/jpeg/8c --disable-dependency-tracking
==> make install
/usr/local/Cellar/jpeg/8c: 17 files, 1.4M, built in 11 seconds
==> Downloading http://www.littlecms.com/1/lcms-1.19.tar.gz
File already downloaded and cached to /Users/patrick/Library/Caches/Homebrew
@pgib
pgib / bbedit_colours.sh
Created May 6, 2011 19:51
My BBEdit Color Scheme
defaults write com.barebones.bbedit Color:Background -string "rgb(0,0,0)"
defaults write com.barebones.bbedit Color:CTagsIdentifier -string "rgb(57825,39937,11422)"
defaults write com.barebones.bbedit Color:ColorAttributesSeparately -string 1
defaults write com.barebones.bbedit Color:Comment -string "rgb(21845,21845,21845)"
defaults write com.barebones.bbedit Color:Comment:Ruby -string "rgb(34992,34992,34992)"
defaults write com.barebones.bbedit Color:Foreground -string "rgb(65535,65535,65535)"
defaults write com.barebones.bbedit Color:Foreground:CSS -string "rgb(56342,56342,56342)"
defaults write com.barebones.bbedit Color:GuideContrast -string 7
defaults write com.barebones.bbedit Color:HTMLAnchor -string "rgb(43690,0,0)"
defaults write com.barebones.bbedit Color:HTMLAttributeName -string "rgb(57528,45076,5799)"