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
import Foundation | |
protocol JSONConvertible { | |
} | |
extension JSONConvertible { | |
func toJSON() -> [String: AnyObject] { | |
var json = [String: AnyObject]() |
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 dns | |
import ( | |
"bytes" | |
"errors" | |
"math/rand" | |
"strings" | |
"time" | |
"golang.org/x/net/context" |
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 bench is a package which contains | |
// programs of Go Benchmark Competition. | |
package bench | |
import ( | |
"syscall" | |
) | |
// Find reads the text file on the `path`, | |
// finds the `s` words on the file and |
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 | |
# vet.bash | |
function check_dir() { | |
egrep -rn -e "$2" "$1" | |
if [[ $? != 1 ]] ; then | |
echo "$3" | |
exit $rc | |
fi |
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
# Setting up dnsmasq for Local Web Development Testing on any Device | |
Please note, these instructions are for OS X Lion. | |
First, you need to get the IP address of your machine on your local network. In OS X, the easiest place to find this is in System Preferences > Network. If you're using DHCP on your local network, you will want to make sure your computer requests the same IP address when it renews it's IP address lease. I recommend configuring the DCHP Reservation settings on your router to accomplish this. Otherwise, you can specify a manual address in your network settings: | |
1. Go to *System Preferences > Network* | |
1. Click *Advanced...* |
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 coord | |
import ( | |
"sync" | |
) | |
// FlushFunc takes all pending objects, writes them, and returns | |
// the results in the same order, or an error. | |
type FlushFunc func(v []interface{}) ([]interface{}, error) |
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 cloudant | |
import ( | |
"bytes" | |
"reflect" | |
"strconv" | |
"strings" | |
) | |
const ( |
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 tree | |
import ( | |
"reflect" | |
"unsafe" | |
) | |
// Cost calculates the memory size of an object tree. | |
func Cost(v interface{}) uint64 { | |
return cost(reflect.ValueOf(v)) |
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 quota | |
import ( | |
"errors" | |
"sync" | |
"time" | |
) | |
var QuotaExceededErr = errors.New("quota exceeded") |
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
javascript:(window.location.href='http://godoc.org/'+window.location.hostname+window.location.pathname) |
NewerOlder