Skip to content

Instantly share code, notes, and snippets.

View bibliotechy's full-sized avatar

Chad Nelson bibliotechy

View GitHub Profile
@bibliotechy
bibliotechy / winners.js
Created November 14, 2012 14:04
Makes currently winning proposals bada55. Any proposals tied for entry are yellow.
count = 0;
done = false;
$("table.table tbody tr td[class!='election_results_score']").each(function(index){
proposals = $(this).children();
if (count + proposals.length < 20 && done == false) {
proposals.css('background-color','#bada55');
count += proposals.length;
}
else if (count + proposals.length == 20 && done == false){
@bibliotechy
bibliotechy / real-winners.js
Created November 14, 2012 14:37
winners now charlie sheened
count = 0;
done = false;
$("table.table tbody tr td[class!='election_results_score']").each(function(index){
proposals = $(this).children();
if (count + proposals.length < 20 && done == false) {
proposals.append('<img src="http://cdn.androidblip.com/icn/com_jasonbuehler_charlieSheen____132896.png" />');
count += proposals.length;
}
else if (count + proposals.length == 20 && done == false){
@bibliotechy
bibliotechy / gist:4979053
Created February 18, 2013 17:30
Takes the output of running pngnq on a file and returns it to its original filename.
#!/usr/bin/python
# Filename: denq.py
from os import path
import shutil
import sys
def main():
if sys.argv:
base = sys.argv[1] #get the filename from shell
@bibliotechy
bibliotechy / gist:5025384
Created February 24, 2013 20:11
shortimer migrate list
social_auth
( ) 0001_initial
( ) 0002_auto__add_unique_nonce_timestamp_salt_server_url__add_unique_associati
jobs
( ) 0001_initial
( ) 0002_auto__add_userprofile
( ) 0003_auto__add_field_userprofile_twitter_username__add_field_userprofile_fa
( ) 0004_auto__del_field_userprofile_twitter_username__del_field_userprofile_li
( ) 0005_auto__add_field_employer_freebase_id
@bibliotechy
bibliotechy / gist:5238549
Created March 25, 2013 16:42
the other bash profile
VIMDIR="$HOME/AppData/Local/Temp/Temp1_vim73-x64.zip/vim73"
DevKit="/c/DevKit/bin"
MingW="/c/DevKit/mingw/bin"
rsync="/c/rsync"
ssh="/c/cygwin-ssh/ssh"
PATH="$ssh:$rsync:$VIMDIR:$PATH:$DevKit:$MingW"
export PATH
# Aliases
@bibliotechy
bibliotechy / gist:5781505
Created June 14, 2013 12:39
shortimer error on ./manage.py syncdb --migrate --noinput
/home/cbn/.virtualenvs/shortimer/local/lib/python2.7/site-packages/django/conf/__init__.py:221: DeprecationWarning: You have no filters defined on the 'mail_admins' logging handler: adding implicit debug-false-only filter. See http://docs.djangoproject.com/en/dev/releases/1.4/#request-exceptions-are-now-always-logged
DeprecationWarning)
Syncing...
Creating tables ...
Creating table auth_permission
Creating table auth_group_permissions
Creating table auth_group
Creating table auth_user_groups
Creating table auth_user_user_permissions
@bibliotechy
bibliotechy / ignitephilly,json
Created November 8, 2013 18:00
Tweet data from Ignite Philly 12 (Noy 7 2013)
This file has been truncated, but you can view the full file.
{"contributors": null, "truncated": false, "text": "RT @PunkAveBen: Stories of taxidermy and how our stories are connected #ignitephilly http://t.co/h7SPTSi0vW", "in_reply_to_status_id": null, "id": 398865738758238208, "favorite_count": 0, "source": "<a href=\"http://twitter.com/download/iphone\" rel=\"nofollow\">Twitter for iPhone</a>", "retweeted": false, "coordinates": null, "entities": {"symbols": [], "user_mentions": [{"id": 1375659296, "indices": [3, 14], "id_str": "1375659296", "screen_name": "PunkAveBen", "name": "Ben Rosenbach"}], "hashtags": [{"indices": [71, 84], "text": "ignitephilly"}], "urls": [{"url": "http://t.co/h7SPTSi0vW", "indices": [85, 107], "expanded_url": "http://instagram.com/p/gb9jvbti4z/", "display_url": "instagram.com/p/gb9jvbti4z/"}]}, "in_reply_to_screen_name": null, "in_reply_to_user_id": null, "retweet_count": 1, "id_str": "398865738758238208", "favorited": false, "retweeted_status": {"contributors": null, "truncated": false, "text": "Stories of taxidermy and how our stories ar
@bibliotechy
bibliotechy / gist:8870781
Created February 7, 2014 20:10
Internet Archive Book Reader exception
ClientAbortException: java.net.SocketException: Connection reset
at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:388)
at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.java:371)
at org.apache.catalina.connector.OutputBuffer.writeBytes(OutputBuffer.java:413)
at org.apache.catalina.connector.OutputBuffer.write(OutputBuffer.java:401)
at org.apache.catalina.connector.CoyoteOutputStream.write(CoyoteOutputStream.java:91)
at org.apache.cxf.io.AbstractWrappedOutputStream.write(AbstractWrappedOutputStream.java:51)
at org.apache.cxf.helpers.IOUtils.copy(IOUtils.java:141)
at org.apache.cxf.helpers.IOUtils.copyAndCloseInput(IOUtils.java:109)
at org.apache.cxf.jaxrs.provider.BinaryDataProvider.copyInputToOutput(BinaryDataProvider.java:135)
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:foxml="info:fedora/fedora-system:def/foxml#"
xmlns:mods="http://www.loc.gov/mods/v3"
xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
exclude-result-prefixes="foxml mods"
version="1.0">
<xsl:template match="foxml:datastream[@ID='MODS']/foxml:datastreamVersion[last()]" name="SORTS">
@bibliotechy
bibliotechy / djatoka.log
Last active August 29, 2015 14:01
Freelib djatoka errors on install
[DEBUG] 16:22:24.726 [ i.f.d.v.ImageServlet , cacheNewImage , 471 ] Renaming cache file from /opt/freelib-djatoka/target/tmpcache/cache2025681233-1150059950550828726.jpg to /opt/freelib-djatoka/target/cache/pairtree_root/--/=w/al/te/rs/=W/10/2_/00/00/59/_9/50/image_220-256_4096-4096-4096-3517.jpg
[DEBUG] 16:22:26.411 [ g.l.a.d.o.OpenURLJP2KService , resolve , 363 ] makingTile: /opt/freelib-djatoka/target/tmpcache/cache119161953-5843240478956513048.jpg 10791 params: {"reduce": "0", "level": "-1", "region": "8192,4096,2365,3517", "rotate": "0", "scalingFactor": "1.0", "scalingDims": "220,148", "compLayer": "0" }
[DEBUG] 16:22:26.412 [ g.l.a.d.o.OpenURLJP2KService , resolve , 424 ] Getting OpenURLResponse...
[DEBUG] 16:22:26.412 [ g.l.a.d.o.OpenURLJP2KService , resolve , 464 ] OpenURL service: [ -1 | 220,148 | 8192,4096,2365,3517 | 0 ] = --/walters/W102_000059_950_image_220-148_8192-4096-2365-3517.jpg
[DEBUG] 16:22:26.412 [ g.l.a.d.o.OpenURLJP2KService , resolve , 473 ] Setting cache session data [ --/walters/W1