Skip to content

Instantly share code, notes, and snippets.

View dahlia's full-sized avatar
⚰️
Off work for the bereavement of my father

Hong Minhee (洪 民憙) dahlia

⚰️
Off work for the bereavement of my father
View GitHub Profile
@jweissbock
jweissbock / Jack-Hack VM.py
Created February 4, 2011 00:32
the VM to turn Jack VM into Hack ASM
import glob
# declare types of commands
C_ARITMETIC = object()
C_PUSH = object()
C_POP = object()
C_LABEL = object()
C_GOTO = object()
C_IF = object()
C_FUNCTION = object()
@jmblog
jmblog / 960gs.scss
Created May 18, 2011 06:57
960gs.scss
/*-----------------------------------------------------
960 Grid System ~ Core CSS.
Learn more ~ http://960.gs/
Licensed under GPL and MIT.
-------------------------------------------------------*/
/* Grid Settings
---------------------------*/
// 12-column grid
@mezis
mezis / git-merge-po.sh
Last active November 20, 2023 11:33
Git merge driver for PO files
#!/bin/sh
#
# *******************************************
# WARNING: this does *not* handle 3-way merges properly.
# Anything modified on the local branch since the common base will get ignored.
#
# FOR ANYONE LANDING HERE:
# This script is now updated as part of the git-whistles gem.
# https://github.com/mezis/git-whistles
# *******************************************
@mitsuhiko
mitsuhiko / flask-script-wtforms.py
Created March 19, 2012 14:54
flask-script with wtforms
import sys
from werkzeug.datastructures import ImmutableDict, MultiDict
from flask import request
from flaskext.script import Manager
from postfixmgmt import app, db, __version__
from postfixmgmt.forms import DomainAddForm
manager = Manager(app)
@NicolasT
NicolasT / monad.py
Created March 31, 2012 19:17
Generalized monad comprehensions in Python
import ast
app = lambda name, *args: \
ast.Call(
func=ast.Name(id=name, ctx=ast.Load(), lineno=0, col_offset=0),
args=list(args), keywords=[], vararg=None,
lineno=0, col_offset=0)
abs = lambda arg, body: \
@wolever
wolever / gevent_issues.md
Created May 28, 2012 18:24
Some issues we've encountered with gevent

Below are some issues we encountered during our first real deployment of gevent. It is being used on one host to communicate over ethernet (ie, using raw ethernet packets) with approximately 700 PIC32 microprocessors, and it is used for communication between all of the services we have built (approximately 15 unique services running on two hosts).

  • The majority of the issues we faced were caused by a particular service which communicates with a child process over stdin/stdout. Not all of the issues were gevent specific (for example, when the child wasn't properly selecting on stdout, the kernel was silently dropping data when its internal buffer filled up, even though fwrite reported that the data had been written).
  • We are using gevent-0.13.7 with libevent-2.0.x. I would like to be using gevent-1.0, but it was causing some issues (I don't recall exactly what they were) on OS X, so we rolled back to 0.13.7.
  • libevent-1.4.13-stable (packages with Debian stable 6.0.4) would, under moderate l
@ryin
ryin / tmux_local_install.sh
Last active April 23, 2024 01:06
bash script for installing tmux without root access
#!/bin/bash
# Script for installing tmux on systems where you don't have root access.
# tmux will be installed in $HOME/local/bin.
# It's assumed that wget and a C/C++ compiler are installed.
# exit on error
set -e
TMUX_VERSION=1.8
@dahlia
dahlia / cd_hook.sh
Created August 20, 2012 09:07
[virtualenvwrapper] automatic workon hook on cd
export PROJECTS_HOME="$HOME/Projects"
function has_virtualenv__() {
if [[ "$VIRTUAL_ENV" == "" ]]; then
if [[ $(dirname "`pwd`") == $PROJECTS_HOME ]]; then
venvname=$(basename "`pwd`")
if [[ -d "$WORKON_HOME/$venvname" ]]; then
workon "$venvname"
fi
fi
@euphoris
euphoris / cd_hook.sh
Created August 20, 2012 16:20 — forked from dahlia/cd_hook.sh
[virtualenvwrapper] automatic workon hook on cd
export PROJECTS_HOME="$HOME/Projects"
function has_virtualenv__() {
if [[ ${PWD##$PROJECTS_HOME} != $PWD ]]; then
IFS="/" read -ra ADDR <<< "${PWD##$PROJECTS_HOME}"
venvname=${ADDR[1]}
cur_env=${VIRTUAL_ENV##$WORKON_HOME}
if [[ $venvname != "" ]] && [[ -d "$WORKON_HOME/$venvname" ]]; then
if [[ ${cur_env:1} != $venvname ]]; then
workon "$venvname"

파이썬 웹개발 요리책

바로 실전에 적용할 수 있는 파이썬 웹 개발 레시피. 기초적인 파이썬 지식이 필요합니다.

파이썬 복습

앞으로 다룰 내용에서 알아둬야 할 파이썬 기능을 다시 한번 짚고 넘어갑니다. 이미 파이썬 고수라면 건너뛰셔도 좋습니다!

  • 모듈