- [knockout.js] (http://knockoutjs.com/)
- [wijmo] (http://wijmo.com/)
- [bootstrap] (http://twitter.github.io/bootstrap/)
- [jquery] (http://jquery.com/)
- [jquery UI] (http://jqueryui.com/)
- [zepto.js] (http://zeptojs.com/)
- [lorem.js] (https://github.com/shyiko/lorem)
- [sammy.js] (http://sammyjs.org)
- [jquery shuffle] (http://yelotofu.com/labs/jquery/snippets/shuffle/)
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
#!/bin/sh | |
# simple script to generate random chines names from richyli's website. | |
if [ "$#" -eq 0 ]; then | |
COUNT=3 | |
else | |
COUNT=$1 | |
fi | |
curl -s -d name_count=$COUNT\&break=2 http://www.richyli.com/name/index.asp | piconv -f big5 -t utf8 | sed -n 88p | awk -F', #' '{print $1}' | sed -e 's/ //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
# encoding: utf-8 | |
require 'ostruct' | |
require 'hpricot' | |
require 'hpricot_scrub' | |
require 'open-uri' | |
require 'curb' | |
require 'uri' | |
class Page | |
attr_reader :doc |
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
# encoding: UTF-8 | |
# example records | |
#id|odate|opentime|m|n|e|start|end | |
#12|2012-01-12|8:00~23:00|0|0|0|0|0 | |
#13|2012-01-13|學期考結束Final Exams end 8:00~23:00|0|0|0|0|0 | |
#14|2012-01-14|選舉Election Day 休館一天Closed|0|0|0|0|0 | |
#15|2012-01-15|9:00~17:00|0|0|0|0|0 | |
#16|2012-01-16|寒假開始Winter Vacation begins 8:00~21:00|0|0|0|0|0 | |
def change_mne(open) |
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
# get count number from html file | |
require 'hpricot' | |
doc=Hpricot(open('online.txt')) | |
>> doc.search("tr").size | |
=> 61 | |
>> doc.search("tr")[0].at('td').innerText | |
=> "online people : 50" | |
msg = doc.search("tr")[0].at('td').innerText | |
count = msg.split(':')[1].strip |
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
# -*- encoding: utf-8 -*- | |
# detail at http://ithelp.ithome.com.tw/question/10103736 | |
require 'sinatra' | |
require 'net/http' | |
require 'open-uri' | |
require 'json' | |
require 'yaml' | |
get '/' do | |
"Hi, 鐵人五<br /><a href='/env'>環境變數</a>" |
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
# _*_ encoding: utf-8 _*_ | |
# parse nations rank in http://ngam.natixis.com/docs/12/1010/Global_Retirement_Index,0.pdf | |
line=File.readlines('./rank.txt').map(&:chomp)[0] | |
hash = {} | |
@index = 1 | |
line.split(/(\d+)/).each do |x,i| | |
unless x.to_i.zero? | |
@index = x.to_i | |
else | |
hash[@index] = x |
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
# create systemd service file for rails 2.3.x startup | |
[Unit] | |
Description=rails 2.3.x web server | |
[Service] | |
Type=simple | |
RemainAfterExit=yes | |
User=username | |
PIDFile=/home/username/WEBSERVER/tmp/pids/thin.pid | |
WorkingDirectory=/home/username/WEBSERVER |
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
# crontab for schedule to play music | |
39 * * * * /usr/sbin/ntpdate -s ntp.ntu.edu.tw > /dev/null 2>&1 | |
0 10 * * 1-5 /usr/bin/mpg321 --list /home/user/M/ten.txt | |
0 12 * * 1-5 /usr/bin/mpg321 -g 40 --list /home/user/M/noon.txt | |
0 13 * * 1-5 /usr/bin/mpg321 --list /home/user/M/wakeup.txt | |
0 15 * * 1-5 /usr/bin/mpg321 --list /home/user/M/teatime.txt |
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
alias ls='ls --color=auto' | |
alias v='ls -l' | |
alias lh='ls -lh' | |
alias dh='df -h' | |
alias ll='ls -al' | |
alias irb='irb --simple-prompt' | |
alias ltips='less $HOME/tips.txt' | |
alias path='echo $PATH | sed -e "s/:/\n/g"' | |
# old linux server |
OlderNewer