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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8" /> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script> | |
<script> | |
if (window.MozWebSocket) { | |
window.WebSocket = window.MozWebSocket;; | |
} |
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
package main | |
import ( | |
"database/sql" | |
"fmt" | |
_ "github.com/ziutek/mymysql/godrv" | |
) | |
func OpenDB() *sql.DB { | |
db, err := sql.Open("mymysql", fmt.Sprintf("tcp:%s*%s/%s/%s", DB_HOST, DB_NAME, DB_USER, DB_PASS)) |
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
package main | |
import ( | |
"fmt" | |
"sort" | |
) | |
type Student struct { | |
Name string | |
Height, Weight int |
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
## FastCGI | |
server { | |
location ~ /app.* { | |
fastcgi_pass 127.0.0.1:9000; | |
include fastcgi_params; | |
} | |
} | |
## Reverse Proxy (이 방식으로 하면 http.ListenAndServe로 해야함) | |
server { |
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
package main | |
import ( | |
"flag" | |
"fmt" | |
"io/ioutil" | |
"net/smtp" | |
"os" | |
) |
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
// $ echo Hello | go run echo.go | |
package main | |
import ( | |
"fmt" | |
"io" | |
"os" | |
) |
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
// サンタクロース問題 | |
// http://karetta.jp/article/blog/oneline/030756 | |
package main | |
import ( | |
"fmt" | |
"math/rand" | |
"reflect" | |
"time" | |
) |
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/bash | |
CRONTAB='/etc/crontab' | |
CRONDIR='/etc/cron.d' | |
tab=$(echo -en "\t") | |
function clean_cron_lines() { | |
while read line ; do | |
echo "${line}" | |