Skip to content

Instantly share code, notes, and snippets.

View megawac's full-sized avatar

Graeme Yeates megawac

  • Waterloo, Ontario
View GitHub Profile
from twisted.internet import reactor
from twisted.web.server import Site
from twisted.web.resource import Resource
import json, hmac
from hashlib import sha1
from blinker import signal
class WebhookServer(Resource):
@megawac
megawac / hack-debounce.js
Created June 29, 2015 19:34
log if debounce isn't called
function hackyDebounce(func, wait, options) {
var called = false;
var debounced = _.debounce(function() {
called = true;
func.apply(this, arguments);
}, wait, options);
return function() {
debounced.apply(this, arguments);
if (!called) {
console.log("It wasn't called");
@megawac
megawac / board-solver.js
Last active July 27, 2016 16:37
rough sudo code for emkay
function checkSquare(matrix, i, j) {
return columnValid(matrix, i) && rowValid(matrix, j)
}
function solvePuzzle(boardMatrix) {
(i, j) = selectFirstUnfilled(boardMatrix)
matrix = boardMatrix.clone()
matrix[i, j] = red
@megawac
megawac / fun.md
Created January 16, 2018 21:03
JaVaScRiPt4FUN