This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python2.7 | |
import cProfile | |
import pstats | |
import StringIO | |
import logging | |
import os | |
import time | |
PROFILE_LIMIT = int(os.environ.get("PROFILE_LIMIT", 30)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PubSub(object): | |
""" | |
Very simple Pub/Sub pattern wrapper | |
using simplified Redis Pub/Sub functionality. | |
Usage (publisher):: | |
import redis | |
r = redis.Redis() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import argparse | |
import json | |
import sys | |
import StringIO | |
import couchdb | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import networkx as nx | |
import matplotlib.pyplot as plt | |
from arango import create | |
from arango.aql import F, V | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import requests | |
from arango import create | |
from bs4 import BeautifulSoup | |
HEADERS = { | |
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5)", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from py2neo import neo4j, node | |
graph_db = neo4j.GraphDatabaseService( | |
"http://localhost:7474/db/data/") | |
alice, bob, carol = node(name="Alice"), \ | |
node(name="Bob"), \ | |
node(name="Carol") | |
abc = neo4j.Path( | |
alice, "KNOWS", bob, "KNOWS", carol) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from arango import create | |
from arango.aql import F, V | |
def dataset(): | |
""" | |
Basic dataset | |
""" | |
a.database.create() | |
a.users.create() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// service to display *bootstrap modal* popups | |
// - `display` method return **promise** which | |
// contain `resolve` or `cancel` handlers (eq buttons) | |
common.service('confirmService', ["$q", function($q) { | |
var that = this; | |
var deferred = null; | |
// default state for the modal | |
this.state = { | |
message: null, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FILES := $(shell find . | grep '\.coffee$$') | |
TARGETS := $(patsubst %.coffee, %.js, $(FILES)) | |
cleanup: | |
@echo $(FILES) to cleanup | |
@echo perl -i.bak -ne 'print if /\S/' $(FILES) | |
build: $(TARGETS) | |
%.js: %.coffee |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function (g) { | |
var VERSION = "0.1.1"; | |
var PREFIX = "___scope_cleaner__"; | |
// check is some variable is array or not | |
var isArray = function (obj) { | |
return obj.constructor === Array; | |
}; | |
// wrapper on Array.indexOf for old browser |
NewerOlder