Skip to content

Instantly share code, notes, and snippets.

package main
import (
"fmt"
)
type Space interface {
Travel(int) int
Destroy()
GetName() string
package main
import(
"io"
"errors"
"fmt"
)
type Rabbit struct {
s string
@squiidz
squiidz / Fetch Lib Test
Created November 5, 2014 01:13
Learn Go
package main
import (
"io/ioutil"
"net/http"
)
type Fetcher interface {
GetName() string
Fetch() (*[]byte, error)
@squiidz
squiidz / Tiny TCP Server
Created November 5, 2014 16:26
Learn Go
package main
import (
"log"
"net"
)
func main() {
data := make([]byte, 1024)
list, err := net.Listen("tcp", "localhost:9000")
package main
import (
"log"
"net"
"strconv"
)
type Server struct {
Addr string
package main
import (
"bytes"
"fmt"
"io"
)
type Maker interface {
WriteIn(data []byte) (int, error)
@squiidz
squiidz / btree.go
Last active March 16, 2016 19:26
Simple Binary tree in Go
package main
import (
"encoding/json"
"flag"
"fmt"
"io/ioutil"
"math/rand"
"time"
@squiidz
squiidz / jwt-example.go
Created May 24, 2015 19:31
JWT in Golang
package main
import (
"fmt"
"net/http"
"time"
"github.com/go-zoo/bone"
"github.com/go-zoo/claw"
mw "github.com/go-zoo/claw/middleware"
@squiidz
squiidz / parse.rs
Created July 9, 2016 00:13
rust_parse_string
use std::io::{self, Read};
use std::env;
#[derive(Debug)]
struct Entity {
data: String,
iter: Iterat,
}
#[derive(Debug)]
@squiidz
squiidz / main.rs
Created December 1, 2016 04:09
GMD
#![feature(exact_size_is_empty)]
use std::io::{self, Read};
use std::process::Command;
use std::env;
fn main() {
let mut entry = String::new();
if env::args().is_empty() {
match io::stdin().read_to_string(&mut entry) {
Ok(_) => {},