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 ( | |
| "flag" | |
| "fmt" | |
| "go/ast" | |
| "go/parser" | |
| "go/token" | |
| "io/ioutil" | |
| "os" |
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 ( | |
| "flag" | |
| "fmt" | |
| "go/ast" | |
| "go/parser" | |
| "go/token" | |
| "io/ioutil" | |
| "os" |
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 | |
| while getopts ":lcs:" opt; do | |
| case $opt in | |
| l ) echo `ls /usr/local | grep go1.*` | |
| exit 0 | |
| ;; | |
| c ) echo "Current go version: "`go version` | |
| exit 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
| #!/usr/bin/osascript | |
| tell application "Adium" | |
| repeat with acct in (every account in services) | |
| set isenabled to get acct's proxy enabled | |
| set acct's proxy enabled to not isenabled | |
| end repeat | |
| end tell |
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/tree" | |
| "fmt" | |
| "strconv" | |
| ) | |
| // Walk walks the tree (pre-order) t sending all values | |
| // from the tree to the channel ch. |
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 { | |
| first_fib := 0 | |
| second_fib := 1 | |
| temp_fib := 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
| package main | |
| import "code.google.com/p/go-tour/pic" | |
| func Pic(dx, dy int) [][]uint8 { | |
| outer := make([][]uint8, dy) | |
| for i := 0; i < dy; i++ { | |
| outer[i] = make([]uint8, dx) | |
| for j := 0; j < dx; j++ { | |
| outer[i][j] = uint8(i * j) |
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 | |
| case "${1:-''}" in | |
| 'start') | |
| if test -f /tmp/selenium-grid.pid | |
| then | |
| echo "Selenium Grid is already running." | |
| else | |
| java -jar /var/lib/jenkins/selenium/selenium-server-standalone-2.17.0.jar -role hub > /var/lib/jenkins/selenium/selenium-grid.log 2> /var/lib/jenkins/selenium/selenium-grid-error.log & echo $! > /tmp/selenium-grid.pid | |
| echo "Starting Selenium Grid..." |
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
| Another public gist | |
| editing without adding a comment or another file. | |
| ********** 2011-09-30 17:52:50 +0000 ********** | |
| est for MacGist | |
| ********** 2012-02-11 17:19:16 +0000 ********** |
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
| Test public gist. |