Skip to content

Instantly share code, notes, and snippets.

View qodeninja's full-sized avatar
🐍
snek

Qodeninja qodeninja

🐍
snek
  • San Francisco
View GitHub Profile

Keybase proof

I hereby claim:

  • I am qodeninja on github.
  • I am qodeninja (https://keybase.io/qodeninja) on keybase.
  • I have a public key whose fingerprint is 7071 4F49 9A60 1036 920F 8013 5A20 C8FE 7D8E 6FD6

To claim this, I am signing this object:

// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible).
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export.
var FORMAT_ONELINE = 'One-line';
var FORMAT_MULTILINE = 'Multi-line';
var FORMAT_PRETTY = 'Pretty';
var LANGUAGE_JS = 'JavaScript';
var LANGUAGE_PYTHON = 'Python';
accept
accept-charset
accesskey
action
align
alt
async
autocomplete
autofocus
autoplay
accesskey
class
contenteditable
contextmenu
data-*
dir
draggable
dropzone
hidden
id
a
abbr
acronym
address
applet
area
article
aside
audio
b
@qodeninja
qodeninja / gist:7ca09823dee5e8dc839f
Created May 29, 2015 16:04
Python - simple words in a file histogram (sorted by count)
def load_data_file():
with open('data.in') as f:
for line in f:
words = line.split()
for word in words:
if histogram[word] is not None:
histogram[word]+=1
print "Already found ({}) {}".format(word,histogram[word])
else:
histogram[word]=0
@qodeninja
qodeninja / iife-variable-context.js
Last active August 29, 2015 14:11
Understanding IIFE - preserve the context of a variable by immediately executing function
var y = 100;
//immediate invocation outside of expression
var fnx = (function fn( x ){
return 'save context : fnx=' + (x+y);
})(y);
//immediate invocation inside of expression
var fny = (function fny( x ){
return 'save context : fny=' + (x+y);