Skip to content

Instantly share code, notes, and snippets.

View vly's full-sized avatar
💭

V L vly

💭
View GitHub Profile
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Help build the bionic eye : Bionic Vision Australia</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<!-- Le styles -->
@vly
vly / go_tour_40.go
Last active December 16, 2015 11:29
Golang tour #40
package main
import (
"code.google.com/p/go-tour/wc"
"strings"
)
func WordCount(s string) map[string]int {
output := make(map[string]int)
for _,b := range strings.Fields(s) {
@vly
vly / go_tour_43.go
Created April 21, 2013 01:38
Golang tour #43
package main
import "fmt"
// fibonacci is a function that returns
// a function that returns an int.
func fibonacci() func() int {
a,b,c:= 0,1,0
return func() int {
@vly
vly / go_tour_47.go
Created April 21, 2013 02:12
Golang tour #47
package main
import ("fmt"
"math/cmplx"
)
func Cbrt(x complex128) complex128 {
guess := x/2
// assumes stability after 20 iterations
for i:=0;i<20;i++ {
@vly
vly / go_tour_55.go
Last active December 16, 2015 11:38
Golang tour #55
package main
import (
"fmt"
"math"
)
type ErrNegativeSqrt float64
func (e ErrNegativeSqrt) Error() string {
@vly
vly / go_tour_57.go
Created April 21, 2013 04:55
Golang tour #57
package main
import (
"fmt"
"net/http"
)
type String string
type Struct struct {
@vly
vly / go_tour_59.go
Created April 21, 2013 06:32
Golang tour #59
package main
import (
"code.google.com/p/go-tour/pic"
"image"
"image/color"
)
type Image struct{
W, H int
@vly
vly / go_tour_60.go
Created April 21, 2013 07:28
Golang tour #60
package main
import (
"io"
"os"
"strings"
)
type rot13Reader struct {
r io.Reader
@vly
vly / go_tour_69.go
Created April 21, 2013 09:49
Golang tour #69
package main
import ("code.google.com/p/go-tour/tree"
"fmt"
)
func Walk(t *tree.Tree, ch chan int) {
Walker(t, ch)
close(ch)
@vly
vly / zendesk_hc.py
Last active December 24, 2015 23:19
Example script for automating generation of Zendesk Help Centre community q&a threads.
import time
import uuid
import jwt
import requests
import re
# config
SHARED = 'YOUR SHARED KEY'
SUB = 'YOURSUBDOMAIN'