Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Fabrice Aneche akhenakh

🏠
Working from home
Block or report user

Report or block akhenakh

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@sstolz
sstolz / tva_intracom_fr.sh
Last active Jan 12, 2017
TVA intracommunautaire FR
View tva_intracom_fr.sh
# Calcul GRATUIT et pour tous du numéro de TVA intracom français
# !! le contrôle de ces clés n'implique pas l'existence réelle du numéro de TVA intracommunautaire !!
# Source : https://fr.wikipedia.org/wiki/Code_Insee#Le_num.C3.A9ro_de_TVA_Intracommunautaire
SIREN=111222333 && echo "FR $(echo '(12 + (3*(${SIREN} % 97))) % 97' | bc) ${SIREN}"
View embedded.go
package main
// This is a basic example of running an nsqd instance embedded. It creates
// and runs an nsqd with all of the default options, and then produces
// and consumes a single message. You are probably better off running a
// standalone instance, but embedding it can simplify deployment and is
// useful in testing.
// See https://github.com/nsqio/nsq/blob/master/nsqd/options.go and
// https://github.com/nsqio/nsq/blob/master/apps/nsqd/nsqd.go for
@elithrar
elithrar / use.go
Last active Jul 18, 2018
go/use: Little middleware chains that could. Inspired by comments here: https://github.com/gorilla/mux/pull/36
View use.go
r := mux.NewRouter()
// Single handler
r.HandleFunc("/form", use(http.HandlerFunc(formHandler), csrf, logging)
// All handlers
http.Handle("/", recovery(r))
// Sub-routers
apiMiddleware := []func(http.Handler) http.Handler{logging, apiAuth, json}
@akhenakh
akhenakh / tools.py
Created Jun 19, 2012
flask jsonify with support for MongoDB from tools import jsonify
View tools.py
try:
import simplejson as json
except ImportError:
try:
import json
except ImportError:
raise ImportError
import datetime
from bson.objectid import ObjectId
from werkzeug import Response
@skeeet
skeeet / xcode_ramdisk.sh
Created Apr 12, 2012 — forked from MaximKeegan/xcode_ramdisk.sh
Create a RAM disk for using with XCode
View xcode_ramdisk.sh
#!/bin/sh
# Create a RAM disk with same perms as mountpoint
# Script based on http://itux.idev.pro/2012/04/iservice-speed-up-your-xcode-%D0%BD%D0%B5%D0%BA%D0%BE%D1%82%D0%BE%D1%80%D1%8B%D0%B5-%D1%81%D0%BF%D0%BE%D1%81%D0%BE%D0%B1%D1%8B/ with some additions
# Usage: sudo ./xcode_ramdisk.sh start
USERNAME=$(logname)
TMP_DIR="/private/tmp"
RUN_DIR="/var/run"
SYS_CACHES_DIR="/Library/Caches"
You can’t perform that action at this time.