Skip to content

Instantly share code, notes, and snippets.

View othree's full-sized avatar
:accessibility:
On the way to refactoring

othree othree

:accessibility:
On the way to refactoring
View GitHub Profile
# colorful man page
export PAGER="`which less` -s"
export BROWSER="$PAGER"
export LESS_TERMCAP_mb=$'\E[38;5;167m'
export LESS_TERMCAP_md=$'\E[38;5;39m'
export LESS_TERMCAP_me=$'\E[38;5;231m'
export LESS_TERMCAP_se=$'\E[38;5;231m'
export LESS_TERMCAP_so=$'\E[38;5;167m'
export LESS_TERMCAP_ue=$'\E[38;5;231m'
export LESS_TERMCAP_us=$'\E[38;5;167m'
@othree
othree / gist:634362
Created October 19, 2010 15:15
arguments to compile Vim
--disable-darwin
--enable-luainterp=yes
--enable-mzschemeinterp
--enable-perlinterp=yes
--enable-pythoninterp=yes
--enable-python3interp=yes
--enable-tclinterp
--enable-rubyinterp
--enable-multibyte
--with-features=huge
function HtmlReIndent()
silent %s/\(<\/\w\+\)>\s\?</\1>^M</eg
normal gg=G
endfunction
作者: greenoyster ( ) 看板: greenoyster
標題: Re: [再轉] 出處不明的程設考卷XD
時間: Fri Apr 22 01:38:53 2011
一、選擇題(皆為單選):
以下誰是二進位思想的最早提出者?
a)伏羲 b)姬昌 c)萊布尼茨 d)柏拉圖
@othree
othree / gist:1333179
Created November 2, 2011 08:29
Check Compression
function check_compression {
local unzipped=`curl "$1" --silent --write-out "%{size_download}" --output /dev/null`
local zipped=`curl -H "Accept-Encoding: gzip,deflate" "$1" --silent --write-out "%{size_download}" --output /dev/null`
echo "unzipped size: $unzipped, zipped size: $zipped"
}

開源之道

Original transcript: http://allisonrandal.com/2012/04/15/open-source-enlightenment/

這幾年來,我慢慢覺得,我們參與開源社群,就像是在一條道路上並肩而行:這不僅讓我們成為更好的程式設計者,也讓我們通過與人合作,而成為更好的人。

您可以將它想成一條修行之道,讓身而為人的我們能夠不斷成長。接下來,我想談談我對開源世界的個人觀點,希望能與您分享。

首先,人是一切開源專案的核心。程式碼是很重要,但最核心的永遠是人。

@othree
othree / coscup2012-day1-irc-log
Created August 20, 2012 07:35 — forked from afutseng/coscup2012-day1-irc-log
COSCUP 2012 Day1 irc log
--- Log opened Fri Aug 17 01:22:02 2012
01:22 -!- chph_ [afu@FreeBSD.stu.edu.tw] has joined #coscup
01:22 -!- Irssi: #coscup: Total of 44 nicks [0 ops, 0 halfops, 0 voices, 44 normal]
01:22 -!- Irssi: Join to #coscup was synced in 2 secs
01:22 -!- You're now known as chph
01:24 -!- test [3b7fcc66@gateway/web/freenode/ip.59.127.204.102] has quit [Quit: Page closed]
01:27 -!- Yuhsien [~Yuhsienle@staff.kkbox.com.tw] has quit [Quit: Lost terminal]
01:29 -!- FourDollars [~sylee@114-32-46-10.HINET-IP.hinet.net] has quit [Quit: leaving]
01:29 -!- webbertsai_ [722fde03@gateway/web/freenode/ip.114.47.222.3] has joined #coscup
01:31 -!- webbertsai [722fde03@gateway/web/freenode/ip.114.47.222.3] has quit [Ping timeout: 245 seconds]
@othree
othree / COSCUP-2012-Day2-irc-log
Created August 20, 2012 07:35 — forked from afutseng/COSCUP-2012-Day2-irc-log
COSCUP 2012 Day2 irc log
--- Day changed Sun Aug 19 2012
00:01 -!- Alisha [72262a5c@gateway/web/freenode/ip.114.38.42.92] has quit [Quit: Page closed]
00:02 -!- orinx|bof is now known as orinx|sleep
00:02 -!- play [~AndChat59@111-248-106-192.dynamic.hinet.net] has joined #coscup
00:02 -!- bobchao [~bobchao@202-169-164-141.aspublic.wlan.sinica.edu.tw] has joined #coscup
00:02 -!- mode/#coscup [+o bobchao] by ChanServ
00:03 -!- play [~AndChat59@111-248-106-192.dynamic.hinet.net] has quit [Client Quit]
00:03 -!- nemu [72180666@gateway/web/freenode/ip.114.24.6.102] has joined #coscup
00:04 -!- kevin6861 [3d46d92d@gateway/web/freenode/ip.61.70.217.45] has quit []
00:06 -!- kengyu [~Keng-Yu@42.71.190.169] has joined #coscup
(function (a) {
a.fn.extend({
xxMethod: function (options) {
return this.each(function () {
var b = a(this);
a(b).each(function () {
//blah...
});
});
}
@othree
othree / switchCase.vim
Created May 27, 2013 07:08
Switch between different case type: camelCase -> MixedCase -> snake_case -> UPPER_CASE -> dash-case -> camelCase
let g:switch_custom_definitions =
\ [
\ {
\ '\<\(\l\)\(\l\+\(\u\l\+\)\+\)\>': '\=toupper(submatch(1)) . submatch(2)',
\ '\<\(\u\l\+\)\(\u\l\+\)\+\>': "\\=tolower(substitute(submatch(0), '\\(\\l\\)\\(\\u\\)', '\\1_\\2', 'g'))",
\ '\<\(\l\+\)\(_\l\+\)\+\>': '\U\0',
\ '\<\(\u\+\)\(_\u\+\)\+\>': "\\=tolower(substitute(submatch(0), '_', '-', 'g'))",
\ '\<\(\l\+\)\(-\l\+\)\+\>': "\\=substitute(submatch(0), '-\\(\\l\\)', '\\u\\1', 'g')",
\ }
\ ]