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
sudo apt-get update -y && sudo apt-get install -y -q curl build-essential ca-certificates git mercurial bzr | |
sudo mkdir -p /goroot && sudo chown -R `whoami` /goroot && curl https://storage.googleapis.com/golang/go1.4.1.linux-amd64.tar.gz | tar xvzf - -C /goroot --strip-components=1 | |
sudo mkdir -p /gopath && sudo chown -R `whoami` /gopath | |
export GOROOT=/goroot | |
export GOPATH=/gopath | |
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin | |
echo "export GOROOT=/goroot" >> ~/.profile | |
echo "export GOPATH=/gopath" >> ~/.profile | |
echo "export PATH=$PATH:$GOROOT/bin:$GOPATH/bin" >> ~/.profile |
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
/* | |
* Copyright (c) 2014, Yawning Angel <yawning at torproject dot org> | |
* All rights reserved. | |
* | |
* Redistribution and use in source and binary forms, with or without | |
* modification, are permitted provided that the following conditions are met: | |
* | |
* * Redistributions of source code must retain the above copyright notice, | |
* this list of conditions and the following disclaimer. | |
* |
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 lex implements the lexical scanner for Suneido | |
package lex | |
import ( | |
"bytes" | |
"strings" | |
"unicode" | |
"unicode/utf8" | |
) |
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
// How to design a Go slice type that needs to be sortable in many ways. | |
package main | |
import ( | |
"fmt" | |
"sort" | |
) | |
type data struct { | |
i 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
#!/bin/bash | |
# | |
# Check a "few" things to help write more maintainable Go code. | |
# | |
# OK, it's fairly comprehensive. So simply remove or comment out | |
# anything you don't want. | |
# | |
# Don't forget to install (go get) each of these tools. | |
# More info at the URLs provided. | |
# |
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" | |
/******************************************************************************* | |
* Reference: | |
* An O(ND) Difference Algorithm and Its Variations | |
* Eugene W. Myers | |
*******************************************************************************/ |
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
function explicit(ctx, fn) { | |
return function() { | |
try { | |
const result = fn.apply(ctx, arguments) | |
return [null, result] | |
} catch (err) { | |
return [err, null] | |
} | |
} |
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" | |
"strings" | |
"database/sql" | |
) | |
const ( | |
SQL_INSERT = "INSERT INTO %s (%s) VALUES (%s)" |
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
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |
" Maintainer: | |
" Amir Salihefendic | |
" http://amix.dk - amix@amix.dk | |
" | |
" Version: | |
" 5.0 - 29/05/12 15:43:36 | |
" | |
" Blog_post: | |
" http://amix.dk/blog/post/19691#The-ultimate-Vim-configuration-on-Github |
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 ( | |
"bufio" | |
"flag" | |
"fmt" | |
"io" | |
"os" | |
"strings" | |
) |
OlderNewer