Skip to content

Instantly share code, notes, and snippets.

@libin
libin / gist:7158
Created August 25, 2008 21:19 — forked from defunkt/gist:6443
# Video: http://rubyhoedown2008.confreaks.com/08-chris-wanstrath-keynote.html
Hi everyone, I'm Chris Wanstrath.
When Jeremy asked me to come talk, I said yes. Hell yes. Immediately. But
then I took a few moments and thought, Wait, why? Why me? What am I supposed
to say that's interesting? Something about Ruby, perhaps. Maybe the
future of it. The future of something, at least. That sounds
keynote-y.
@libin
libin / gist:10365
Created September 12, 2008 03:01 — forked from dmix/gist:10309
require 'rubygems'
require 'scrubyt'
Scrubyt.logger = Scrubyt::Logger.new
market_data = Scrubyt::Extractor.define do
fetch 'http://Salesforce.com/'
contents "/html/body"
end
puts market_data.to_xml
market_data = Scrubyt::Extractor.define do
fetch 'http://www.salesforce.com/products/sales-force-automation/sales-management/'
@libin
libin / snippet.sh
Created January 16, 2009 19:27 — forked from anonymous/snippet.sh
parse_git_branch() {
RSLT=''
GIT_BRANCH=`git branch 2> /dev/null | sed -e '/^[^*]/d' | awk '{print $2}'`
if [ "$GIT_BRANCH" ]
then
GIT_STATUS=`git status 2> /dev/null | grep 'working directory clean'`
CLR='2'
if [ "$GIT_STATUS" ]
then
CLR='2'
In response to all the responses to:
http://twitter.com/rtomayko/status/1155906157
You should never do this in a source file included with your library,
app, or tests:
require 'rubygems'
The system I use to manage my $LOAD_PATH is not your library/app/tests
@libin
libin / x
Created February 12, 2009 18:41
CmdUtils.CreateCommand({
name: ['git'],
arguments: [{role: 'object', nountype: noun_arb_text, label: 'query'}],
icon: "http://github.com/favicon.ico",
homepage: "http://mrgossett.com",
author: {name: "Tim Gossett", email: "tim@mrgossett.com"},
license: "Creative Commons",
description: "Search GitHub repositories",
help: "Start typing a search term",
execute: function(args)
@libin
libin / gist.scpt
Created February 12, 2009 18:41 — forked from Lytol/gist.scpt
-- Create a gist from the specified text or the contents of the selected file
--
-- Author: Brian Smith <bsmith@swig505.com>
using terms from application "Quicksilver"
on process text str
my growlRegister()
do shell script "echo '" & str & "' | /usr/local/bin/gist"
growlNotify("Gist Created!", "URL has been copied to clipboard")
#!/usr/bin/env macruby
# From: http://www.stompy.org/2008/08/14/xcode-and-git-another-build-script/
# Expanded from here: http://www.furmanek.net/36/using-macruby-to-set-xcode-project-version-from-git/
# Xcode auto-versioning script for Subversion by Axel Andersson
# Updated for git by Marcus S. Zarra and Matt Long
# Converted to ruby by Abizern
# Converted to MacRuby by Gregory Furmanek
# Merged with MacRuby version by elliottcable
# Appends the git sha to the version number set in Xcode.
#!/bin/sh
mkdir -p /usr/local/src && cd /usr/local/src
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.1-p0.tar.bz2
tar -xjvf ruby-1.9.1-p0.tar.bz2
cd ruby-1.9.1-p0
./configure --prefix=/usr --program-suffix=19 --enable-shared
make && make install
#!/usr/bin/env ruby
#
# usage: script/server_restarter
#
# Rails autoloading, while nice in theory, frequently doesn't work. Since Rails 2.3+
# is so fast when completely reloading the server, I wrote this script to listen to the
# given directories, and kill/restart the server when any file is changed.
#
# It's quick, simple, and it reliably reloads your application when changes are made.
#
RELEASE_OUTPUT_PATH = File.expand_path("~/Projects/releases/Squeemote")
TARGET_NAME = "Squeemote"
CONFIGURATION = ENV['CONFIGURATION'] || "Distribution"
SDK_VERSION = ENV['SDK'] || 'iphoneos2.2'
task :release do
puts "* Bumping build version."
`agvtool bump -all`
puts "* Building #{CONFIGURATION} release."