Skip to content

Instantly share code, notes, and snippets.

View jamiew's full-sized avatar

Jamie Dubs jamiew

View GitHub Profile
# a simple ActiveRecord->HTML table of attributes default (why isn't this builtin?)
# in the case of arrays, just do many tables
# TODO: move to a plugin or somesuch?
module ToHTML
def to_html
# FIXME TODO: things we don't want to show...
@private_attributes ||= [:id, :video_id, :user_id, :cached_tag_list, :points, :identified, :identified_at, :created_at, :service_id]
--- controller ---
def index
load_videos = lambda do
@videos = Video.find(...)
end
end
--- view ---
cache("...") do
load_videos
@jamiew
jamiew / screenrc_jdubs
Created November 13, 2009 19:48
my .screenrc
## jamiew
## screen config
vbell on
defscrollback 1024
escape ``
startup_message off
## default screens
screen -t queries 0 bash
screen -t _ 1 bash
@jamiew
jamiew / vimrc_jdubs
Created November 13, 2009 19:47
My VIM config (.vimrc)
set expandtab " Use spaces instead of tabs
set autoindent " Inherit indent from previous line
syntax on
set tabstop=2 " Display \t as 2 spaces
"set shiftwidth=2 " Number of spaces to use for each indent
"set softtabstop=2 " Treat 2 spaces as a tab for editing purposes
"set smartindent
"set smarttab " Insert blank space at beginning of line with tab
" make searches case-insensitive, unless they contain upper-case letters
<script src="http://widgets.twimg.com/j/2/widget.js"></script>
<script>
new TWTR.Widget({
version: 2,
type: 'search',
search: 'knowyourmeme OR \"know your meme\"',
interval: 6000,
title: 'Twitter Search Results',
subject: '&quot;knowyourmeme&quot;',
width: 250,
## fancy prompt showing git branch
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
function proml {
local BLUE="\[\033[0;34m\]"
local BLUE_BOLD="\[\033[1;34m\]"
local RED="\[\033[0;31m\]"
local LIGHT_RED="\[\033[1;31m\]"
<html><head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<style type="text/css"></style>
<script type="text/javascript">
// Global Vars
var last_memory_data = new Date().getTime(); // letzter speicher wert
var testx = 0;
var testy = 0;
var timeSeconds = 0;
@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]