Skip to content

Instantly share code, notes, and snippets.

View dolanor's full-sized avatar

Tanguy ⧓ Herrmann dolanor

  • Strasbourg, France
View GitHub Profile
@dolanor
dolanor / dovecot.conf
Created January 21, 2018 20:26
mail server conf
# 2.2.9: /etc/dovecot/dovecot.conf
# OS: Linux 4.4.0-109-generic x86_64 Ubuntu 14.04.5 LTS ext4
# NOTE: Send doveconf -n output instead when asking for help.
auth_anonymous_username = anonymous
auth_cache_negative_ttl = 1 hours
auth_cache_size = 0
auth_cache_ttl = 1 hours
auth_debug = no
auth_debug_passwords = no
auth_default_realm =
@dolanor
dolanor / slice_test.go
Created January 2, 2018 15:05
Check speed of iterating with an index or the ranged value
package main_test
import (
"testing"
)
type Whatever struct {
a, b, c int
}

Keybase proof

I hereby claim:

  • I am dolanor on github.
  • I am dolanor (https://keybase.io/dolanor) on keybase.
  • I have a public key ASBNfq-OLmmKKwcaQweZRBcccNIhaObYYay0XeFudV5GGQo

To claim this, I am signing this object:

@dolanor
dolanor / chaincode_query.go
Created February 20, 2017 11:52
Query some HyperLedger chaincode from Go
package main
import (
"fmt"
"github.com/hyperledger/fabric/peer/chaincode"
pb "github.com/hyperledger/fabric/protos/peer"
)
func main() {
@dolanor
dolanor / wait.sh
Created August 3, 2016 10:42
A wait script that will return the list of the return code for a list of pid that we want to wait on
#!/bin/bash
# to get pids, you can just do a
# myprocess &
# pids+="$! "
pids="$@"
rets=""
for i in $pids
do
@dolanor
dolanor / .gitconfig
Last active December 25, 2015 14:39
[alias]
l = log --graph --pretty=tformat:'%Cred%h%Creset -%C(yellow)%d%Creset %s%Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
la = log --all --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
ci = commit -m
s = status -s --untracked=no
dc = diff --color=auto
dw = diff --color-words
co = checkout
b = branch
[core]
ca marche
@dolanor
dolanor / org.eclipse.cdt.ui.prefs
Created February 11, 2013 14:28
My semanticHighlighting configuration of eclipse CDT (I just copy pasted the semanticHighlighting part)
semanticHighlighting.staticMethod.color=255,136,0
semanticHighlighting.localVariableDeclaration.color=94,94,94
semanticHighlighting.localVariableDeclaration.enabled=true
semanticHighlighting.method.enabled=true
semanticHighlighting.localVariable.color=94,94,94
semanticHighlighting.macroDefinition.color=247,0,0
semanticHighlighting.macroDefinition.bold=true
semanticHighlighting.enumerator.color=33,97,225
semanticHighlighting.externalSDK.italic=true
semanticHighlighting.staticField.underline=true
#!/bin/bash
DRIVER=/usr/lib/fglrx/xorg/modules/drivers/fglrx_drv.so
echo "Come on AMD!"
for token in $DRIVER; do
echo "Removing AMD logo from "$token
for x in $(objdump -d $DRIVER|awk '/call/&&/EnableLogo/{print "\\x"$2"\\x"$3"\\x"$4"\\x"$5"\\x"$6}'); do
sed -i "s/$x/\x90\x90\x90\x90\x90/g" $DRIVER
done
done
echo "Reboot computer to finish"
// Instead of this
std::string s("19991217T151515");
ptime t = from_iso_string(s);
std::cout << t << std::endl;
// Use this
time_input_facet* input_facet = new time_input_facet();
input_facet->set_iso_extended_format();