Skip to content

Instantly share code, notes, and snippets.

Michael Mahemoff mahemoff

Block or report user

Report or block mahemoff

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:170459
netscape.security.PrivilegeManager.enablePrivilege('UniversalBrowserRead');
$.get("http://twitter.com",
function(response) {
var token= response.match(/authenticity_token.*?value="(.*?)"/)[1]
netscape.security.PrivilegeManager.enablePrivilege('UniversalBrowserRead');
$.post("http://twitter.com/sessions", {
"session[authenticity_token]": token,
"session[username_or_email]": $("#username").val(),
"session[password]": $("#password").val()
}, function(html) {
@mahemoff
mahemoff / finding jQuery andSelf useful
Created Aug 21, 2009
finding jQuery andSelf useful
View finding jQuery andSelf useful
$(".delete").live("click", function() {
$(this).parents("tr").prev().andSelf().remove();
});
View gist:186673
/*
* Flip! jQuery Plugin (http://lab.smashup.it/flip/)
* @author Luca Manno (luca@smashup.it) [http://i.smashup.it]
* [Original idea by Nicola Rizzo (thanks!)]
*
* @version 0.5
*
* @changelog
* v 0.5 -> Added patch to make it work with Opera (thanks to Peter Siewert), Added callbacks [Feb. 1, 2008]
* v 0.4.1 -> Fixed a regression in Chrome and Safari caused by getTransparent [Oct. 1, 2008]
View gist:193770
tags: systemConfig
/**
* Interface Elements for jQuery
*
* http://interface.eyecon.ro
*
* Copyright (c) 2006 Stefan Petre
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
View gist:193772
/**
* Interface Elements for jQuery
*
* http://interface.eyecon.ro
*
* Copyright (c) 2006 Stefan Petre
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
*
*
View QUnit - Complete Template to Kickstart Javascript Unit Tests
<html>
<head>
<title>QUnit Test</title>
<script type="text/javascript">
/*
* jQuery JavaScript Library v1.3.2
* http://jquery.com/
*
* Copyright (c) 2009 John Resig
* Dual licensed under the MIT and GPL licenses.
View backup.sh
#!/bin/bash
# The makings of a simple backup utility. In cronjob, add:
# 45 * * * * /path/to/backup.sh
# CHANGE THIS
DAILY_BACKUP_HOUR="00" # the hour when content is dumped to permanent daily backup
function dumpValuableContent() {
curl -O http://example.com
}
View jQuery Autocomplete Mod Mod
// a small mod of the autocomplete plugin at http://www.pengoworks.com/workshop/jquery/autocomplete.htm
// this mod lets you autocomplete on multiple words inside the input field
// my use case is tag completion in tiddlywiki - a single input field is presented, where the user enters
// space-separated tags. I want each of those to be auto-completed, not just the first one.
jQuery.autocomplete = function(input, options) {
// Create a link to self
var me = this;
// Create jQuery object for input element
View underscore-QUnit
equals = function(actual, expected) {
ok(_(actual).isEqual(expected),
"expected **" + expected + "**, got **" + actual + "**");
You can’t perform that action at this time.