Skip to content

Instantly share code, notes, and snippets.

View jamiew's full-sized avatar

Jamie Dubs jamiew

View GitHub Profile
@jamiew
jamiew / gist:133
Created July 21, 2008 20:32 — forked from imownbey/gist:128
def what_is_gist
"A bad ass version-able pastebin"
This is sorta cool I guess?
end
@jamiew
jamiew / passenger_status.rb
Created October 31, 2008 15:27 — forked from dan-manges/passenger_status.rb
munin plugin for Passenger Phusion process stats
#!/usr/bin/env ruby
# put in /etc/munin/plugins and restart munin-node
# by Dan Manges, http://www.dcmanges.com/blog/rails-application-visualization-with-munin
# NOTE: you might need to add munin to allow passwordless sudo for passenger-memory-stats
def output_config
puts <<-END
graph_category App
graph_title passenger status
graph_vlabel count
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
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;
@jamiew
jamiew / Webmarker
Created January 15, 2010 21:28 — forked from tbx/Webmarker
<html>
<head>
<style type="text/css"></style>
<script type="text/javascript" src="jquery-1.3.2.min.js"></script>
<script type='text/javascript'>
//***************Global Vars*******************
//*********************************************
var wm_stroke_size = 10;
var wm_color = '#FF00FF';
@jamiew
jamiew / bugflow
Created January 26, 2010 02:38 — forked from jdhuntington/bugflow
#!/usr/bin/env ruby
# 2008.10.03
# JD Huntington
# Darell Fuhriman
# shell script to assist in working with lighthouse and git
#
# requires lighthouse api ruby wrapper and git library
# $ gem sources -a http://gems.github.com/
# $ gem install Caged-lighthouse-api
[user]
name = Jamie Wilkinson
email = jamie@internetfamo.us
[github]
user = jamiew
token = 7fd12d4c49f24df2da597bb9bd5f4bfd
[apply]
whitespace = nowarn
[branch]
@jamiew
jamiew / gist:371619
Created April 19, 2010 20:59 — forked from atmos/gist:227332
Spec for enforcing whitespace
require File.dirname(__FILE__) + '/spec_helper'
describe "The library itself" do
Spec::Matchers.define :have_no_tab_characters do
match do |filename|
@failing_lines = []
File.readlines(filename).each_with_index do |line,number|
@failing_lines << number + 1 if line =~ /\t/
end
@failing_lines.empty?
@jamiew
jamiew / textmate_bundler_updater.sh
Created April 10, 2011 17:00
Updates the system-wide TextMate bundles + all your user bundles, with some notes for additions I want to make (e.g. subversion support in user bundles -- I have one that still uses svn)
#!/bin/bash
CORE_PATH="/Library/Application Support/TextMate/Bundles/"
USER_PATH="/Users/$(whoami)/Library/Application Support/TextMate/Bundles/"
echo "Updating core TextMate bundles..."
cd "${CORE_PATH}"
#svn up *.tmbundle
svn up