Skip to content

Instantly share code, notes, and snippets.

View Kroisse's full-sized avatar

Eunchong Yu Kroisse

View GitHub Profile
#include <stdio.h>
#include <konami.h> //구곡해금함수
int 구곡[] = { /* 생략함다... */ };
void 구곡해금();
int main() {
/*구곡해금 조건문은 생략. 상상에 맡김미당 ㅈㅅ*/
구곡해금();
return 0;
@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}
from flask import *
class Recorder(object):
def __init__(self):
self._record = []
def __getattr__(self, name):
def method(*args, **kwargs):
if not kwargs and len(args) == 1 and callable(args[0]):
def r(target):
@Kroisse
Kroisse / model.py
Created June 18, 2012 08:03
Delaying argument evaluation in SQLAlchemy, to avoid circular references
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
class Widget(Base):
__tablename__ = 'widgets'
id = Column(types.BigInteger, primary_key=True)
@Kroisse
Kroisse / <console>
Created June 18, 2012 08:47
PyPy fails on formatting bool
Python 2.7.2 (0e28b379d8b3, Feb 09 2012, 18:31:14)
[PyPy 1.8.0 with GCC 4.2.1] on darwin
Type "help", "copyright", "credits" or "license" for more information.
And now for something completely different: ``PyPy is vast, and contains
multitudes''
>>>> print True
True
>>>> print '{0}'.format(True)
1
>>>> print '%s' % True
@Kroisse
Kroisse / autocommit.py
Created September 27, 2012 15:12
(autoflush=True, autocommit=True) considered harmful
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
from sqlalchemy import types
from sqlalchemy.schema import Column
from sqlalchemy import create_engine
Base = declarative_base()
class Widget(Base):
@Kroisse
Kroisse / EXAMPLE.md
Last active December 11, 2015 02:18
Don't use any relative paths in your settings.py
$ django-admin.py startproject temp
$ cd temp
temp$ ls
manage.py* temp/
temp$ python manage.py startapp basic
temp$ vi basic/views.py 
temp$ mkdir templates
temp$ vi templates/home.html
temp$ vi temp/settings.py 
>>> from module import class1
>>> # edit and save module.py
>>> import module
>>> class1 = reload(module).class1
@Kroisse
Kroisse / manifest.json.diff
Last active December 14, 2015 02:08
Don't fight against the indentation rule
{
<<<<<<< HEAD
"name": "Github Star",
"version": "0.2.3.0",
"manifest_version": 2,
"description": "This extension displays the information(star, fork) from github project URL",
"icons": { "128": "icon.png" },
"content_scripts": [{