Skip to content

Instantly share code, notes, and snippets.

View jkp's full-sized avatar

Jamie Kirkpatrick jkp

View GitHub Profile
@jkp
jkp / readability-no-init.js
Created April 8, 2021 20:42
Readability Javascript without auto initialization
/*jslint undef: true, nomen: true, eqeqeq: true, plusplus: true, newcap: true, immed: true, browser: true, devel: true, passfail: false */
/*global window: false, readConvertLinksToFootnotes: false, readStyle: false, readSize: false, readMargin: false, Typekit: false, ActiveXObject: false */
var dbg = (typeof console !== 'undefined') ? function(s) {
console.log("Readability: " + s);
} : function() {};
/*
* Readability. An Arc90 Lab Experiment.
* Website: http://lab.arc90.com/experiments/readability
@jkp
jkp / bookmarklet.js
Last active June 25, 2023 14:46
Text-to-speech Bookmarklet
(function() {
var script = document.createElement('script');
script.setAttribute('src', 'https://bit.ly/426oCvn');
script.onload = function() {
textToSpeech('YOURKEYHERE', getRandomVoice());
};
document.body.appendChild(script);
})();
@jkp
jkp / README.md
Last active August 29, 2015 14:07 — forked from adammw/README.md

Node.js for Raspberry Pi

Pre-built binaries

Recent releases have been pre-built using cross-compilers and this script and are downloadable below.

If you have found these packages useful, give me a shout out on twitter: @adammw

@jkp
jkp / gist:11255262
Created April 24, 2014 13:47
keybase.md
### Keybase proof
I hereby claim:
* I am jkp on github.
* I am jkp (https://keybase.io/jkp) on keybase.
* I have a public key whose fingerprint is 20B5 CD0A 8BC4 683D 68D8 6574 82CE E0DE F355 FD3B
To claim this, I am signing this object:
@jkp
jkp / readme.md
Created February 18, 2013 12:30 — forked from jlewin/readme.md
Refork your own Gists!
<?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">
<plist version="1.0">
<dict>
<key>Search</key>
<dict>
<key>Spotify-Albums</key>
<dict>
<key>Identifier</key>
<string>com.spotify.search.albums</string>
@jkp
jkp / websocketserver.py
Created July 18, 2012 13:28
A simple WebSockets server with no dependencies
import struct
import SocketServer
from base64 import b64encode
from hashlib import sha1
from mimetools import Message
from StringIO import StringIO
class WebSocketsHandler(SocketServer.StreamRequestHandler):
magic = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11'
@jkp
jkp / gist:2284716
Created April 2, 2012 16:15 — forked from ahankinson/gist:1426301
Boost Python error "No to_python (by-value) converter found..."
I'm posting this here because I had a maddening search for information about why this error occurs when trying to do certain tasks in a Boost Python binding to a C++ object:
TypeError: No to_python (by-value) converter found for C++ type: Element*
This was when trying to iterate over a vector, defined as:
typedef std::vector<Element*> ElementList;
It turns out that in your `class_<>` definitions you have to be pretty specific. I already had:
from sniffer.api import *
import os, termstyle
import subprocess
# you can customize the pass/fail colors like this
pass_fg_color = termstyle.green
pass_bg_color = termstyle.bg_default
fail_fg_color = termstyle.red
fail_bg_color = termstyle.bg_default
@jkp
jkp / qt5-base.rb
Created February 26, 2012 22:02
Formula to build a minimal qt5 base installation.
require 'formula'
require 'hardware'
class Qt5Base < Formula
homepage 'http://qt.nokia.com/'
head 'git://gitorious.org/qt/qtbase.git', :tag => 'e34ee3127043773a037bfd18a2d457d409032ee5'
keg_only 'For development purposes only'
def patches