Skip to content

Instantly share code, notes, and snippets.

View spiralx's full-sized avatar

James Skinner spiralx

View GitHub Profile
@spiralx
spiralx / bookmarklet-generator.js
Created March 11, 2014 16:10
Bookmarklets I've written or found useful
/*
* Prompts for the URL of a script, then creates a bookmarklet to load and run the script.
*
* javascript:(function(u) {u=prompt('Script URL');u&&prompt('Bookmarklet', 'javascript:(function(d,s){s=d.createElement("script");s.src="'+u.replace(/^https?:/,'')+'?cb="+Math.random();d.body.appendChild(s)})(document)') })()
*/
(function(u) {
u = prompt('Script URL');
u && prompt('Bookmarklet',
'javascript:(function(d,s){s=d.createElement("script");s.src="' +
u.replace(/^https?:/,'') +
@spiralx
spiralx / buttons.css
Last active August 29, 2015 13:58
A set of icons in data URI format and other utility classes
.buttonRow {
background-color: white;
padding: 0.8em;
border: solid 2px black;
z-index: 999999999;
position: fixed;
top: 2em;
left: 2em;
}
@spiralx
spiralx / github-npm-autolink.user.js
Last active August 29, 2015 14:05
GitHub package.json dependency linker
@spiralx
spiralx / facebook-so-what.user.js
Created August 27, 2014 21:08
Silly user script
// ==UserScript==
// @id facebook-so-what@spiralx.org
// @name Facebook So Hwæt
// @version 0.0.1
// @namespace http://spiralx.org/facebook-what
// @author James Skinner <spiralx@gmail.com> http://github.com/spiralx
// @match https://*.facebook.com/*
// @match https://facebook.com/*
// @exclude */ai.php*
// @run-at document-end
@spiralx
spiralx / jquery-mutation-summary.js
Created October 31, 2014 01:55
jquery-mutation-summary.js
/*!
* @license jquery-mutation-summary
* Copyright © 2012, 2013, 2014, Joel Purra <http://joelpurra.com/>
* Released under MIT, BSD and GPL license. Comply with at least one.
*
* A jQuery wrapper/plugin for mutation-summary, the DOM mutation-observers wrapper.
* http://joelpurra.github.com/jquery-mutation-summary
*
* "Mutation Summary is a JavaScript library that makes observing changes to the DOM fast, easy and safe."
* http://code.google.com/p/mutation-summary/
@spiralx
spiralx / mono.css
Created February 16, 2015 23:49
CSS for bookmarklet popups
body {
font: 12px/1.5 Consolas,monospace;
}
h3 a {
font-size: 1.2em;
color: #000;
}
a {
display: inline-block;
@spiralx
spiralx / utils.js
Created February 24, 2015 13:51
Various small utility functions for user scripts
;(function(name, definition) {
var moduleObj = definition();
// AMD Module
if (typeof define === 'function') {
define(moduleObj);
}
// CommonJS Module
else if (typeof module !== 'undefined' && module.exports) {
module.exports = moduleObj;
@spiralx
spiralx / prism-twilight.css
Last active August 29, 2015 14:19
Prism highlighter
code[class*=language-],pre[class*=language-]{color:#fff;direction:ltr;font-family:Consolas,Monaco,'Andale Mono',monospace;text-align:left;text-shadow:0 -.1em .2em #000;white-space:pre;word-spacing:normal;word-break:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}
:not(pre)>code[class*=language-],pre[class*=language-]{background:#141414}
pre[class*=language-]{border-radius:.5em;border:.3em solid #545454;box-shadow:1px 1px .5em #000 inset;margin:.5em 0;overflow:auto;padding:1em}
code[class*=language-] ::-moz-selection,code[class*=language-]::-moz-selection,pre[class*=language-] ::-moz-selection,pre[class*=language-]::-moz-selection{text-shadow:none;background:hsla(0,0%,93%,.15)}
code[class*=language-] ::selection,code[class*=language-]::selection,pre[class*=language-] ::selection,pre[class*=language-]::selection{text-shadow:none;background:hsla(0,0%,93%,.15)}
:not(pre)>code[class*=language-]{border-radius:.3em;border:.13em soli
import argparse
import re
from multiprocessing.pool import ThreadPool as Pool
import requests
import bs4
root_url = 'http://pyvideo.org'
index_url = root_url + '/category/50/pycon-us-2014'
@spiralx
spiralx / facebox.js
Created May 15, 2015 02:45
facebox.js - simple light-box popup (no external reqs)
/*
* Facebox (for jQuery)
* version: 1.3
* @requires jQuery v1.2 or later
* @homepage https://github.com/defunkt/facebox
*
* Licensed under the MIT:
* http://www.opensource.org/licenses/mit-license.php
*
* Copyright Forever Chris Wanstrath, Kyle Neath