Skip to content

Instantly share code, notes, and snippets.

View Kroisse's full-sized avatar

Eunchong Yu Kroisse

View GitHub Profile
@Kroisse
Kroisse / ks.rs
Last active August 29, 2015 13:57
// #[feature(globs)];
extern crate collections;
// use std::iter::*;
use std::from_str::from_str;
// use std::str::from_utf8;
// use collections::hashmap::HashSet;
#[deriving(Clone)]
struct Knapsack {
score: uint,
@Kroisse
Kroisse / pool.py
Last active December 17, 2015 17:39 — forked from eungju/pool.py
class KyotoTycoon(object):
...
def get(self, key):
with self.pool.acquire() as c:
return c.get(key, db=self.db)
# example #2
def set(self, key, value):
conn = self.pool.acquire()
with conn:
@Kroisse
Kroisse / .gitignore
Last active December 15, 2015 23:59 — forked from yoloseem/htmlfill.py
__pycache__/
*.pyc
@Kroisse
Kroisse / loop.py
Last active December 15, 2015 13:39
import eventlet
eventlet.monkey_patch()
import time
import flask
def a(i):
# shsh~~!
return '<p>{0}</p>'.format(i)
@Kroisse
Kroisse / gist:1441484
Created December 7, 2011 04:37 — forked from longfin/gist:1441283
Class Factory??
tag_types = ['location', 'category']
class Tag(db.Model, BaseEntityMixIn,
IgnoreDeletionMixIn):
__tablename__ = "tag"
name = db.Column(db.Unicode(255), index=True)
type = db.Column(db.Enum(*tag_types, native_enum=False), index=True)
__mapper_args__ = {'polymorphic_on': type}