Skip to content

Instantly share code, notes, and snippets.

View jamiew's full-sized avatar

Jamie Dubs jamiew

View GitHub Profile
CREATE TABLE `audits` (
`id` int(11) NOT NULL auto_increment,
`auditable_id` int(11) default NULL,
`auditable_type` varchar(255) default NULL,
`auditable_user_id` int(11) default NULL,
`user_id` int(11) default NULL,
`user_type` varchar(255) default NULL,
`username` varchar(255) default NULL,
`action` varchar(255) default NULL,
`changes` text,
ffmpeg -hq -ss 00:00:00 -t 00:45:00 -i <movie.avi> -target svcd ./m1.mpg
ffmpeg -hq -ss 00:45:00 -t 00:45:00 -i <movie.avi> -target svcd ./m2.mpg
ffmpeg -hq -ss 01:30:00 -t 00:25:29 -i <movie.avi> -target svcd ./m3.mpg
// instantly implement a konami code easter-egg!!!!
// from http://static.jquery.com/files/rocker/scripts/custom.js
// where it's labeled "hehe" and would open up a javascript guitar hero (!)
if ( window.addEventListener ) {
var kkeys = [], konami = "38,38,40,40,37,39,37,39,66,65";
window.addEventListener("keydown", function(e){
kkeys.push( e.keyCode );
if ( kkeys.toString().indexOf( konami ) >= 0 ) {
// get your konami on
// window.location = "http://ejohn.org/apps/hero/";
Deploying a Rails App with EC2 + S3 + Ubuntu
============================================
Create EC2 Instance
-------------------
create new instance ami-bf5eb9d6 [http://alestic.com/](http://alestic.com/)
create new elastic ip
attach elastic ip to instance
point dns to elastic ip
#!/usr/bin/env ruby
# sup luke; jdubs here
# - put the docs and helper scripts inline for syntax highlighting joy
# - added another crontab example -- I like to file once/day.
# plays nice with treating the Desktop like a daily scratchpad
# - added a 'Yesterday' link in addition to Today
# - minor tweaks around town
## config
HOME_DIRECTORY = "~" # this will
# setting up an R&D slice
# 1st things first, copy over our bash & screen config...
# TODO:
# bootstrap
apt-get update -y && apt-get upgrade -y
apt-get install -y build-essential git-core
apt-get install -y apache2 apache2-prefork-dev postfix imagemagick
SELECT count(*) TABLES,
concat(round(sum(table_rows)/1000000,2),'M') rows,
concat(round(sum(data_length)/(1024*1024*1024),2),'G') DATA,
concat(round(sum(index_length)/(1024*1024*1024),2),'G') idx,
concat(round(sum(data_length+index_length)/(1024*1024*1024),2),'G') total_size,
round(sum(index_length)/sum(data_length),2) idxfrac
FROM information_schema.TABLES;
#!/usr/bin/env ruby
#
# quickly lookup # of google search results for a given term
# usage: ~/bin/searchresults.rb "internet memes"
# by Jamie Wilkinson <http://jamiedubs.com>
# Free Art & Technology Lab <http://fffff.at>
require 'rubygems'
require 'mechanize'
desc "Raises an error if there are pending migrations"
task :abort_if_pending_migrations => :environment do
if defined? ActiveRecord
pending_migrations = ActiveRecord::Migrator.new(:up, 'db/migrate').pending_migrations
if pending_migrations.any?
puts "You have #{pending_migrations.size} pending migrations:"
pending_migrations.each do |pending_migration|
puts ' %4d %s' % [pending_migration.version, pending_migration.name]
end
NOOOOOOOOOOOOOOOOOOOOOOO!!!!!
.-.
|_:_|
/(_Y_)\
( \/M\/ )
'. _.'-/'-'\-'._
': _/.--'[[[[]'--.\_
': /_' : |::"| : '.\
': // ./ |oUU| \.' :\