Skip to content

Instantly share code, notes, and snippets.

View quinn's full-sized avatar
🐁
huh

Quinn Shanahan quinn

🐁
huh
View GitHub Profile
class Object
# just a more verbose way of reversing predicates.
#
# lets you do things like
# ' '.not_blank? # => false
# instead of
# !' '.blank? # => false
# doesn't work sometimes if someone is using method_missing
# somewhere (i.e. rails)
def method_missing(method, *args, &block)
# $Id: svntouch.sh 602 2007-10-01 19:40:17Z galbrecht $
# $URL$
# svntouch.sh
# description
# touch a file and add it to svn
# this saves the steps fo having to do these two things manually:
# $ touch file
# $ svn add file
# usage
# requires at least one argument, the name of the file to touch & add
// fun syntax for making elements on the page.
// from Aardvark Tools
jQuery.el= function(elem,properties) {
var i, s, p, c;
if (typeof(elem)=="string")
elem = document.createElement(elem);
if (properties) {
s = properties.style;
if (s)
# kinda stupid but functional add all question marks for svn
for i in $( svn st | grep ? ); do
svn add $i
done
class Object
def collapse
memcache.store :key => object_id, :value => ENV["HOST_NAME"]
end
end
require 'rubygems'
require 'ruby2ruby'
def fun *proc, &blk
if block_given?
puts blk.to_ruby
else
puts proc[0].to_ruby
end
end
#!/usr/bin/env ruby
# script written by github.com/masover
require 'fileutils'
(base, theirs, mine, target) = *ARGV
files = [mine, base, theirs]
stats = files.map{|f| [f, File.stat(f).mtime]}
system('meld', *files) || raise('Meld died!')
@quinn
quinn / the.js
Created October 9, 2008 18:57 — forked from collin/the.js
var the = 'part of speech';
var sorry = "yeah i'm pretty sure this doesn't make sense.";
BandInvite = $.clonable({
inviteEl: {}
,successEvent: function () {
debugger;
}
,findAcceptLink: function () {
var invite = this;
this.inviteEl.find('.accept-invite a').click(function () {
$.ajax({
type: 'POST',
$.fn.tap = function (fun) {
fun.call(this)
}
// oops this is pointless, these are the same
$('whatever')
.tap(function () {
this // is pointless
});