Skip to content

Instantly share code, notes, and snippets.

View tjstebbing's full-sized avatar
🐝
.go .py .js .vim

Timothy Stebbing tjstebbing

🐝
.go .py .js .vim
View GitHub Profile
/* Got an odd bug using duckduckgo searching for "lucifer's hammer"
* turns out search results from wikipedia are not escaped. DDG loads:
* https://duckduckgo.com/t.js?q=lucifer%27s%20hammer&t=A&l=au-en&p=1&s=0&a=ffab&ct=AU&sp=0
* which contains:
*/
nrj('/f.js?u=https://en.wikipedia.org/wiki/Lucifer's_Hammer');
// ^ note the unescaped wikipedia URL
/* potentially you could create a wikipedia page titled "somebank';window.location='somebank.fishingsite..."
function prepData(data) {
let out = [];
Object.keys(data).forEach(function(k) {
let o = data[k];
let variants = [];
let first, latest;
let dist = o.distribution;
let total = 0;
Object.keys(o.count).forEach(function(c) {
Office-supplies:
Tissues
USB sticks 5
sharpies / thick markers 5
paper for signs / butchers paper?
template = """
These are my inputs:
%s
These are my outputs:
%s
"""
SyntaxError: /home/pomke/code/iona/handlers.js: Unexpected token (31:51)
29 | log(msg);
30 |
> 31 | let handler = avatar[sig] || (msg, cb) => {
| ^
32 | return cb('invalid signal');
33 | };
34 |
xsetwacom list
Wacom Intuos4 8x13 stylus id: 14 type: STYLUS
Wacom Intuos4 8x13 eraser id: 15 type: ERASER
Wacom Intuos4 8x13 cursor id: 16 type: CURSOR
Wacom Intuos4 8x13 pad id: 17 type: PAD
xsetwacom --get "Wacom Intuos4 8x13 stylus" all
Option "Area" "0 13208 65024 40640"
'Button' requires exactly 1 value(s).
pomke@panda ~ $ /opt/project-neon/bin/krita
###################################
# Adding a tablet device: Wacom Intuos4 8x13 stylus
Device Type: "Stylus"
# Axes limits data
X: 0 65024
Y: 0 40640
Z: 0 0
Pressure: 0 2048
Rotation: -900 899
@tjstebbing
tjstebbing / gist:583fc521175bc3b7778e
Created February 4, 2015 21:40
Nouns - Mud parser
You stand in a small meadow outside of Chiiron. To the east, the town walls rise above your head, protecting the inhabitants from the perils which lurk outside the gates. A shallow trickle of a stream flows out of the woods to the northeast, heading off to the southeast. Off to the south, you see a town gate.
Nouns:
TextNode: 'meadow'
TextNode: 'Chiiron'
TextNode: 'town'
TextNode: 'walls'
TextNode: 'rise'
TextNode: 'head'
TextNode: 'inhabitants'
var ht = require('hudson-taylor');
var sanitize = require('sanitize-caja');
//XXX This MUST be invoked before any of our libs are loaded, overrides
//ht-schema's String validator.
ht.validators.add("String", makeParser(strParser, null));
function strParser(args, childValidators, data) {
args = merge(args, {min: null, max : null, enum : null, raw : false});
if(!data && !args.opt) throw new Error("required String");
var rv = require("rivets");
var fickle = require("fickle");
// Attempt at making a rivets/fickle adapter that remembers keypaths,
// really doesn't work when you start trying to set values :/
function adapt() {
var ctx = fickle.context();
history = {};