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

Getting started with PureScript 0.7.x

also posted on http://kyagrd.tumblr.com/post/125748583024/getting-started-with-purescript-0710 Written based on PureScript 0.7.1.0 but shoould work with versions 0.7.0.0 and 0.7.2.0.

Some Triva about PureScript

PureScript is a purely functional language specifically targeting JavaScript as its backend. If you have tasted Haskell and lamenting about the current untyped mess in scripting languages, especially regarding web-programming, probabiy your only choice out there is PureScript.

PureScript is the only language with a sane approch to staticaly support duck typing on records by using Row Polymorphism.

@dupleix
dupleix / pyTunes.py
Created July 4, 2010 14:18
Synchronize an itunes playlist with any mp3 player
from appscript import *
import re, os
from shutil import copy
MY_PLAYLIST = u'walkman'
DEST = '/Volumes/WALKMAN/MUSIC'
iTunes = app('iTunes')
playlist = None
class PrototypeStore(dict):
def __setattr__(self, name, value):
self[name] = value
def __getattr__(self, name):
return self[name]
class PrototypeMeta(type):
def __new__(metacls, cls_name, bases, attrs):
cls = type.__new__(metacls, cls_name, bases, attrs)
@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)
@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
@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"

파이썬 웹개발 요리책

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

파이썬 복습

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

  • 모듈
@dahlia
dahlia / .gitignore
Created March 25, 2010 06:25
pager.py
*.pyc
.*.swp
MANIFEST
@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