Skip to content

Instantly share code, notes, and snippets.

View benschwarz's full-sized avatar
🏁
Making the web fast

Ben Schwarz benschwarz

🏁
Making the web fast
View GitHub Profile
@benschwarz
benschwarz / bower.schema
Created June 10, 2014 01:01
Bower registry schema
--
-- PostgreSQL database dump
--
-- Dumped from database version 9.3.4
-- Dumped by pg_dump version 9.3.4
-- Started on 2014-06-10 10:42:59 EST
SET statement_timeout = 0;
SET lock_timeout = 0;
@benschwarz
benschwarz / gist:4171d8795b4f1f651a97
Last active August 29, 2015 14:16
iPhone games suggested to me by Twitter friends
  • Pocket dog fights
  • Battleheart
  • Steampunk
  • Bonza
  • Thomas was alone
  • Space age
  • Fotonica
  • 80 days
  • Sorcery!
  • Powder
@benschwarz
benschwarz / Fast textmate searching with ack
Created October 9, 2008 22:44
Use ack for textmate project searching
sudo port install p5-app-ack
cd ~/Library/Application\ Support/TextMate/Bundles
git clone git://github.com/protocool/ack-tmbundle.git Ack.tmbundle
# Then use Shift + Command + A to search at the speed that one would expect Textmate to search at
Merb.logger.info("Compiling routes...")
Merb::Router.prepare do |r|
# RESTful routes
# resources :posts
resources :newsletters do
member :subscribe, :method => :post
member :unsubscribe, :method => :delete
end
begin
require 'minigems'
rescue LoadError
require 'rubygems'
end
require 'fusefs'
require 'flickr-rest'
require 'flickr-wrapper'
require 'openuri_memcached'
#!/usr/bin/env ruby
# Open a new tab in Terminal
# usage: tab [cmd]
# If cmd is specified, it will be run in new tab while old tab is reactivated.
# If no cmd, new tab is activated
require "rubygems"
require "appscript"
include Appscript
window = app("Terminal").windows.first
# Extend the Request class to give
# a useful method to be able to route
# to subdomains
module Merb
class Request
def subdomain
return nil if subdomains.first == "www"
return subdomains.first
end
end
# Get your commit hash from git log
git revert b899e585972342c4c33426535c30722f1f1ca14c
# Commit message if required (defaults to Created commit abe8722: Revert "YOur message")
git pull
git push
# Win.
@benschwarz
benschwarz / rubyconf_scraper.rb
Created December 2, 2008 04:31
RubyConf 2008 video scraper
%w(rubygems nokogiri open-uri fileutils).each do |r|
require r
end
BASE_URI = "http://rubyconf2008.confreaks.com/"
LOCAL_SAVE_PATH = "ruby-videos/"
FileUtils.mkdir_p LOCAL_SAVE_PATH
puts "Looking..."
*** LOCAL GEMS ***
data_objects (0.9.9)
dm-adjust (0.9.8)
dm-aggregates (0.9.8)
dm-ar-finders (0.9.8)
dm-cli (0.9.8)
dm-constraints (0.9.8)
dm-core (0.9.8)
dm-couchdb-adapter (0.9.8)