This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd ~/.pow | |
for f in ~/Projects/*; do [[ -e $f/config.ru ]] && ln -s $f `basename $f`; done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A dummy ActiveRecord application, useful for playing around with ActiveRecord, | |
# or for writing tests. Makes a Sqlite3 database in memory. | |
# | |
# Creates the following tables: | |
# | |
# - products | |
# - users | |
# - taggings | |
# - tags | |
# - categories |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A very simple Rakefile for generating static sites. It's essentially Hobix, | |
# but probably simpler. Every page of the site is a YAML file. The YAML file | |
# gets compiled into a HTML file with the same basename. The content can be | |
# wrapped in a layout. | |
require 'rake/clean' | |
require 'open-uri' | |
require 'yaml' | |
require 'erb' | |
YML = FileList['**/*.yml'].exclude(/^[_.]/) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Provisioning script for an Ubuntu server to run a PostgreSQL server, NginX, | |
# and a Rack application behind a thin server, which can be deployed with | |
# Capistrano. | |
# | |
# This script needs to be run as root | |
# | |
# When it's run, you will still need to add your deploy users to the group, so | |
# that they can actually act on behalf of the named application user. And, | |
# obviously, they will need an account into which they can SSH, so you'll need |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby -ws | |
require 'open-uri' | |
require 'nokogiri' | |
require 'yaml' | |
require 'pathname' | |
require 'ostruct' | |
require 'pp' | |
require 'forwardable' | |
require 'minitest/unit' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Capistrano 3.x Vagrant stage | |
# config/deploy/vagrant.rb | |
set :stage, :vagrant | |
set :rails_env, "production" | |
vagrant_ssh_config = `vagrant ssh-config`.split("\n")[1..-1].map(&:strip).inject({}) do |m, s| | |
k, v = s.split(/\s/, 2).map(&:strip); m[k] = v; m | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env perl | |
# A simple command-line utility for finding and retrieving JavaScript libraries | |
# from cdnjs.com | |
use strict; | |
use warnings; | |
use LWP::Simple; | |
my $lib = shift or die "No script entered on the command-line!"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env perl | |
# Takes input like | |
# 1 | |
# 2 | |
# 3 | |
# and outputs | |
# (1, 2, 3) | |
# | |
# Useful for converting a single column of SQL IDs to a list that you can use |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
begin | |
require 'objspace' | |
trap("PROF") do | |
if $__PROFILING__ | |
GC.start | |
filename = Time.now.strftime("objects-%Y%m%d%H%S.json") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl -CS | |
# Look up metadata for a tracks. Uses fpcalc, which comes with AcoustID | |
# Chromaprint (bitbucket.org/acoustid/chromaprint), the AcoustID web service, | |
# and the Musicbrainz web service. | |
# | |
# Run it with no arguments for help. | |
# | |
# For each file, it prints: | |
# * the filename | |
# * the result "score" (how likely a match it is, 0-1) |