Skip to content

Instantly share code, notes, and snippets.

View dahlia's full-sized avatar

Hong Minhee (洪 民憙) dahlia

View GitHub Profile
@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 / gpg-import-and-export-instructions.md
Created November 13, 2015 09:19 — forked from chrisroos/gpg-import-and-export-instructions.md
Instructions for exporting/importing (backup/restore) GPG keys

Every so often I have to restore my gpg keys and I'm never sure how best to do it. So, I've spent some time playing around with the various ways to export/import (backup/restore) keys.

Method 1

Backup the public and secret keyrings and trust database

cp ~/.gnupg/pubring.gpg /path/to/backups/
cp ~/.gnupg/secring.gpg /path/to/backups/
cp ~/.gnupg/trustdb.gpg /path/to/backups/

or, instead of backing up trustdb...

@dahlia
dahlia / wsgi_typing.py
Last active June 10, 2018 07:09
WSGI application object type specified using typing
import types
from typing import (Any, Callable, Iterable, Mapping,
Optional, Sequence, Tuple, Union)
__all__ = ('Environ', 'ExcInfo', 'ResponseStream', 'StartResponse',
'StartResponseCallable', 'StartResponseCallableWithExcInfo',
'WriteCallable', 'WsgiApplication')
# https://www.python.org/dev/peps/pep-3333/#the-write-callable
@dahlia
dahlia / authorized_keys
Created August 1, 2016 18:53
My public keys
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA0ql70Tsi8ToDGm+gkkRGv12Eb15QSgdVQeIFbasK+yHNITAOVHtbM3nlUTIxFh7sSga7UmEjCya0ljU0GJ+zvnFOxKvRypBoUY38W8XkR3f2IJQwbWE7/t4Vs4DViramrZr/wnQtRstLZRncIj307ApQuB18uedbtreGdg+cd75/KfTvDc3L17ZYlgdmJ+tTdzTi5mYbiPmtn631Qm8/OCBazwUSfidRlG1SN97QJdV5ZFLNN+3BRR7RIRzYZ/2KEJqiOI5nqi3TEiPeq49/LJElu4tdJ8icXT7COrGllnhBbpZdxRM26hhVXv62vOTQwXm1fumg0PgMACP2S1WVNw== [email protected]
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCsBuVzz1gcaeZlJftFKMh0DfqjFqQH42y1wf7p+xBxUhY0la9T9JMlqjiMPa/RgybVWhdKQX2IC6krBTYlmBBsVLNvfAXAu0ahI5lru3czZ3nTs7j07hICemjFprjJVSXdmZMJqE4UX8BUOWq8abNBtAUUrzxTBSPHOJHrDorN1kNDx/O1PteuJbnP/4uWNdKo6JJdtFjS3klAesIdyfY0WGvAFQcs3y5JwAQFolUEOnrecHZVxQDO+XpLjHD8Gd0Y4CByeJcnOdpkyNw5SEMCTQUop5nPkt8LQ7K+f+9Co90wC8KmpP7YlHn69knHPtCe/PqGDFxEnYt/SAcmUc63 [email protected]
ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBFcf+bq+f2Reas8gljgR4xWWCPH0cKXdVwo1v2xL3HUPLfN3c2U2jmDwHe4KtumHVgUv1WRz1HFSYuIe5hHrZbU= dahlia@shikinami
ecdsa-sha2-nist
@dahlia
dahlia / Naver_Search_OSID.user.js
Last active July 1, 2017 16:04
네이버 검색 OSID 표시기
// ==UserScript==
// @name Naver Search OSID
// @namespace https://gist.github.com/dahlia/0c9b43a72de292e2660af940ed4149ec
// @description 네이버 검색 OSID 표시기
// @include https://search.naver.com/*
// @include http://search.naver.com/*
// @include http://http://people.search.naver.com/*
// @include https://http://people.search.naver.com/*
// @version 1
// @grant none
@dahlia
dahlia / README.md
Last active December 10, 2018 01:23
Redirect to Canonical Postgres Docs

Redirect to Canonical Postgres Docs

This userscript makes you to always see the canonical ("current") version of PostgreSQL docs instead of the specific (usually outdated) version of that.

Install

Distributed under public domain.

@dahlia
dahlia / README.md
Last active May 7, 2020 16:00
Wikidata Entity ID on Wikipedia

Wikidata Entity ID on Wikipedia

Screenshot

This userscript makes Wikipedia pages to show their corresponding Wikidata entity ID and link to it in the gray parentheses next to the entry title.

Install