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
; to search and replace all origin_words from current document. | |
; 1,$ stands for from first line to last line. | |
:1,$ s/origin_word/replace_word/g |
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
view_csv () { column -s , -t < "$1" | less -#2 -N -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
var fs = require('fs'); | |
var pdf = require('html-pdf'); | |
var args = process.argv; | |
var htmlfile = args[2]; | |
var pdffile = args[3]; | |
if(htmlfile === undefined || pdffile === undefined) { | |
console.error('You must supply a html filename, and then a PDF filename.'); | |
process.exit(); |
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
1. rsruby gem install | |
=> gem install rsruby -- --with-R-home=/usr/lib/R --with-R-include=/usr/share/R/include #Linux | |
=> gem install rsruby -- --with-R-include=/usr/share/R/include --with_cflags="-fPIC -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wall -fno-strict-aliasing" #Linux | |
=> gem install rsruby -- --with-R-dir=$R_HOME --with-R-include=$R_HOME/include --with-R-lib=$R_HOME/lib # All platform |
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
# Change Prompt | |
# ------------------------------------------------------------ | |
export PS1="\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h:\[\033[33;1m\]\w\[\033[m\]\$ " | |
PS1+='${debian_chroot:+($debian_chroot)}' | |
PS1+='\[\033[01;34m\]$(__git_ps1)\[\033[00m\]' | |
# don't put duplicate lines in the history. See bash(1) for more options | |
# ... or force ignoredups and ignorespace | |
HISTCONTROL=ignoredups:ignorespace |
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
require 'rubygems' | |
require 'json' | |
require 'open-uri' | |
start_at = 20000 | |
end_at = JSON.load(open("http://www.dcard.tw/api/forum/all/1/"))[0]["id"] | |
gender = [] | |
(start_at..end_at).each do |i| | |
begin |
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
require 'rubygems' | |
require 'json' | |
require 'open-uri' | |
module Counter | |
def self.go! | |
count() | |
end | |
def self.count | |
gender = [] |
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
# two line prompt (show git branch) | |
PS1='\n\[\033[01;30m\]┌[\[\033[00m\]' | |
PS1+='${debian_chroot:+($debian_chroot)}' | |
PS1+='\[\033[01;32m\]\u\[\033[00m\]@\h' | |
PS1+='\[\033[01;30m\]]\[\033[00m\]:' | |
PS1+='\[\033[01;33m\]\w\[\033[00m\]' | |
PS1+='\[\033[01;34m\]$(__git_ps1)\[\033[00m\]' | |
PS1+='\n\[\033[01;30m\]└─\[\033[00m\]\$ ' | |
# For colourful man pages (CLUG-Wiki style) |