Skip to content

Instantly share code, notes, and snippets.

View stuartlangridge's full-sized avatar

Stuart Langridge stuartlangridge

View GitHub Profile
@stuartlangridge
stuartlangridge / TypeFileOut.py
Created January 9, 2014 16:11
Sublime Text 2 Python plugin to "type" the file that's currently being edited, character by character, for screencasts.
import sublime, sublime_plugin
BLOCKLEN = 4
class TypeFileOutCommand(sublime_plugin.TextCommand):
def nextchar(self):
if self.body:
totype = []
while 1:
try:
@stuartlangridge
stuartlangridge / gist:5799474
Created June 17, 2013 19:14
Initial cut of Ubuntu webapps script for Discourse. To be called in discourse/app/views/common/_discourse_javascript.html.erb, after Discourse.start().
// ==UserScript==
// @author Stuart Langridge <[email protected]>
// ==/UserScript==
if (external.getUnityObject) {
window.Unity = external.getUnityObject(1.0);
// use the Apple touch icon as icon
var icnsize=0, icnurl;
Array.prototype.slice.call(document.querySelectorAll("link[rel='apple-touch-icon']")).forEach(function(icn) {
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>Pure CSS toggle switch</title>
<style>
body {
font-size: 2em;
}
input { position: absolute; opacity: 0 }