Skip to content

Instantly share code, notes, and snippets.

View tristan0x's full-sized avatar

Tristan Carel tristan0x

View GitHub Profile
#!/bin/bash
JAVA="jdk-8u5-linux-x64"
JAVA_URL="http://download.oracle.com/otn-pub/java/jdk/8u5-b13/$JAVA.tar.gz"
wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" $JAVA_URL
mkdir -p ~/java
tar -xzf $JAVA.tar.gz -C ~/java --strip-components=1
@tristan0x
tristan0x / hip-py-log
Last active August 29, 2015 14:12
Python logs beautifier
#!/usr/bin/awk -f
# Python logs beautifier
# Handled multi-line errors when each line starts with the ↪
# Example of usage:
# tail -f celery.log | hip-py-log
BEGIN {
# color code of the previous line
### Keybase proof
I hereby claim:
* I am tristan0x on github.
* I am tristan0x (https://keybase.io/tristan0x) on keybase.
* I have a public key whose fingerprint is 63C2 4004 C26B 04ED 7748 6EED FDDB 2531 06F6 1CF5
To claim this, I am signing this object:
@tristan0x
tristan0x / docker-compose-install.sh
Last active May 31, 2017 09:24
Docker-compose installer
#!/bin/sh -e
PREFIX=${PREFIX:-/usr}
NAME=${NAME:-docker-compose}
DOCKERCOMPOSE_VERSION=${DOCKERCOMPOSE_VERSION:-1.1.0}
VENV_PATH="${PREFIX}/${NAME}"
VIRTUALENV=${VIRTUALENV:-virtualenv}
if ! [ -d "$PREFIX" ] ; then
@tristan0x
tristan0x / README.md
Last active August 2, 2017 09:06
C++ mass renaming

Ctags

List of all kind symbols that can be extracted

$ ctags --list-kinds=C++
c  classes
d  macro definitions
e  enumerators (values inside an enumeration)
f  function definitions
@tristan0x
tristan0x / README.md
Last active August 7, 2017 01:38
Git commit client hook

Git commit client hook

Provides Git hook enforcing commit message.

  • first line length must be less than 50 characters.
  • if applicable, second line may be empty.
  • length of every lines may be less than 72 characters.

Installation instructions

/*
MIT License
Copyright (c) 2017 Tristan CAREL
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@tristan0x
tristan0x / git.md
Last active October 6, 2017 06:48
Git Tip & Tricks

Install latest git

On Ubuntu:

sudo add-apt-repository ppa:git-core/ppa
sudo apt-get update
sudo apt-get upgrade
@tristan0x
tristan0x / .clang-format
Last active December 13, 2017 14:32
Blue Brain Project HPC team C++ coding style
---
Language: Cpp
BasedOnStyle: LLVM
AlwaysBreakTemplateDeclarations: true
BraceWrapping:
FixNamespaceComments true
IncludeCategories:
IndentWidth: 4
PointerAlignment: Left
---
Language: Cpp
BasedOnStyle: LLVM
AlwaysBreakTemplateDeclarations: true
BraceWrapping:
FixNamespaceComments: true
IndentWidth: 4
PointerAlignment: Left