Skip to content

Instantly share code, notes, and snippets.

@kamens
kamens / knowledgemap.js
Created July 23, 2012 16:25
Knowledge Map file for Constellation Knowledge blog post
function KnowledgeMapInitGlobals() {
window.KnowledgeMapGlobals = {
colors: {
blue: "#0080C9",
green: "#8EBE4F",
red: "#E35D04",
gray: "#FFFFFF"
},
@kamens
kamens / gist:4533077
Created January 14, 2013 20:26
jsonify proposals
###############################
# Proposal 1:
@jsonify
def monkey_function():
if gorillas:
# JsonResponse is a new function you'll write that will wrap this in a flask response object,
# so @jsonify's code, as-is, will know not to do anything to it
@kamens
kamens / gist:4613457
Created January 23, 2013 21:15
How to limit the events that trigger a Github hook message
>>> import requests
>>> import json
>>> r = requests.get('https://api.github.com/repos/kamens/gae_mini_profiler/hooks', auth=('kamens', 'dontyouwish'))
>>> r.text
u'[{"config":{"restrict_to_branch":"","auth_token":"monkeysmonkeysmonkeys","room":"1s and 0s"},"url":"https://api.github.com/repos/kamens/gae_mini_profiler/hooks/629092","active":true,"test_url":"https://api.github.com/repos/kamens/gae_mini_profiler/hooks/629092/test","updated_at":"2013-01-23T18:59:08Z","last_response":{"status":"ok","message":"OK","code":200},"events":["commit_comment","download","fork","fork_apply","gollum","issues","issue_comment","member","public","pull_request","push","watch"],"name":"hipchat","id":629092,"created_at":"2013-01-04T19:53:44Z"}]'
# Note the id from the hook that you're interested in. In this case, it's 629092
id = 629092
@kamens
kamens / gist:6290546
Created August 21, 2013 05:15
Pokin' around code I shouldn't be pokin' around
diff --git a/interface.js b/interface.js
index 89a7c2c..aef728b 100644
--- a/interface.js
+++ b/interface.js
@@ -41,6 +41,7 @@ var PerseusBridge = Exercises.PerseusBridge,
numHints,
hintsUsed,
lastAttemptOrHint,
+ lastAttemptContent,
firstProblem = true;
From csilvers, the original master of FIXITS:
1) The goal of a fixit is to address niggling concerns that bother you
time and again, but never enough to actually fix them.
As an example, I just got reviewed a changeset that gets rid of the
"Mismatch between XSRF header (None) and cookie (None)" lines that I
see all over the appengine error logs, and which as far as I can tell
convey no useful information (note: only in the case both values are