This file contains hidden or 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
cat ~/.ssh/id_rsa.pub | ssh [email protected] "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys" |
This file contains hidden or 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
for (familyName) in UIFont.familyNames() { | |
print("\nFamily: ", familyName.utf8) | |
let fontNames = UIFont.fontNamesForFamilyName(familyName) | |
for (fontName) in fontNames { | |
print("\tFont: ", fontName.utf8) | |
} | |
} |
This file contains hidden or 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 | |
http -f POST http://www.twse.com.tw/ch/trading/exchange/FMNPTK/FMNPTKMAIN.php download=csv CO_ID=2103 > 2103.csv | |
iconv -f big5 -t utf-8 2103.csv > 2103-utf8.csv |
This file contains hidden or 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 | |
if curl -s -o /dev/null -I http://github.com; then | |
echo " 🐈 It's up. Go back to work!" | |
else | |
echo " 🦄 It's down. Go outside!" | |
fi |
This file contains hidden or 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
package main | |
import ( | |
"fmt" | |
"log" | |
"net/http" | |
"github.com/PuerkitoBio/goquery" | |
) |
This file contains hidden or 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 | |
set -e | |
URIS="""/ | |
/news | |
""" | |
HTTP_OK=0 | |
HTTP_TIMEOUT=0 |
This file contains hidden or 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 | |
usage () | |
{ | |
echo 'Usage :' | |
echo "\t$0 Text" | |
exit | |
} | |
if [ "$#" -ne 1 ] | |
then |
This file contains hidden or 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/bash | |
. /home/hanksudo/.virtualenvs/starthack/bin/activate | |
set -e | |
project_dir="$(cd "$(dirname "$0")/.."; pwd)" | |
cd "$project_dir" | |
exec starthack 1 2 |
This file contains hidden or 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
apt-get update | |
apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev libgdbm-dev ncurses-dev automake libtool bison subversion pkg-config libffi-dev vim -y | |
# install ruby | |
cd /tmp | |
wget https://ruby.taobao.org/mirrors/ruby/ruby-2.2.2.tar.gz | |
tar -zxvf ruby-*.tar.gz | |
cd ruby-* | |
./configure --prefix=/usr/local | |
make |
This file contains hidden or 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
import UIKit | |
class ViewController: UIViewController { | |
var timer = NSTimer() | |
var count = 0 | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
// Do any additional setup after loading the view, typically from a nib. |