Skip to content

Instantly share code, notes, and snippets.

View fatih's full-sized avatar

Fatih Arslan fatih

View GitHub Profile
@fatih
fatih / yamux-exmaple.go
Created May 22, 2015 10:19
A simple working yamux example
package main
import (
"fmt"
"log"
"net"
"time"
"github.com/hashicorp/yamux"
)
@fatih
fatih / copyast.go
Created July 13, 2019 12:30
Fork of wire/internal/copyast with support for *ast.File
// Copyright 2018 The Wire Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
(
set -eux
cd $(mktemp -d)
export GOPATH=$(mktemp -d)
export PATH=$GOPATH/bin:$PATH
git clone https://github.com/ianthehat/godef
cd godef
git checkout f2eb530fb8dbca312f4661b985ec2ae5ba5e7b3a
go install
git clone https://github.com/digitalocean/csi-digitalocean
@fatih
fatih / bumpme
Last active November 8, 2016 16:01
boooo
@fatih
fatih / changes.diff
Last active October 24, 2016 17:02
Router example
--- other.go 2016-10-16 16:23:33.000000000 +0300
+++ demo.go 2016-10-16 16:24:27.000000000 +0300
@@ -9,12 +9,12 @@
)
var Session *http.Server
-var r Router
+var r *Router
func Run(port string) {
@fatih
fatih / job.vim
Created September 21, 2016 20:45
func! CloseHandler(channel)
while ch_status(a:channel) == 'buffered'
echomsg ch_read(a:channel)
endwhile
endfunc
let job = job_start(['go', 'build'], {'close_cb': 'CloseHandler'})
@fatih
fatih / gist:cd1ee734803f27526f74
Created August 7, 2014 22:55
CoreOS Cloudformation with VPC
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "CoreOS on EC2: http://coreos.com/docs/running-coreos/cloud-providers/ec2/",
"Mappings" : {
"RegionMap" : {
"ap-northeast-1" : {
"AMI" : "ami-19fba518"
},
ifeq ($(strip $(shell git status --porcelain 2>/dev/null)),)
GIT_TREE_STATE=clean
else
GIT_TREE_STATE=dirty
endif
all: build
build:
@echo "==> Building the project"
@fatih
fatih / attachTest.go
Last active December 26, 2015 22:29
Attach failing for arguments more than two
package main
import (
"fmt"
"github.com/caglar10ur/lxc"
)
func main() {
// first create and start
l := lxc.NewContainer("testing")
@fatih
fatih / zmq-REP-client.go
Created July 16, 2013 09:03
Zmq REP client
package main
import (
zmq "github.com/pebbe/zmq3"
)
func main() {
responder, _ := zmq.NewSocket(zmq.REP)
defer responder.Close()
responder.SetIdentity("1123581321") //key to be used