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
@dahlia
dahlia / thoughts.rst
Last active August 29, 2015 14:00
WANTED LIBRARY

Wanted library

Problems I've spent much time to solve:

  • Web servers. More exactly, API servers that communicate through HTTP.
  • Choosing the right status codes for the situations.
@dahlia
dahlia / keybase.md
Created April 20, 2014 09:12
Hong Minhee’s Keybase proof

Keybase proof

I hereby claim:

  • I am dahlia on github.
  • I am hongminhee (https://keybase.io/hongminhee) on keybase.
  • I have a public key whose fingerprint is 374B 15AF 3237 96A6 2AB1 BCE3 C429 ECD5 7EED 6CCA

To claim this, I am signing this object:

@dahlia
dahlia / .gitignore
Last active August 29, 2015 14:02
Interactively clean up unreachable subscriptions.
*.pyc
.*.swp
.env
@dahlia
dahlia / gist:b59b20083782d90833b8
Created June 10, 2014 18:58
libearth parser refactoring idea
import emails.utils
from ..compat import string_type
from ..feed import Entry, Feed, Person, Text
from .base import parser
parse_rss = parser()
@dahlia
dahlia / .gitignore
Last active August 29, 2015 14:07
Export Earth Reader subscription list to HTML
.*.swp
*.html
*.pyc
@dahlia
dahlia / .bash_profile
Created December 9, 2014 19:18
Autoactivate virtualenv
if [[ "$PWD" == "$PROJECT_HOME"* ]]; then
for project in "$WORKON_HOME/"*/; do
if [[ "$(cat $project/.project)" == "$PWD" ]]; then
source "$project"bin/activate
break
fi
done
fi
@dahlia
dahlia / libearth-rewrite.md
Last active August 29, 2015 14:14
RFC: Rewriting libearth

Rewriting libearth

I've recently thought about rewriting libearth in another language. I am considering C#. Why not Python? Why C#?

  • Python is not that good at making native-looking GUIs, in particular, mobile apps. We have to make huge glue codes to bind Python to Objective-C/Java. It takes more effort than making libearth from scratch.
@dahlia
dahlia / conftest.py
Created March 28, 2015 06:38
py.test + ngrok (localtunnel)
import contextlib
import distutils.spawn
import functools
import re
import signal
import subprocess
from pytest import fixture, skip
@dahlia
dahlia / xmlbuild.php
Created March 25, 2010 06:09
xmlbuild.php
<?php
class XmlBuilder {
function __call($tag, array $contents) {
$content = '';
foreach ($contents as $c) {
if ($c instanceof XmlBuilder_Element) {
$content .= $c;
} else if (is_array($c)) {
$attrs = array_merge($array, $c);

List comprehension

Map

The following code generates times-table:

times-table := [x * y, x: 2 ~ 9, y: 1 ~ 9]

The code is equivalent to: