I hereby claim:
- I am clee704 on github.
- I am choongmin (https://keybase.io/choongmin) on keybase.
- I have a public key whose fingerprint is BCDF 9A00 2376 BF71 257A 21AE 1884 CDAA F39E 8F3F
To claim this, I am signing this object:
| #! /usr/bin/env python | |
| from datetime import datetime | |
| from StringIO import StringIO | |
| import getpass, os, re, subprocess, sys | |
| import MySQLdb | |
| def main(): | |
| if len(sys.argv) != 3: |
| # encoding: UTF-8 | |
| # Original article: http://dailyupgrade.me/post/6806676778/rubyonrails-full-messages-for-korean | |
| # Modified to support more postpositions and client_side_validations gem. | |
| # | |
| # Add Korean translations like this: | |
| # ko: | |
| # errors: | |
| # format: "%{message}" | |
| # messages: | |
| # blank: "%{attribute}((이)) 입력되지 않았습니다" |
| // Stolen from http://stackoverflow.com/a/841121/332370 | |
| // Modified so that: | |
| // 1. `end' can be omitted (defaults to the same value as `start'). | |
| // 2. -1 means the end of the range. | |
| $.fn.selectRange = function(start, end) { | |
| return this.each(function() { | |
| if (typeof end == "undefined") { | |
| end = start; | |
| } |
| # Parse CSS URI values according to http://www.w3.org/TR/CSS21/syndata.html#uri | |
| URI_PATTERN = / | |
| url\( # 'url(' | |
| [ \t\n\r\f]* # optional white space | |
| ( | |
| # double quoted URI | |
| ( | |
| (?<quote>") # an optional double quote | |
| (?<str>([^"\\]|\\.)*?) # URI | |
| " |
| #! /usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| # Copyright 2014 Choongmin Lee | |
| # Licensed under the MIT License | |
| import argparse | |
| from random import SystemRandom | |
| import sys | |
| parser = argparse.ArgumentParser(description='Generate or test prime numbers.') |
| #! /usr/bin/env python | |
| # Copyright 2014 Choongmin Lee | |
| # Licensed under the MIT License | |
| from __future__ import print_function | |
| import argparse | |
| from datetime import datetime | |
| import os | |
| import re | |
| import sys | |
| from tempfile import NamedTemporaryFile |
| // Makes the element be vertically centered in its parent. | |
| angular.module('mygists', []) | |
| .directive('verticalCenter', function ($window, $timeout) { | |
| var win = angular.element($window); | |
| function reposition(element, firstTime) { | |
| var parent = element.parent(); | |
| var parentHeight = parent.innerHeight(); | |
| var elementHeight = element.outerHeight(); | |
| var top = (parentHeight - elementHeight) / 2; |
| #! /usr/bin/env python3 | |
| # Solution to http://domino.research.ibm.com/Comm/wwwr_ponder.nsf/Challenges/August2009.html | |
| import string | |
| import sys | |
| def main(): | |
| a = Expression('a', int('00001111', 2)) | |
| b = Expression('b', int('00110011', 2)) | |
| c = Expression('c', int('01010101', 2)) |
I hereby claim:
To claim this, I am signing this object:
| #! /usr/bin/env python | |
| # Randomly flip bits in the file. | |
| import argparse | |
| import random | |
| parser = argparse.ArgumentParser() | |
| parser.add_argument('file', help='the file whose bits to be fliped') | |
| parser.add_argument('count', type=int, default=1, nargs='?', help='number of rounds of bit flipping (default: 1)') | |
| args = parser.parse_args() |