Skip to content

Instantly share code, notes, and snippets.

View spiralx's full-sized avatar

James Skinner spiralx

View GitHub Profile
@spiralx
spiralx / log-globals.js
Created May 15, 2016 03:05
Bookmarklet to log global variables
javascript:console.log(function(){var a=document.createElement("iframe");a.style.display="none";document.body.appendChild(a);var c=a.contentWindow;document.body.removeChild(a);var a=Object.create(null),b;for(b in window)b in c||(a[b]=window[b]);return a}())
@spiralx
spiralx / zepto-custom-1.1.6.js
Created May 12, 2016 01:55
Zepto v1.1.6 custom build
/*! Zepto 1.1.6 (generated with Zepto Builder) - zepto event ajax form ie stack selector fx fx_methods detect data - zeptojs.com/license */
var Zepto=function(){function t(t){return null==t?String(t):U[J.call(t)]||"object"}function e(e){return"function"==t(e)}function n(t){return null!=t&&t==t.window}function i(t){return null!=t&&t.nodeType==t.DOCUMENT_NODE}function r(e){return"object"==t(e)}function o(t){return r(t)&&!n(t)&&Object.getPrototypeOf(t)==Object.prototype}function a(t){return"number"==typeof t.length}function s(t){return A.call(t,function(t){return null!=t})}function u(t){return t.length>0?j.fn.concat.apply([],t):t}function c(t){return t.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()}function l(t){return t in M?M[t]:M[t]=new RegExp("(^|\\s)"+t+"(\\s|$)")}function f(t,e){return"number"!=typeof e||$[c(t)]?e:e+"px"}function h(t){var e,n;return L[t]||(e=Z.createElement(t),Z.body.appendChild(e),n=getComputedStyle(e,"").ge
@spiralx
spiralx / reddit.user.js
Last active October 11, 2017 18:37
Make "Continue this thread" and "Load more comments" links load comments inline instead of opening a new page
// ==UserScript==
// @name Reddit - Load 'Continue this thread' inline
// @description Changes 'Continue this thread' links to insert the linked comments into the current page
// @author James Skinner <[email protected]> (http://github.com/spiralx)
// @namespace http://spiralx.org/
// @version 1.9.2
// @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAFiAAABYgAWToQQYAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAF3SURBVDhP1ZI/SAJhGMZN3WpKOAgsKGiIoKWg0K2LXIJWj6DAhpAgKMiW7irBqziHbhYE12sLGtWGKHBx0kHcQrBJXNIz9e35vvsQoj841g9+fHy8z/PyHZzrXzANNbgKF2ASHsOhOYGTUIb3cBSq4hyKa3Ey2GsMeMRvvzALd+AVvIPbcAb+yAq8hBehUOgxnU5TtVol27ap3W5TpVKhVCpFsiw/IHMusstwgOHxeDZM07T7/T5Rr0vUfacBvR7uHWIzwzBayK+zDm8KktFo9FXEifaXiHbnxAXEZKKtqcHSSCTygs6nBYuWZfEhR1eIzjbFBdzsYcma8xKQyWQInXmn6jCeSCQ6fDoEqqqyzxhzqgK/368Xi0UeKJfLpGka5fN5yuVyrEClUonPCoUCSZLE/oMvjGBwqut6q16vU6PRoGw2yxc0m02q1WoUj8fffD5fjGWdyvdMeL3ew2AweKsoynM4HH4KBAKW2
@spiralx
spiralx / reddit.user.css
Last active February 15, 2017 11:59
Reddit user style
@-moz-document domain("reddit.com") {
@import url("https://fonts.googleapis.com/css?family=Merriweather+Sans:400,400italic,700,700italic");
body {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-rendering: optimizeLegibility;
font-family: 'Merriweather Sans', sans-serif;
font-size: 14pt;
line-height: 1.44em;
color: #000;
@spiralx
spiralx / User script templates for Tampermonkey
Last active September 23, 2024 18:22
Tampermonkey user script templates
For
* ES5
* ES6
* CoffeeScript
@spiralx
spiralx / Base 16.tmTheme
Created February 4, 2016 15:04
Current Sublime Text theme
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<!-- Generated by: TmTheme-Editor -->
<!-- ============================================ -->
<!-- app: http://tmtheme-editor.herokuapp.com -->
<!-- code: https://github.com/aziz/tmTheme-Editor -->
<plist version="1.0">
<dict>
<key>comment</key>
<string>Chris Kempson (http:&#x2f;&#x2f;chriskempson.com)</string>
@spiralx
spiralx / .bashrc
Last active July 13, 2021 04:16
Current Bash profile used by Git Bash
#!/bin/sh
source ~/shell/colours.sh
B1=" ${YELLOW} ♦ ${YELLOW}"
B2=" ${CYAN} ● ${WHITE}"
#B2=" ${BCYAN} ○ ${WHITE}"
echo
echo -e "${B1}Welcome ${BBLUE}${USERNAME}${YELLOW}!${RESET}"
(function(global) {
'use strict';
const BOLD = 'font-weight: bold;',
BLUE = 'color: #88f',
NORMAL = 'font-weight: normal; color: black;'
/*
See:
@spiralx
spiralx / cache.js
Created January 26, 2016 18:58
Simple key-object cache with Greasemonkey and local storage options
'use strict';
// --------------------------------------------------------------------
class Cache extends Map {
constructor(key) {
super()
this._key = key
this.load()
}