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" | |
type Fooable interface { | |
foo() string | |
} | |
type Bar struct { } |
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
# This app is a very small proof of concept to help distributed teams with | |
# many repos, in possibly many organizations, handle their gitflow. | |
# | |
# Don't hate my codes... contribute! | |
# | |
# Get started: | |
# 1. Create Gemfile | |
# 2. Run sinatra | |
# 3. Open browser | |
# |
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
/* | |
* Fun with slices | |
*/ | |
package main | |
import "fmt" | |
// Fun with Go Slices | |
func main() { | |
a := make([]int, 20, 40) | |
a[0], a[1] = 1, 2 |
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" | |
// | |
// What doth a human make. | |
// | |
type Header interface { | |
HasHead() | |
} |
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
== Original Post == | |
i am iranian | |
i can not access to golang.org or code.google.com with real ip . | |
i should for access the golang.org change ip | |
i'm very sad | |
in iran | |
golang Iranian experts how they communicate with you? | |
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
/* | |
This is a very casual look at the speeds of type assertions: | |
Baseline returns what is passed in | |
Greeter returns a Person asserted from a Greeter interface | |
Empty returns a Person asserted from an empty interface | |
If you are a Rubyist, like myself, ~100ns per op is delightful. If you are used to real programming, |
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
/* | |
Go Interface method sets can contain any number of exported and unported method signatures | |
Go Interfaces do no acknowledge the use of fields, and thus file you are free to use them, under the hood, you cannot call them on the Interface | |
*/ | |
package main | |
import "fmt" |
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
home_coords = { | |
buyers:[ | |
[ | |
[195, 825, :initials], # page 1 buyer 1 | |
[200, (900 + 805), :initials], # page 2 buyer 1 | |
[225, (1800 + 75), :signature], # page 3 buyer 1 sig | |
[200, (1800 + 785), :initials], # page 3 buyer 1 | |
[200, (2700 + 785), :initials], # page 4 buyer 1 | |
], | |
[ |
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" | |
"bytes" | |
"math" | |
"strconv" | |
) | |
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
# | |
# Apparently this has been in Ruby since 1.9.3... who knew? | |
# Also check out sized queue class | |
# | |
require 'thread' | |
# | |
# Create a new thread that blocks on queue pop | |
# Create an "exit" channel to send "stop" message when total of 100 is reached | |
# |