Skip to content

Instantly share code, notes, and snippets.

View danielnaab's full-sized avatar

Daniel Naab danielnaab

View GitHub Profile
### Keybase proof
I hereby claim:
* I am danielnaab on github.
* I am danielnaab (https://keybase.io/danielnaab) on keybase.
* I have a public key ASArgardmcLuyyfJYc1x3T5e4xW6esOJWv-ANjv7ENxpFAo
To claim this, I am signing this object:
@danielnaab
danielnaab / __init__.py
Last active March 29, 2016 18:03
Django settings template
try:
from .local import *
except ImportError:
from .development import *
@danielnaab
danielnaab / drag-handler.js
Created September 21, 2015 22:24
Drag handler for virtual-dom
'use strict';
function DragHandler(handlers, isDragging) {
this.isDragging = isDragging
this.onmousemove = function (event) {
handlers.onmove(event.clientX, event.clientY)
}
this.onmouseup = function () {

Keybase proof

I hereby claim:

  • I am danielnaab on github.
  • I am danielnaab (https://keybase.io/danielnaab) on keybase.
  • I have a public key whose fingerprint is 214F 6D33 8036 C40C 9B29 10C2 C8E3 A8AC E661 8E22

To claim this, I am signing this object:

@danielnaab
danielnaab / gist:77f77b7f23d57aaa763b
Created December 7, 2014 02:08
Current autocomplete with event issues
'use strict';
var hg = require('mercury')
var h = hg.h
function AutoCompleteInput(initial, getChoices, submitCallback) {
initial = initial || ''
return hg.state({
text: hg.value(initial),
@danielnaab
danielnaab / autocomplete.js
Last active August 29, 2015 14:10
Event problems with virtual-hyperscript
'use strict';
var hg = require('mercury')
var h = hg.h
var ESCAPE = 27
function AutoCompleteInput(initial, getChoices) {
initial = initial || ''
@danielnaab
danielnaab / gist:8857007
Last active August 29, 2015 13:56
Scrapy field that marshalls to Python objects
from decimal import Decimal
from dateutil.parser import parse as parse_date
from scrapy.item import Item
class BaseItem(Item):
def __setitem__(self, key, value):
if key in self.fields and 'to_python' in self.fields[key]:
value = self.fields[key]['to_python'](value)