Skip to content

Instantly share code, notes, and snippets.

@pezon
pezon / handsontable-observedblclick.js
Last active March 30, 2018 06:34
Handsontable plugin - Observe dblClick event
function ObserveDblClick() {
var plugin = this;
// public methods
this.init = function() {
bindHeaders.call(this);
};
this.dblclickColHeader = function(col) {
Handsontable.hooks.run(this, 'dblclickColHeader', col);
@pezon
pezon / admin.py
Last active December 27, 2015 15:09
human write-able integer field for django admin. can also rip the individual dehumanize() function for standalone use.
from django import forms
from django.contrib import admin
from project.app.models import Foo
from project.app.forms import HumanIntegerField
class FooAdminForm(forms.ModelForm):
class Meta:
model = Foo
bar_field = HumanIntegerField()
@pezon
pezon / scrappy_command.py
Last active December 24, 2015 15:19
ScrapyCommand is a Django management command that fires multiple scrapy spiders, each with different settings and parameters, i.e., if they need to support different pipelines. These settings are defined by a settings dictionary in django's config settings. ScrapyCommand can be extended by other commands to support separate scraping jobs. When t…
from __future__ import absolute_import
from django.core.management.base import BaseCommand
from django.conf import settings as django_settings
from twisted.internet import reactor
from scrapy.crawler import Crawler
from scrapy.settings import CrawlerSettings
from scrapy import log, signals
from scrapy.xlib.pydispatch import dispatcher