Skip to content

Instantly share code, notes, and snippets.

package main
import (
"code.google.com/p/go-tour/tree"
"fmt"
)
// Walk walks the tree t sending all values
// from the tree to the channel ch.
func Walk(t *tree.Tree, ch chan int) {
require 'csv'
require 'pry'
require 'trello'
Trello.configure do |config|
config.developer_public_key = 'TRELLO_PUBLIC_KEY'
# Access https://trello.com/1/authorize?key=#{substitutewithyourapplicationkey}&name=My+Application&expiration=1day&response_type=token&scope=read,write
config.member_token = 'ACCESS_TOKEN'
end
package main
import (
"io"
"os"
"strings"
)
type rot13Reader struct {
r io.Reader
package main
import (
"code.google.com/p/go-tour/pic"
"image"
"image/color"
)
type Image struct {
width int
package main
import (
"fmt"
"net/http"
)
type String string
type Struct struct {
package main
import (
"fmt"
"math"
)
type ErrNegativeSqrt float64
func (e ErrNegativeSqrt) Error() string {
package main
import "fmt"
import "math/cmplx"
func Cbrt(x complex128) complex128 {
z := 1 + 0i
for {
zz := z - ((z * z * z - x) / (3 * z * z))
if cmplx.Abs(z-zz) < 0.0000001 {
@kei-s
kei-s / Gemfile
Created September 21, 2014 03:13
RubyHiroba blink1
source "https://rubygems.org"
gem "rb-blink1"
gem "twitter"
gem "dotenv"
package main
import "fmt"
// fibonacci is a function that returns
// a function that returns an int.
func fibonacci() func() int {
a := 0
b := 1
return func() int {
package main
import (
"code.google.com/p/go-tour/wc"
"strings"
)
func WordCount(s string) map[string]int {
m := make(map[string]int)
for _, word := range strings.Fields(s) {