Skip to content

Instantly share code, notes, and snippets.

View fitcher's full-sized avatar
🚗
Always fun)

Fitcher fitcher

🚗
Always fun)
  • Kiev
  • 19:35 (UTC -12:00)
View GitHub Profile
@fitcher
fitcher / GoConcurrency.md
Created July 26, 2018 13:47 — forked from rushilgupta/GoConcurrency.md
Concurrency in golang and a mini Load-balancer

INTRO

Concurrency is a domain I have wanted to explore for a long time because the locks and the race conditions have always intimidated me. I recall somebody suggesting concurrency patterns in golang because they said "you share the data and not the variables".

Amused by that, I searched for "concurrency in golang" and bumped into this awesome slide by Rob Pike: https://talks.golang.org/2012/waza.slide#1 which does a great job of explaining channels, concurrency patterns and a mini-architecture of load-balancer (also explains the above one-liner).

Let's dig in:

Goroutines

@fitcher
fitcher / express-jwt.js
Created August 22, 2017 13:15 — forked from vesse/express-jwt.js
Two Passport + JWT (JSON Web Token) examples
//
// Implementation using express-jwt middle
//
var express = require('express'),
ejwt = require('express-jwt'),
jwt = require('jsonwebtoken'),
passport = require('passport'),
bodyParser = require('body-parser'),
LocalStrategy = require('passport-local').Strategy,
BearerStrategy = require('passport-http-bearer').Strategy;
@fitcher
fitcher / gist:7ce0eda37e4d22b4082e0eeb70db5c00
Created December 3, 2016 18:08 — forked from oysteinjakobsen/gist:e59cdd38a688ee8a418a
How to get docker-compose (fig) up and running on Raspberry Pi 2

Background

I assume you already have Docker up and running on your Raspberry Pi 2. If not, see this article.

The next natural step is to install Docker Compose (formerly Fig), but there's no ARM support out of the box. This recipe will help you install Docker Compose on your Raspberry Pi 2!

The following six steps will do the trick:

  1. Get the docker-compose source code from git