Skip to content

Instantly share code, notes, and snippets.

@aladine
aladine / NOTES.md
Created November 15, 2019 07:39 — forked from DenisIzmaylov/NOTES.md
Step By Step Guide to Configure a CoreOS Cluster From Scratch

Step By Step Guide to Configure a CoreOS Cluster From Scratch

This guide describes how to bootstrap new Production Core OS Cluster as High Availability Service in a 15 minutes with using etcd2, Fleet, Flannel, Confd, Nginx Balancer and Docker.

Content

pub const WHITE: usize = 0; // X
pub const BLACK: usize = 1; // O
pub const FIELD: u32 = 0x1FF << 16;
pub const SQUARE: u32 = 0xFFFF;
pub const ALL_FIELDS_LEGAL: u32 = 0x1 << 25;
pub const DIAGS: [u32; 2] = [0o421, 0o124];
pub const ROWS: [u32; 3] = [0o700, 0o070, 0o007];
pub const COLS: [u32; 3] = [0o111, 0o222, 0o444];
@aladine
aladine / pre-commit.sh
Created September 30, 2019 12:15 — forked from radlinskii/pre-commit.sh
This is a pre-commit hook file for working in Go. Be sure to save this file in your repository as `.git/hooks/pre-commit` and give it right to execute e.g. with command `chmod +x .git/hooks/pre-commit`
#!/bin/sh
STAGED_GO_FILES=$(git diff --cached --name-only | grep ".go$")
if [[ "$STAGED_GO_FILES" = "" ]]; then
exit 0
fi
GOLINT=$GOPATH/bin/golint
GOIMPORTS=$GOPATH/bin/goimports
@aladine
aladine / org-mode-reference-in.org
Created September 23, 2018 14:22 — forked from drj42/org-mode-reference-in.org
This is a cheat sheet for Emacs org-mode... in org-mode format!
@aladine
aladine / gist:7fc263a44975112ac4a05441117f6104
Created May 25, 2016 16:39 — forked from momer/grpc_with_reconnect.go
A pattern I created to maintain connections to an RPC server in Go. Since net/rpc does not provide any methods for automatically reconnecting to an RPC server, I needed a work-around. Additionally, rpc.Client does not export any state variables (rpc.Client.shutdown and rpc.Client.closing) nor does it export the Client's Mutex. So, we wrap the rp…
package main
import (
"myapp/webserver/app/common"
"github.com/golang/glog"
"github.com/gorilla/mux"
"encoding/json"
"strconv"
"flag"
"fmt"