Skip to content

Instantly share code, notes, and snippets.

@flyingoctopus
flyingoctopus / make_soup.sh
Created June 7, 2012 23:10 — forked from pgib/make_soup.sh
Put this soup in your .bash_profile and smoke (or slurp) it!
ayv_deploy_dir="/Users/${USER}/Sites/ayv/deploy"
make_soup()
{
current_branch=`git status | head -n 1 | awk '{print $4}'`
echo "Pushing $current_branch to soup... (Press Ctrl-c to abort)"
sleep 2
git checkout soup
git fetch upstream && git merge upstream/soup
git merge $current_branch && git push upstream soup || git reset --hard
@flyingoctopus
flyingoctopus / delete-branch.sh
Created April 17, 2012 16:18 — forked from pgib/delete-branch.sh
Delete multiple local/remote git branches. (Put this in your shell's profile and smoke it!)
delete-branch()
{
for i in `echo $*`; do
echo "Deleting local and remote branch $i..."
git push origin :$i
git branch -D $i
done
}
@flyingoctopus
flyingoctopus / delete-branch.sh
Created April 17, 2012 16:18 — forked from pgib/delete-branch.sh
Delete multiple local/remote git branches. (Put this in your shell's profile and smoke it!)
delete-branch()
{
for i in `echo $*`; do
echo "Deleting local and remote branch $i..."
git push origin :$i
git branch -D $i
done
}
@flyingoctopus
flyingoctopus / dlchromium.sh
Created April 16, 2012 21:48 — forked from lg/dlchromium.sh
Download Latest Nightly Chromium For Mac
if [ $(ps aux | grep "Chromium.app" | grep -v grep | wc -l) -gt 0 ]; then
echo "Please close all Chromium instances before running this script"
exit 1
fi
if [ $(whoami) != "root" ]; then
echo "Please run this script with sudo to allow for installation into /Applications"
exit 1
fi
def download_image(u)
path = 'images/%s' % u.split('/')[-1]
url = URI.parse(u)
found = false
until found
host, port = url.host, url.port if url.host && url.port
query = url.query ? url.query : ""
req = Net::HTTP::Get.new(url.path + '?' + query)
res = Net::HTTP.start(host, port) {|http| http.request(req) }
res.header['location'] ? url = URI.parse(res.header['location']) : found = true
@flyingoctopus
flyingoctopus / posterous.rb
Created March 30, 2012 17:43
posterous > jekyll
require 'rubygems'
require 'jekyll'
require 'fileutils'
require 'net/http'
require 'uri'
require "json"
module Jekyll
module Posterous
def self.fetch(uri_str, limit = 10)
@flyingoctopus
flyingoctopus / README.md
Created March 22, 2012 06:54 — forked from tjogin/README.md
Configuration file to use PHP with Ruby rack

Installation

First you need php-cgi, i used brew with Formula below:

$ curl -O https://raw.github.com/gist/1194269/7ae1709453a8a19ce9c030bf41d544dd08d96d85/php.rb
$ mv php.rb `brew --prefix`/Library/Formula
$ brew install php --with-mysql

Second, install this ruby gems:

@flyingoctopus
flyingoctopus / osx_lion_rail_setup.md
Created March 7, 2012 07:36 — forked from jpantuso/osx_lion_rail_setup.md
Setup OS X 10.7 w/ homebrew, oh-my-zsh, rvm, rails, and MySQL
@flyingoctopus
flyingoctopus / outside_temp.rb
Created November 11, 2011 01:19 — forked from pgib/outside_temp.rb
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
http://www.yourawesomesite.com/index.html?name=<script>alert('You just found a XSS vulnerability')</script>