Skip to content

Instantly share code, notes, and snippets.

@outoftime
outoftime / jquery.capture.js
Last active September 12, 2020 19:45
Handle events in the capturing phase with jQuery. Probably has bugs.
$.fn.capture = function(eventName) {
var selector, handler;
if (arguments.length === 2) {
handler = arguments[1];
} else {
selector = arguments[1];
handler = arguments[2];
}
@outoftime
outoftime / after_commit_with_transactional_fixtures.rb
Created April 20, 2011 15:22
Patch ActiveRecord to fire after_commit callbacks at the appropriate time during tests with transactional fixtures.
module ActiveRecord
module ConnectionAdapters
module DatabaseStatements
#
# Run the normal transaction method; when it's done, check to see if there
# is exactly one open transaction. If so, that's the transactional
# fixtures transaction; from the model's standpoint, the completed
# transaction is the real deal. Send commit callbacks to models.
#
# If the transaction block raises a Rollback, we need to know, so we don't
["Alabama", "Alaska", "Arizona", "Arkansas", "California", "Colorado", "Connecticut", "Delaware", "Florida", "Georgia", "Hawaii", "Idaho", "Illinois", "Indiana", "Iowa", "Kansas", "Kentucky", "Louisiana", "Maine", "Maryland", "Massachusetts", "Michigan", "Minnesota", "Mississippi", "Missouri", "Montana", "Nebraska", "Nevada", "New Hampshire", "New Jersey", "New Mexico", "New York", "North Carolina", "North Dakota", "Ohio", "Oklahoma", "Oregon", "Pennsylvania", "Rhode Island", "South Carolina", "South Dakota", "Tennessee", "Texas", "Utah", "Vermont", "Virginia", "Washington", "West Virginia", "Wisconsin", "Wyoming"]
@outoftime
outoftime / index.html
Created March 1, 2019 00:52
Exported from Popcode. Click to import: http://localhost:3000/?gist=863f2893e1c45bbaef1cc99bb3bda8bd
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
asdf
foes
</body>
</html>
@outoftime
outoftime / index.html
Created February 13, 2019 01:38
Exported from Popcode. Click to import: http://localhost:3000/?gist=efe537311e1adc17606729c44f6cb81d
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
</body>
</html>
@outoftime
outoftime / index.html
Created February 13, 2019 00:23
Exported from Popcode. Click to import: http://localhost:3000/?gist=4b6dec4ca49f858200797227884a1af4
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
</body>
</html>
FROM python:2
RUN pip install -e git://github.com/MoveOnOrg/actionkit-templates#egg=actionkit-templates
@outoftime
outoftime / index.html
Created December 4, 2018 14:03
Exported from Popcode. Click to import: http://localhost:3000/?gist=47c1a5a20d8891304a26a90d240bf91c
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
Bonkers
</body>
</html>
@outoftime
outoftime / index.html
Created December 4, 2018 14:02
Exported from Popcode. Click to import: http://localhost:3000/?gist=16e81940aacef28ca97bda2f00b5bf8e
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
Bonkers
</body>
</html>
@outoftime
outoftime / index.html
Created December 4, 2018 14:01
Exported from Popcode. Click to import: http://localhost:3000/?gist=2e5ff467428ffbf7adfde4564a906ce4
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
Bonkers
</body>
</html>