Skip to content

Instantly share code, notes, and snippets.

View fsamin's full-sized avatar
🐍
¯\_(ツ)_/¯

François Samin fsamin

🐍
¯\_(ツ)_/¯
  • Rennes, France
View GitHub Profile
@fsamin
fsamin / gist:f61d90c63768cc6a58c7
Last active August 29, 2015 14:17
Docktor step-by-step docker IC
echo "*** 1) Prepare environment"
docker pull node
docker run --name=nodejs node npm -version
docker commit nodejs docktor-ic
docker rm nodejs
echo "*** 2) Clone git repository"
docker run --name=docktor-ic-checkout --workdir=/opt docktor-ic git clone https://github.com/docktor/docktor.git
docker commit docktor-ic-checkout docktor-ic-checkout
docker rm docktor-ic-checkout
echo "*** 3) Install dependencies"
@fsamin
fsamin / gulpfile.js
Last active September 10, 2015 08:34
Gulp go fmt
var gulp = require('gulp'),
path = require('path'),
tap = require('gulp-tap'),
exec = require('child_process').exec;
var serverPaths = {
ALL_GO: ['./server/**/*.go'],
};
gulp.task('go-fmt', function() {
import java.util.Timer;
import java.util.TimerTask;
/**
* Created by fsamin on 09/12/15.
*/
public class MyTimer {
private final Timer t = new Timer();
public TimerTask schedule(final Runnable r, long delay) {
func getNextPage(headers http.Header) string {
linkHeader := headers.Get("Link")
if linkHeader != "" {
links := strings.Split(linkHeader, ",")
for _, link := range links {
if strings.Contains(link, "rel=\"next\"") {
r, _ := regexp.Compile("<(.*)>.*")
s := r.FindStringSubmatch(link)
if len(s) == 2 {
return s[1]
http://www.kaihag.com/https-and-go/
https://gist.github.com/artyom/6897140
# Configure the OpenStack Provider
provider "openstack" {
# user_name = "" OS_USERNAME sourced from openrc.sh file will be used
# password = "" OS_PASSWORD sourced from openrc.sh file will be used
tenant_name = "TENANT_NAME"
auth_url = "https://auth.cloud.ovh.net/v2.0/"
}
# Create a key pair
resource "openstack_compute_keypair_v2" "test-keypair" {
http://container-solutions.com/write-terraform-provider-part-1/
@fsamin
fsamin / cds
Last active October 24, 2017 18:27
Image debian 9 w/ curl,git :buildpack-deps:stretch-scm
@fsamin
fsamin / serf.go
Created November 8, 2017 21:10
Use hashicorp/serf with golang
package main
import (
"log"
"os"
"os/signal"
"strconv"
"syscall"
"github.com/hashicorp/serf/serf"