Skip to content

Instantly share code, notes, and snippets.

Aurélien sprt

Block or report user

Report or block sprt

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
View calc.dot
digraph G {
size="7.5,10"
labeljust="l"
fontname=Helvetica;
node [fontname=Helvetica]
edge [fontname=Helvetica,fontsize=10]
subgraph cluster0 {
label="Datastore layer: Syncer goroutine";
@sprt
sprt / safe_map.go
Last active Apr 23, 2017
Concurrent map using channels
View safe_map.go
package main
import "fmt"
type safeMap struct {
data map[string]string
readch, writech chan chan string
}
func newSafeMap() *concurrentMap {
View conf.d
10-antialias.conf
10-hinting.conf
10-hinting-none.conf
10-scale-bitmap-fonts.conf
10-sub-pixel-rgb.conf
11-lcdfilter-default.conf
20-unhint-small-dejavu-lgc-sans.conf
20-unhint-small-dejavu-lgc-sans-mono.conf
20-unhint-small-dejavu-lgc-serif.conf
20-unhint-small-dejavu-sans.conf
@sprt
sprt / app.go
Created Jul 14, 2016
gorilla/csrf App Engine bug
View app.go
package app
import (
"fmt"
"net/http"
"github.com/gorilla/csrf"
)
func init() {
View stem_test.py
import time
import stem.descriptor
import sys
def measure_average_relays_exit(path):
start_time = time.time()
total_relays, exits, consensuses = 0, 0, 0
for consensus in stem.descriptor.parse_file(path, document_handler=stem.descriptor.DocumentHandler.DOCUMENT):
for desc in consensus.routers.values():
View path_fix.py
import os.path
import sys
sys.path.insert(1, os.path.join(os.path.dirname(__file__), './lib'))
@sprt
sprt / dl_subs.sh
Created Feb 20, 2013
Automatically download movie and TV show subtitles with Transmission.
View dl_subs.sh
#!/bin/sh
# This will download the subtitles (if found) for the downloaded movie/TV show.
# Prerequisite: # pip install subliminal
cd $TR_TORRENT_DIR
if [ -d $TR_TORRENT_NAME ]; then
video_file=$(find $TR_TORRENT_DIR -name "*.avi" -o -name "*.mkv" \
-o -name "*.mp4" -o -name "*.rar" | head -n 1)
else
video_file="$TR_TORRENT_DIR/$TR_TORRENT_NAME"
You can’t perform that action at this time.