Skip to content

Instantly share code, notes, and snippets.

View JulienBreux's full-sized avatar

Julien Breux JulienBreux

View GitHub Profile
@JulienBreux
JulienBreux / .dotenv.sh
Last active September 26, 2018 08:14
source ~/.dotenv.sh
cd()
{
debug()
{
if [ $DOTENVSH_DEBUG = true ]; then
echo $1
fi
}
loadenv()

Keybase proof

I hereby claim:

  • I am JulienBreux on github.
  • I am julienbreux (https://keybase.io/julienbreux) on keybase.
  • I have a public key whose fingerprint is 28FD 65AB 03BB 4A67 331E FBDE C71D 9FA1 0BD0 23FA

To claim this, I am signing this object:

@JulienBreux
JulienBreux / Dockerfile
Last active May 14, 2022 21:31
Multi-stage builds example
# @see https://github.com/JulienBreux/tuto-go-docker-ms
FROM golang:1.9-alpine as builder
WORKDIR /go/src/github.com/JulienBreux/tuto-go-docker-ms/
RUN apk --update add ca-certificates
# RUN go get -d -v golang.org/x/net/html
COPY app.go .
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o app .
FROM scratch
@JulienBreux
JulienBreux / aliases.sh
Last active September 7, 2023 04:13
Kubernetes term aliases
# Used to run minikube shortly
alias mk="minikube"
# Used to run kubectl shortly
alias k="kubectl"
# Used to get ...
alias kg="kubectl get"
# Used to get all pods

Keybase proof

I hereby claim:

  • I am julienbreux on github.
  • I am julienbreux (https://keybase.io/julienbreux) on keybase.
  • I have a public key ASDX3SYzzRVnHSFo7v1PiM8YwElxqPLbTOlj0feEKRLmUgo

To claim this, I am signing this object:

@JulienBreux
JulienBreux / server.rb
Last active August 29, 2015 14:23
Micro-Server to validate oAuth2 roles :)
# How to use:
#
# $ruby server.rb
# $curl --header "X-Company-Roles: manager" --header "X-Company-Roles: admin" http://localhost:2345/
require 'socket'
require 'json'
server = TCPServer.new('localhost', 2345)
@JulienBreux
JulienBreux / gem.sh
Last active August 29, 2015 14:22
Specific Gem Version
gem rails _1.0.0_ --version
gem rails _2.0.0_ --version
alias debian="docker run --rm -ti debian:jessie /bin/bash"
alias ubuntu="docker run --rm -ti ubuntu:jessie /bin/bash"
@JulienBreux
JulienBreux / puma.sh
Last active August 29, 2015 14:21 — forked from runlevel5/puma.sh
#!/usr/bin/env bash
# Simple move this file into your Rails `script` folder. Also make sure you `chmod +x puma.sh`.
# Please modify the CONSTANT variables to fit your configurations.
# The script will start with config set by $PUMA_CONFIG_FILE by default
PUMA_CONFIG_FILE=config/puma.rb
PUMA_PID_FILE=tmp/pids/puma.pid
PUMA_SOCKET=tmp/sockets/puma.sock
class Document < ActiveRecord::Base
belongs_to :parent, class_name: 'Document'
def self.get_ancestors(who)
@tree ||= []
# @tree is instance variable of Document class object not document instance object
# so: Document.get_instance_variable('@tree')
if who.parent.nil?