Skip to content

Instantly share code, notes, and snippets.

class GeocoderPipeline(object):
namespaces = {'gml': 'http://www.opengis.net/gml',
'ymaps': 'http://maps.yandex.ru/ymaps/1.x',
'geocoder': 'http://maps.yandex.ru/geocoder/1.x'}
@classmethod
def from_crawler(cls, crawler):
try:
pipe = cls.from_settings(crawler.settings)
except AttributeError:
// ==UserScript==
// @name Redminy story counter
// @version 0.2.2
// @description try to take over the world!
// @author Vladislav Polukhin <[email protected]>
// @match http://redmine.24auto.ru/*
// @grant none
// ==/UserScript==
function mceil(number, roundto){
// ==UserScript==
// @name Digitally Imported
// @version 0.1.2
// @description Не дает проигрывателю заткнуться
// @author Vladislav Polukhin <[email protected]>
// @match *://www.di.fm/*
// @grant none
// ==/UserScript==
/* jshint -W097 */
'use strict';
@nuklea
nuklea / dynamic-query.sql
Last active August 29, 2015 14:23
Dynamic table name in query
DO $$
DECLARE
r record;
BEGIN
FOR r IN SELECT tablename FROM pg_catalog.pg_tables WHERE tablename LIKE 'schema_%%' LOOP
EXECUTE 'UPDATE ' || quote_ident(r.tablename) || ' SET host_added = ''54auto.ru'' WHERE host_added = ''54.ruauto.ru''';
END LOOP;
END $$ LANGUAGE plpgsql;
@nuklea
nuklea / 20custom-hcd.sh
Created June 15, 2012 11:52
Script for corrent unbind usb devices before suspend
#!/bin/sh
# Put this file into /etc/pm/sleep.d and don't forget
# `chmod +x to /etc/pm/sleep.d/20custom-hcd.sh'
# See http://ubuntuforums.org/showpost.php?p=11534892&postcount=88
TMPLIST=/tmp/hdc-dev-list
case "${1}" in
hibernate|suspend)