Skip to content

Instantly share code, notes, and snippets.

View jaz303's full-sized avatar

Jason Frame jaz303

View GitHub Profile
23:15
rofl
23:15
thats an epic bug
23:15
my cache sweeper just removed my entire public directory
02:39
omg
02:39
what a fucking retard
02:39
i'm hitting the wrong port
02:39
have been for like
02:39
an hour
/**
IMPORTANT: Requires this version of jquery
until 1.3.3 comes out http://gist.github.com/186325
ALSO: This is very dirty still and has not been
abstracted for use. It is just solving our immediate problems.
Use cases that must pass (and should be tested someday):
* Clicking on links updates layout
* Click around a bit and then use back/forward buttons
public void parseLevel() {
open("level");
while (at("map", "tilesets")) {
if (at("map")) {
open("map");
int width = (int) attr("width");
int height = (int) attr("height");
// alloc map array of width x height
for (int i = 0; i < height; i++) {
open("r");
function valueForKeyRecurse(object, chunks) {
var bit = chunks.shift(), val;
if (bit in object) {
return chunks.length
? valueForKeyRecurse(object[bit], chunks)
: object[bit];
} else {
var getter = object['get' + bit.charAt(0).toUpperCase() + bit.substring(1)];
if (typeof getter == 'function') {
return chunks.length
# constructor = lambda { build_valid_user }
# truth_table = [
# [ :account_admin=, :can_upload=, :"account.public_uploads_allowed=", :can_upload_files?, :can_upload_public_files?],
# [ false, false, false, false, false],
# [ true, false, false, true, true],
# [ false, true, false, true, false],
# [ true, true, false, true, true],
# [ false, false, true, false, false],
# [ true, false, true, true, true],
# [ false, true, true, true, true],
module SomeHelper
#
# Block Menu
def block_menu(&block)
BlockMenuBuilder.new(self).render(&block)
end
class BlockMenuBuilder
# change to gem dir for current ruby/gemset
function cdgem {
cd $(rvm gemdir)/gems
cd $(ls | grep $1 | sort | tail -1)
}
# edit gem for current ruby/gemset
function egem {
cd $(rvm gemdir)/gems
mate $(ls | grep $1 | sort | tail -1)
@jaz303
jaz303 / gist:658991
Created November 1, 2010 22:29
Hacking Boxy.load to return dialog immediately
Boxy.load = function(url, options) {
options = options || {};
var boxy = null;
var ajax = {
url: url, type: 'GET', dataType: 'html', cache: false, success: function(html) {
html = jQuery(html);
if (options.filter) html = jQuery(options.filter, html);
boxy.setContent(html);
function dir_warp {
if [ "$(pwd)" == "$HOME" ]
then
cd "`pbpaste`"
else
pwd | pbcopy
fi
}
alias ::="dir_warp"