Skip to content

Instantly share code, notes, and snippets.

function LiveWatcher(watch_posts, watch_users) {
var self = this;
var _oldListener;
function newListener(d) {
var el = document.createElement('div');
el.innerHTML = JSON.parse(d.data).data;
var post_id = parseInt(el.childNodes[0].getAttribute("data-post_id"));
var user_login = el.childNodes[0].getAttribute("data-user_login");
# Recreational computational human bananology.
# Copyright (c) 2015, Konstantin Tretyakov
# http://fouryears.eu/2015/04/12/two-bananas-make-a-human/
# ------------------------ Imports and utility functions ---------------- #
import gzip
import csv
import urllib
from ucscgenome import Genome
from Bio import SeqIO
@konstantint
konstantint / spawn.cpp
Created November 14, 2014 17:28
Example of communication with a subprocess via stdin/stdout
//
// Example of communication with a subprocess via stdin/stdout
// Author: Konstantin Tretyakov
// License: MIT
//
#include <ext/stdio_filebuf.h> // NB: Specific to libstdc++
#include <sys/wait.h>
#include <unistd.h>
#include <iostream>
@konstantint
konstantint / gist:3952876
Created October 25, 2012 14:31
Python: UTF-8 encoding specifier
# -*- coding: utf-8 -*-
@konstantint
konstantint / gist:3914476
Created October 18, 2012 20:08
Buildout: Boilerplate buildout.cfg
[buildout]
# Egg names
project-eggs =
# my-module
# Egg directories
#develop =
# my-module
# Build parts (add develop eggs if needed)
@konstantint
konstantint / gist:3911953
Created October 18, 2012 13:50
Python: Namespace package __init__.py
# Namespace package
try:
__import__('pkg_resources').declare_namespace(__name__)
except ImportError:
__path__ = __import__('pkgutil').extend_path(__path__, __name__)