This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<snippet> | |
<content><![CDATA[<span id="fn$1">[$1]</span><a href="#note$1">^</a> $2 | |
$0]]></content> | |
<tabTrigger>fn</tabTrigger> | |
<scope>text.html.markdown.multimarkdown, text.html.markdown</scope> | |
<description>Footnote at Bottom</description> | |
</snippet> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){ | |
// Wikipedia ships with jQuery v1.8.3 as of 5/14/13 | |
// will only count edits on the page | |
// if editor has >50 edits need to up the display limit | |
var numEdits = $( 'ul' ).eq( 0 ).find( 'li' ).length, | |
bytesChanged = 0; | |
$( '.mw-plusminus-pos, .mw-plusminus-neg' ).each( function ( el, index ) { | |
// text looks like (+###) where # of digits is variable | |
// e.g. (+3), (-45), (+1,479) | |
// so remove any commas, first 2 chars, last char, & parse as int |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function ( $ ) { | |
// run after document is loaded so ga.js is available | |
$( document ).ready( setTracking ); | |
function setTracking () { | |
// class is specific to databases subject list | |
$( '.view-clone-of-databases-subject-list a' ).click( databaseTracking ); | |
} | |
function databaseTracking ( event ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def RainbowTest(wall): | |
print "RainbowTest" | |
rainbowColors = [ colors["red"], colors["orange"], colors["yellow"], colors["green"], colors["baby blue"], colors["blue"], colors["purple"] ] | |
i = 0 | |
for y in range( wall.height ): | |
color = rainbowColors[ i ] | |
i += 1 | |
if i == 7: | |
i = 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// need to download simple_html_dom.php from SourceForge | |
// http://sourceforge.net/projects/simplehtmldom/files/ | |
// and place it in the same directory as this script | |
require_once( 'simple_html_dom.php' ); | |
// http://simplehtmldom.sourceforge.net/manual_api.htm | |
$base = 'http://www.doaj.org/doaj?func=search&template=&uiLanguage=en&query='; | |
$query = urlencode( 'librarianship' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env fish | |
# similar script in Fish | |
# still under construction, need to quiet `git status` more effectively | |
function update -d 'Update git repo' | |
git stash --quiet | |
git pull | |
git stash apply --quiet | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// stupid Node.js tricks | |
// accepts JS object literal of commands & their args | |
// executes each in series, pipes child process output to parent | |
// e.g. `node hellspawn.js '{"ls": "-al", "pwd": null, "echo": "Hello world!"}'` | |
var spawn = require('child_process').spawn | |
, cmds = JSON.parse(process.argv[2]) | |
, cmd | |
, key | |
, val; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// taken from https://medium.com/html5-css3/7c80a4b731f8 | |
// and expanded, unreadable one-liners are kind of pointless | |
//pad zeroes | |
function pad(num) { | |
return ('0' + num).split('').reverse().splice(0,2).reverse().join('') | |
} | |
// get page query params | |
var qp = document.location.search.replace(/(^\?)/,'') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var clipboard = require('child_process').spawn('pbcopy') | |
, data = 'put whatever data here'; | |
clipboard.stdin.write(data); | |
clipboard.stdin.end(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# note final, more robust version at https://github.com/cca/millennium_patron_import | |
import sys | |
import csv # https://docs.python.org/2/library/csv.html | |
# PCODE mappings, etc. | |
from mapping import * | |
import datetime | |
import re |