Skip to content

Instantly share code, notes, and snippets.

View vtemian's full-sized avatar
🚀
-

Vlad Temian vtemian

🚀
-
View GitHub Profile
/**
* From a file that contains
* doc_id w1 w2 w3 ... lines, separated by tabs
* return an inverted index Map of w -> Set(doc_id)
*
* @param filename well isn't it obvious
* @return Map[String,Set[String]]
*/
import scala.collection.immutable.Map
@vtemian
vtemian / logging.py
Created May 2, 2014 15:00
logging flask
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'filters': {},
'formatters': {
'syslog': {
'format': '%(asctime)s ' + HOSTNAME_SHORT +
' %(name)s: %(levelname)s: %(message)s',
'datefmt': '%b %d %H:%M:%S',
}
@vtemian
vtemian / flask.py
Last active August 29, 2015 14:02 — forked from horiajurcut/flask.py
import json
from functools import wraps
from flask import request
from utils.exceptions import HttpNotFound
from utils.validators import Required
def require(f):
@wraps(f)
import pydocumentdb.document_client as document_client
host = 'https://doc01.documents.azure.com'
masterKey = 'PhA7+FAD9uHw+McP/sM4CFZA4dUnOrzmgnk0J+SEcvOC5ac7UYNu/EHvOEBcOpEtj6Vz/YESDoxxxsnoaLDCGg=='
client = document_client.DocumentClient(host, {'masterKey': masterKey})
databases = client.ReadDatabases()
db = [db for db in databases if db['id'] == 'uvt01'][0]
configfile = '~/config.py'
import os
import sys
sys.path.append(os.path.dirname(os.path.expanduser(configfile)))
import config
import pydocumentdb.document_client as document_client
host = 'https://doc01.documents.azure.com'
masterKey = 'PhA7+FAD9uHw+McP/sM4CFZA4dUnOrzmgnk0J+SEcvOC5ac7UYNu/EHvOEBcOpEtj6Vz/YESDoxxxsnoaLDCGg=='
client = document_client.DocumentClient(host, {'masterKey': masterKey})
databases = client.ReadDatabases()
db = [db for db in databases if db['id'] == 'uvt01'][0]
### Keybase proof
I hereby claim:
* I am vtemian on github.
* I am vtemian (https://keybase.io/vtemian) on keybase.
* I have a public key whose fingerprint is DA32 CAC3 056F 9659 99DF 05F6 DF51 99B0 5A31 0386
To claim this, I am signing this object:
### Keybase proof
I hereby claim:
* I am vtemian on github.
* I am vtemian (https://keybase.io/vtemian) on keybase.
* I have a public key whose fingerprint is DA32 CAC3 056F 9659 99DF 05F6 DF51 99B0 5A31 0386
To claim this, I am signing this object:
<html>
<head>
<script src="http://code.jquery.com/jquery-1.11.2.js"></script>
</head>
<script>
$.get("https://api.github.com/repos/vmg/redcarpet/issues?state=closed", function(data) {
for(i in data){
console.log(data[i])
}
})
@vtemian
vtemian / mutable.py
Created May 4, 2015 15:53
simple mutable
def foobar(arg_string="abc", arg_list=[]):
print arg_string, arg_list
arg_string = arg_string + "xyz"
arg_list.append("F")
for i in range(4):
foobar()