This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# -*- coding: utf-8 -*- | |
import re | |
r = re.compile('((\d)\\2*)') | |
s = '1' | |
print s | |
for _ in range(50): | |
s = ''.join([''.join([str(len(m[0])), m[0][0]]) for m in r.findall(s)]) | |
print s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Bean | |
MENUS = [25, 50, 99, 210, 310, 170, 270, 590, 430, 620, 360, 450, | |
420, 320, 677, 308, 210, 536, 364, 466, 675, 572, 820, 959, 861, | |
1060, 1200, 260, 483].sort | |
attr_accessor :remain, :menus | |
def initialize(num) | |
if num.is_a?(Bean) | |
@remain = num.remain |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 아래 코드를 복사해 북마크에 등록하세요 | |
// 북마크의 제목은 적당히 정하시고 아래 코드는 주소 부분에 붙여 넣으시기 바랍니다. | |
javascript:(function() {var d=document;var s=d.createElement('script');s.setAttribute('src','https://raw.github.com/gist/3203853/clean-me2day-wiki.js');d.getElementsByTagName('head')[0].appendChild(s);})() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
사파리 6에서 기본 폰트 설정이 없어짐. 대신 Preferences > Advanced > Style sheet 옵션을 | |
통해 CSS를 지정하여 기본 폰트를 지정할 수 있음. 다음은 기본 폰트를 다음 나눔고딕(OTF)로 지정하고 | |
입반적으로 사용되는 폰트명에 대해 alias 설정 한다. | |
*/ | |
/* 기본 폰트를 나눔고딕으로 지정 */ | |
body { font-family: NanumGothicOTF; } | |
/* Font alias 설정 */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:window.open("<미니채팅 주소>", "", "width=300,height=400,toolbar=0,menubar=0,scrollbars=1"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
공용 API 응답 형식 | |
----------------- | |
* metadata를 위한 별도 필드는 정하지 않음 | |
* result는 반드시 해시 | |
* 'status' 가 에러인 경우 더 자세한 에러 정보는 'result' 필드에 지정 | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
page = new WebPage() | |
url = 'http://search.naver.com/search.naver?where=nexearch&query=tv%ED%8E%B8%EC%84%B1%ED%91%9C&x=0&y=0&sm=top_sug.pre&fbm=0&acr=1&acq=TV&qdt=0&ie=utf8' | |
page.open url, (status) -> | |
if (status != "success") | |
console.log "invalid response: #{status}" | |
phantom.exit() | |
page.clipRect = { top: 340, left: 180, width: 590, height: 400 } | |
page.render('tv.png') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export PS1="\[\033[34m\]\w\[\033[35m\]\`ruby -e \"print (%x{git branch 2> /dev/null}.split(/\n/).grep(/^\*/).first || '').gsub(/^\* (.+)$/, '(\1)')\"\`\[\033[00m\]> " |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ "keys": ["super+ctrl+left"], "command": "next_view_in_stack" }, | |
{ "keys": ["super+ctrl+right"], "command": "prev_view_in_stack" } | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Original | |
def hello | |
puts "Original" | |
end | |
end | |
module FeatureA | |
def self.included(base) | |
base.class_eval do | |
alias_method_chain :hello, :feature_a |