Skip to content

Instantly share code, notes, and snippets.

View asuth's full-sized avatar

Andrew Sutherland asuth

View GitHub Profile
@asuth
asuth / jquery.classlist.js
Last active December 17, 2015 14:39 — forked from raybellis/jquery.classlist.js
Adding toggleClass
/*global jQuery */
;(function($) {
/*global document */
"use strict";
if (typeof document !== 'undefined' && ('classList' in document.createElement('a'))) {
var $ = jQuery;
[Thu Oct 13 19:37:05.946 2011] [27614] rotating index 'quizlet_sets_delta': success
[Thu Oct 13 19:37:05.946 2011] [27614] rotating finished
[Thu Oct 13 19:37:06.168 2011] [27614] rotating indices (seamless=1)
[Thu Oct 13 19:37:06.173 2011] [27614] WARNING: rotating index 'quizlet_sets_main': prealloc: mmap() failed: Not enough space (length=275116427); using old index
[Thu Oct 13 19:37:06.173 2011] [27614] rotating finished
[Thu Oct 13 19:37:09.013 2011] [27614] rotating indices (seamless=1)
[Thu Oct 13 19:37:09.024 2011] [27614] rotating index 'quizlet_sets_delta': success
[Thu Oct 13 19:37:09.027 2011] [27614] WARNING: rotating index 'quizlet_sets_main': prealloc: mmap() failed: Not enough space (length=162417384); using old index
[Thu Oct 13 19:37:09.027 2011] [27614] rotating finished
[Thu Oct 13 19:37:12.081 2011] [27614] rotating indices (seamless=1)
@asuth
asuth / gmailfrom.user.js
Created February 10, 2011 00:18
Looks in your "To" field and sees if you have an email address in your "From" addresses with the same domain. Changes <select> onblur
// ==UserScript==
// @name Gmail "From" Address auto-selector
// @version 0.17
// @description Looks in your "To" field and sees if you have an email address in your "From" addresses with the same domain. Changes <select> onblur
// @author Andrew Sutherland, https://github.com/asuth
// @include http://mail.google.com/*
// @include https://mail.google.com/*
// @include http://*.mail.google.com/*
// @include https://*.mail.google.com/*
// ==/UserScript==
@asuth
asuth / Puppet syntax checking pre-commit hook
Created February 1, 2011 21:45
We use this to check our puppet scripts as a git pre-commit hook.
#!/opt/local/bin/php
<?php
// Git pre-commit file to check Puppet for errors
$files = array();
exec('git diff-index --cached --name-only HEAD', $files);
$exitcode = 0;
@asuth
asuth / php lint all files
Created January 11, 2011 04:34
improvement to https://www.firehed.net/lint-check-all-php-files-syntax-validation so that it doesn't re-lint all your files
#!/opt/local/bin/php
<?php
// https://www.firehed.net/lint-check-all-php-files-syntax-validation
// with some modifications
// ===========
// = Globals =
// ===========
$count = 0; // total files checked