Skip to content

Instantly share code, notes, and snippets.

@xav-b
xav-b / generate-release-name.sh
Created April 1, 2016 13:00
Generate cool release titles from cool docker defaults container names
#! /bin/sh
readonly LIGHT_IMAGE=alpine:latest
generate() {
docker run ${LIGHT_IMAGE} sleep 0
container_id=$(docker ps -a -l -q)
echo "$(docker inspect --format='{{ .Name }}' ${container_id} | tr '_/' ' ')"
docker rm ${container_id} &> /dev/null
}
@xav-b
xav-b / stack.md
Last active December 28, 2015 16:29
Data Platform Tech Stack

RT Data Platform

Pas de request/response mais une solution élégante en PUB/SUB

  • Pubnub - The global data stream network for IoT, Mobile, and Web applications

Ultra overkill mais apparemment très puissant. Fait à peu près tout.

@xav-b
xav-b / upload-s3.sh
Created December 23, 2015 09:24
Upload files to S3 with a few lines of Bash
# You don't need Fog in Ruby or some other library to upload to S3 -- shell works perfectly fine
# This is how I upload my new Sol Trader builds (http://soltrader.net)
# Based on a modified script from here: http://tmont.com/blargh/2014/1/uploading-to-s3-in-bash
# export S3KEY="my aws key"
# export S3SECRET="my aws secret" # pass these in
BUCKET="apps-crawler-prod"
putS3 () {
stream
// Select just the cpu_usage_idle measurement from our example database.
.from().measurement('cpu_usage_idle')
.alert()
.crit(lambda: "value" < 70)
// Whenever we get an alert write it to a file.
.log('/tmp/alerts.log')
@xav-b
xav-b / dot.env.sh
Last active October 21, 2015 05:17
Awesome autenv config
#!/usr/bin/env bash
# abort quietly if already setup
[ -z "${__PROJECT__}" ] || return
# generic project management
export __PROJECT__="$(basename $PWD)"
# go specific settings
export __GO_VERSION__="1.5.1"
@xav-b
xav-b / go.Makefile
Created October 10, 2015 19:02
Makfile for Go project, powered by Docker, glide and goxc
# Makefile
# vim:ft=make
PROJECT := $(shell basename $(PWD))
SOURCEDIR=.
SOURCES := $(shell find $(SOURCEDIR) -path './vendor' -prune -o -type f -name '*.go' -print)
PACKAGES=$(shell go list ./... | grep -v /vendor/)
GIT_COMMIT=`git rev-parse HEAD`
GIT_USER=`git config --get user.name`
@xav-b
xav-b / android.Dockerfile
Last active May 16, 2018 06:32
Android Development
# TODO Remove archives
FROM java:7
# Constants
#ENV JAVA_VERSION 7
ENV INSTALL_WORKSPACE /opt
#ENV ANDROID_SDK_VERSION r23.0.2-linux
ENV ANDROID_SDK_VERSION r24.2-linux
ENV ANDROID_BUILDER ant
ENV ANDROID_SDK_TOOLS android-21,build-tools-22.0.0,platform-tools,extra-android-support
@xav-b
xav-b / data-science-platform
Last active August 29, 2015 14:26
data-science-platform
# The Brain
Compilation de services permettant de mettre en place des algorithmes de recommendation et, plus largement, de machine learning et d'analyse de data.
L'idée principale est de pouvoir considérer la partie machine learning comme un service brique lego : des requêtes pour trainer les modèles et récupérer les predictions. Une plateforme/des outils pour manipuler les données ou développer les modèles serait un + pour anticiper les besoins à venir.
## [Prediciton.io](https://prediction.io/)
> Build and Deploy Machine Intelligence in a fraction of the time
@xav-b
xav-b / split-the-fat-app.md
Last active August 29, 2015 14:21
Split The Fat App

Split the fat application

As articles state everywhere, we're living in a fast pace digital age. Project complexity, or business growth, challenges existing development patterns. That's why many developers are evolving from [the monolithic application][16] toward [micro-services][17]. Facebook is moving away from its [big blue app][1]. Soundcloud is [embracing microservices][2].

Yet this can be a [daunting process][3], so what for ?

  • Scale. Better plugging new components than digging into an ocean of code.
  • Split a complex problem into smaller ones, easier to solve and maintain.
  • Distribute work through independent teams.
@xav-b
xav-b / hack.sh
Created March 29, 2015 16:48
Run a convenient sandbox container
#!/bin/bash
DEFAULT_NAME="lab"
DEFAULT_IMAGE="ubuntu"
WORKDIR="/root/app"
REPL="bash"
usage() {
printf "hack --help\t\tprint help\n"
printf "hack <image> <name>\trun a lab container\n"