% git clone https://go.googlesource.com/go $HOME/go1.4
% cd $HOME/go1.4/src
% git checkout release-branch.go1.4
% ./make.bash
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
| # Create /etc/apt/sources.list.d/pgdg.list and put the following contents: | |
| echo "deb http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main" > /etc/apt/sources.list.d/pgdg.list | |
| sudo apt-get install wget ca-certificates | |
| wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - | |
| sudo apt-get update | |
| sudo apt-get upgrade | |
| sudo apt-get install postgresql-9.4 pgadmin3 |
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" | |
| type response struct { | |
| resp *http.Response | |
| url string | |
| } | |
| func get(url string, r chan response) { |
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
| # Syntax highlighting for Golang with nano editor | |
| wget -O /usr/share/nano/go.nanorc http://go-lang.cat-v.org/text-editors/nano/go.nanorc | |
| # Golang for nano editor | |
| echo '## Go'$'\n''include "/usr/share/nano/go.nanorc"' >> /etc/nanorc |
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
| appTrainers.factory('ModelPhone', ['$http', function ($http) { | |
| function ModelPhone(modelData) { | |
| if (modelData) { | |
| this.setData(modelData); | |
| } | |
| } | |
| ModelPhone.prototype = { | |
| ID_PHONE: '', | |
| FID_CONTACT: '', |
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" | |
| "strings" | |
| ) | |
| func main() { | |
| // use backtick ` instead of double quote " |
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" | |
| func main() { | |
| fmt.Println(reverse("Golang!")) | |
| } | |
| func reverse(s string) (ret string) { | |
| for _, v := range 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 singleton | |
| type singleton struct {} // private | |
| var instance *singleton // private | |
| // public method GetInstance | |
| func GetInstance() *singleton { | |
| if instance == nil { | |
| instance = &singleton{} |
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
Show hidden characters
| { | |
| "cmd": ["/usr/bin/go","build","$file"], | |
| "selector" : "source.go", | |
| "variants": [ | |
| { "cmd": ["/usr/bin/go", "run", "$file"], | |
| "name": "Run" | |
| } | |
| ] |
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
| ruby -run -e httpd . -p 8080 | |
| iptables -A INPUT -p tcp -m tcp --dport 8080 -j ACCEPT | |
| iptables -F |