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
| (ns pallet.crate.lein | |
| (:require [pallet.action.remote-file :as remote-file])) | |
| (def default-install-path "/usr/local/bin") | |
| (def script-url "https://raw.github.com/technomancy/leiningen/stable/bin/lein") | |
| (defn- install-script | |
| [session install-path] | |
| (-> session | |
| (remote-file/remote-file |
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
| export search="Find string" | |
| export replace="Replace string" | |
| grep -l -R $search app spec lib | xargs sed -i -e "s/$search/$replace/g" | |
| find . -name "*-e" | xargs rm |
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" | |
| "math" | |
| ) | |
| func newtAppx(x float64, appx float64) float64 { | |
| return appx - ((math.Pow(appx, 2.0) - x) / (2 * appx)) | |
| } |
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 ( | |
| "code.google.com/p/go-tour/wc" | |
| "strings" | |
| ) | |
| func WordCount(s string) map[string]int { | |
| counts := make(map[string]int) | |
| splitStrings := strings.Split(s, " ") |
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 "code.google.com/p/go-tour/pic" | |
| func imageFun(x, y int) uint8 { | |
| return uint8(x) ^ uint8(y) | |
| } | |
| func Pic(dx, dy int) [][]uint8 { | |
| image := make([][]uint8, dx) |
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" | |
| // fibonacci is a function that returns | |
| // a function that returns an int. | |
| func fibonacci() func() int { | |
| a := 0 | |
| b := 1 | |
| f := func() int { |
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 ( | |
| "net/http" | |
| "log" | |
| "io/ioutil" | |
| "fmt" | |
| ) | |
| func main() { |
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
| USERNAME [a-zA-Z0-9_-]+ | |
| USER %{USERNAME} | |
| INT (?:[+-]?(?:[0-9]+)) | |
| BASE10NUM (?<![0-9.+-])(?>[+-]?(?:(?:[0-9]+(?:\.[0-9]+)?)|(?:\.[0-9]+))) | |
| NUMBER (?:%{BASE10NUM}) | |
| BASE16NUM (?<![0-9A-Fa-f])(?:[+-]?(?:0x)?(?:[0-9A-Fa-f]+)) | |
| BASE16FLOAT \b(?<![0-9A-Fa-f.])(?:[+-]?(?:0x)?(?:(?:[0-9A-Fa-f]+(?:\.[0-9A-Fa-f]*)?)|(?:\.[0-9A-Fa-f]+)))\b | |
| POSINT \b(?:[0-9]+)\b | |
| WORD \b\w+\b |
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
| [root@host bsmith]# traffic_line -r proxy.config.cache.ram_cache.size | |
| 32212254720 | |
| [root@host bsmith]# traffic_line -r proxy.process.cache.bytes_total | |
| 0 | |
| [root@host bsmith]# traffic_shell | |
| Successfully Initialized MgmtAPI in /var/trafficserver/trafficserver | |
| % trafficserver> show:cache-stats | |
| Bytes Used --- 0 GB | |
| Cache Size --- 0 GB |
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 ( | |
| "bytes" | |
| "code.google.com/p/go.net/websocket" | |
| "crypto/sha1" | |
| "fmt" | |
| "image/gif" | |
| "image/png" | |
| "io" |