Skip to content

Instantly share code, notes, and snippets.

class Foo
def bar
puts "baz"
end
end
dsdfdsf
@jlindley
jlindley / jquery.deletable.js
Created July 22, 2008 02:18
Merb/jQuery: add delete method to destroy links.
// Make merb resource route url link_to's with class deletable fake delete HTTP method.
jQuery.fn.deletable = function() {
return this.each(function() {
var delete_link = $(this);
var hidden_form = document.createElement('form');
hidden_form.style.display = 'none';
delete_link.append(hidden_form);
hidden_form.method = 'POST';
hidden_form.action = delete_link.attr('href');
def satisfy?( request )
METHODS.all? do | method |
wanted = instance_variable_get( "@#{method}")
got = request.send( method ) if wanted
wanted.is_a? Proc ? wanted.call( got ) : wanted === got
end
end
Size := Object clone
large := Size new
medium := Size new
small := Size new
Colour := Object clone
black := Colour new
brown := Colour new
white := Colour new
<html>
<head>
<title>Getting the gist of Gist</title>
</head>
<body>
like a fox
</body>
</html>
what is this?
<?php
class Quote extends Feathers implements Feather {
public function __construct() {
$this->setField(array("attr" => "quote",
"type" => "text_block",
"rows" => 5,
"label" => __("Quote", "quote"),
"bookmarklet" => "selection"));
$this->setField(array("attr" => "source",
"type" => "text_block",
@hrabbit
hrabbit / gist:636
Created July 22, 2008 03:53
rotating backup
#shsql tools
SH_PATH=/usr/local/shsql/
shsqlstart=${SH_PATH}shsqlstart
shsql=${SH_PATH}shsql
shsqlend=${SH_PATH}shsqlend
shsqlline=${SH_PATH}shsqlline
SHSQL=mysql; export SHSQL
HANDLE=`${shsqlstart} "host=${SQL_HOST} dbname=${SQL_DBNAME} user=${SQL_USERNAME} password=${SQL_PASSWORD}"`