Skip to content

Instantly share code, notes, and snippets.

// ==UserScript==
// @name jQuery + printforms
// @namespace jQuery
// @description Use jQuery to print form variables and input element values on submit - cancels form submit
// @author Joan Piedra (jQuery integration) + Jesse Trimble
// @homepage http://www.joanpiedra.com/jquery/greasemonkey - http://www.rmrdevelopment.com
// @include *
// ==/UserScript==
//
// MiniToggle.h
// MiniToggle
//
// Created by jtrim on 2/12/10.
/*
MiniToggle.h & MiniToggle.m:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
#minute hour dayOfMonth month dayOfWeek command
0,30 * * * * cd /path/to/project && svn add . --force && svn commit -m "semi-hourly commit at `date`" > /dev/null
#!/bin/bash
filename=0
for i in `ls -1 | grep mov`
do
filename=$((filename + 1))
ffmpeg -sameq -i $i -s 640x360 converted/$filename.flv
done
#!/bin/bash
for i in `ls -1 converted`
do
ffmpeg -i converted/videos/$i -vframes 1 -r 1 -f image2 converted/images/$i.jpg
done
//
// AudioPauseLoopAppDelegate.m
// AudioPauseLoop
//
// Created by Jesse Trimble on 7/13/10.
// Copyright n/a 2010. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "AudioPauseLoopAppDelegate.h"
root_dir = "/path/to/rails/app"
dirs = ["app/mailers", "app/models", "lib/tasks", "public/stylesheets", "test/fixtures", "test/functional", "test/integration", "test/unit", "vendor/plugins"]
dirs.each do |dir|
begin
File.open File.join(root_dir, dir, ".gitkeep"), "w" do |file|
file.puts ""
end
rescue
date +%Y%m%d%H%M%S
@jtrim
jtrim / dayahead.sh
Created December 5, 2010 00:44
Shell script that uses ruby to get a humanized version of a long date string. Copies to your clipboard and echoes to the command line. NOTE: Uses pbcopy to copy to the clipboard, which is only available on OSX. From terminal, run "dayahead 0" to get today
function dayahead() {
DAYSTRING=`ruby -e "require \"time\"; require \"date\"; puts Time.parse((Date.today + $1).to_s).strftime(\"%A, %B %d, %Y\")"`
echo -n $DAYSTRING | pbcopy
echo $DAYSTRING
}
@jtrim
jtrim / git_latest.sh
Created December 21, 2010 17:22
Bash function to echo the latest git commit in oneline format and copy the SHA1 to your clipboard under OSX
function glast() {
LATEST=`git log --oneline -n 1`
echo -n $LATEST | ack '^([a-zA-Z0-9]*) {1}' --output='$1' | pbcopy
echo $LATEST
}