Skip to content

Instantly share code, notes, and snippets.

View sachaarbonel's full-sized avatar
👨‍💻
Uncovering bugs

Sacha Arbonel sachaarbonel

👨‍💻
Uncovering bugs
View GitHub Profile
@sachaarbonel
sachaarbonel / dep.md
Created October 11, 2018 09:48 — forked from subfuzion/dep.md
Concise guide to golang/dep

Overview

This gist is based on the information available at golang/dep, only slightly more terse and annotated with a few notes and links primarily for my own personal benefit. It's public in case this information is helpful to anyone else as well.

I initially advocated Glide for my team and then, more recently, vndr. I've also taken the approach of exerting direct control over what goes into vendor/ in my Dockerfiles, and also work from isolated GOPATH environments on my system per project to ensure that dependencies are explicitly found under vendor/.

At the end of the day, vendoring (and committing vendor/) is about being in control of your dependencies and being able to achieve reproducible builds. While you can achieve this manually, things that are nice to have in a vendoring tool include:

@sachaarbonel
sachaarbonel / lunr.js
Created October 12, 2018 10:22 — forked from olivernn/lunr.js
lunr-issue-162
/**
* lunr - http://lunrjs.com - A bit like Solr, but much smaller and not as bright - 0.5.10-issue162
* Copyright (C) 2015 Oliver Nightingale
* MIT Licensed
* @license
*/
;(function(){
/**
@sachaarbonel
sachaarbonel / request-response.go
Created October 17, 2018 15:42 — forked from hassansin/request-response.go
Request-response pattern over asynchronous protocol using Go channel
package main
import (
"errors"
"fmt"
"math/rand"
"net/http"
"sync"
"time"
@sachaarbonel
sachaarbonel / visitor_pattern_in_go.go
Created October 23, 2018 08:46 — forked from francoishill/visitor_pattern_in_go.go
Visitor Pattern in Golang
package main
//Thanks to http://ecs.victoria.ac.nz/foswiki/pub/Main/TechnicalReportSeries/ECSTR11-01.pdf
import (
"fmt"
)
//We will have multiple car parts
type CarPart interface {
Accept(CarPartVisitor)
@sachaarbonel
sachaarbonel / main.go
Created October 29, 2018 16:18 — forked from zupzup/main.go
Example for Basic AST Traversal in Go
package main
import (
"fmt"
"go/ast"
"go/parser"
"go/printer"
"go/token"
"log"
"os"
# Author: Pieter Noordhuis
# Description: Simple demo to showcase Redis PubSub with EventMachine
#
# Update 7 Oct 2010:
# - This example does *not* appear to work with Chrome >=6.0. Apparently,
# the WebSocket protocol implementation in the cramp gem does not work
# well with Chrome's (newer) WebSocket implementation.
#
# Requirements:
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby
@sachaarbonel
sachaarbonel / TestnetEthereumNetwork.md
Created November 9, 2018 10:42
Setup testnet Ethereum network with Docker

Setup testnet Ethereum network with Docker

Ethereum is a decentralized platform that runs smart contracts: applications that run exactly as programmed without any possibility of downtime, censorship, fraud or third party interference.

This is step-by-step guide, how to setup testnet Ethereum network.

We'll setup ethereum testnet node in the docker container and write ruby json-rpc client. The difference between ethereum(Frontier) and testnet ethereum(Ropsten) networks is that the testnet used for development. The genesis block on the testnet was set with a very low difficulty so anyone can do minning. The coins mained in the testnet have no values. You can request some coins on the facuet or trying to mine it.

@sachaarbonel
sachaarbonel / main.go
Created December 8, 2018 16:10 — forked from hnakamur/main.go
A go example to stop a worker goroutine when Ctrl-C is pressed (MIT License)
package main
import (
"fmt"
"os"
"os/signal"
"time"
"golang.org/x/net/context"
)
@sachaarbonel
sachaarbonel / tls-ca.go
Created January 4, 2019 14:49 — forked from ashee/tls-ca.go
golang tls with self-signed cert
package main
import (
"crypto/tls"
"crypto/x509"
"fmt"
"io/ioutil"
"net/http"
)
@sachaarbonel
sachaarbonel / instructions.txt
Created January 7, 2019 20:11 — forked from nathanborror/instructions.txt
Example Kubernetes setup with Postgres and two Services for serving an API and a static site using Ingress. Also have a CronJob example for kicks.
*** Cluster Setup for Google Container Engine ***
0/ Install and configure local gcloud and kubectl: https://cloud.google.com/sdk/docs/
> gcloud components install kubectl
1/ Configure Google Cloud account:
> gcloud config set account YOUR_EMAIL_ADDRESS
> gcloud config set project YOUR_PROJECT_ID
> gcloud config set compute/zone us-west1-a
> gcloud config set container/cluster example