This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# [last_return_code] user_name @ host_name distro_pretty_name (git_branch) current_directory | |
# $ | |
PS1="\[\e[00;37m\]\n[$?] \[\e[0m\]\[\e[01;34m\]\u\[\e[0m\]\[\e[00;37m\] @ \[\e[0m\]\[\e[01;32m\]\h $(grep PRETTY_NAME /etc/os-release | cut -d '=' -f2 | tr -d '"')\[\e[0m\]\[\e[00;37m\]\[\e[01;35m\]\$(echo -n \"\$(__git_ps1) \")\[\e[0m\]\[\e[01;37m\]\w\[\e[0m\]\[\e[00;37m\]\n\[\e[0m\]\[\e[01;37m\]\\$\[\e[0m\] " |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# a better "subl" command: | |
# allows piping to sublime text: | |
# open sublime text: | |
# subl [arguments] [files] | |
# subl ~/.bashrc | |
# or | |
# pipe output to sublime text: | |
# some_command | subl | |
# echo "Hello sublime pipe" | subl | |
# adapted from https://gist.github.com/nathforge/7120225 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
// http://coliru.stacked-crooked.com/a/3d07f7711012d021 | |
// https://stackoverflow.com/q/29661253/865719 | |
// https://connect.microsoft.com/VisualStudio/feedback/details/990223/overloaded-lambda-pattern-fails-to-compile | |
template <typename L, typename... Ls> | |
struct overload_set : L, overload_set<Ls...> | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -eux | |
this_dir="$(dirname "$(readlink -f "$0")")" | |
# TODO replate 'ubuntu.*18' by a regex that matches your distro | |
# check https://root.cern.ch/download/cling to see what distros are supported | |
latest_archive="$(w3m https://root.cern.ch/download/cling | grep -u 'ubuntu.*18' | head -n1 | sed 's/\s\+/ /g' | awk '{print $3}')" | |
latest_url="https://root.cern.ch/download/cling/${latest_archive}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
[ | |
{ "keys": ["ctrl+tab"], "command": "next_view" }, | |
{ "keys": ["ctrl+shift+tab"], "command": "prev_view" }, | |
{ "keys": ["ctrl+space"], "command": "auto_complete" }, | |
{ "keys": ["ctrl+alt+left"], "command": "jump_back" }, | |
{ "keys": ["ctrl+alt+right"], "command": "jump_forward" }, | |
{ "keys": ["ctrl+shift+o"], "command": "prompt_add_folder" }, | |
{ "keys": ["ctrl+up"], "command": "scroll_lines", "args": {"amount": 1.0 } }, | |
{ "keys": ["ctrl+down"], "command": "scroll_lines", "args": {"amount": -1.0 } }, | |
{ "keys": ["ctrl+u"], "command": "soft_undo" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
BasedOnStyle: Mozilla | |
AccessModifierOffset: '-4' | |
AlignAfterOpenBracket: Align | |
AlignConsecutiveAssignments: 'true' | |
AlignConsecutiveDeclarations: 'true' | |
AlignEscapedNewlinesLeft: 'false' | |
AlignOperands: 'true' | |
AlignTrailingComments: 'true' | |
AllowAllParametersOfDeclarationOnNextLine: 'true' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -eux | |
# Usage | |
# cmakeit source SOURCE_DIR build BUILD_DIR config CONFIG target TARGET1,TARGET2,... -- EXTRA_TOOL_ARGS | |
THIS_FILE_NAME="$(basename "$(readlink -f "$0")")" | |
THIS_DIR="$(dirname "$(readlink -f "$0")")" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'wget.vbs - similar to wget but written in vbscript | |
'based on a script by Chrissy LeMaire | |
' alternatively https://stackoverflow.com/a/28143180/865719 | |
' bitsadmin /transfer dl_job_name /download /priority normal <url> <absolute/path/to/file> | |
' Usage | |
if WScript.Arguments.Count < 1 then | |
MsgBox "Usage: wget.vbs <url> (file)" | |
WScript.Quit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// A compile-time method for checking the existence of a class member | |
// @see https://general-purpose.io/2017/03/10/checking-the-existence-of-a-cpp-class-member-at-compile-time/ | |
// This code uses "decltype" which, according to http://en.cppreference.com/w/cpp/compiler_support | |
// should be supported by Clang 2.9+, GCC 4.3+ and MSVC 2010+ (if you have an older compiler, please upgrade :) | |
// As of "constexpr", if not supported by your compiler, you could try "const" | |
// or use the value as an inner enum value e.g. enum { value = ... } | |
// check "test_has_member.cpp" for a usage example |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -eu | |
## untar_url <archive_url> <dest_dir> [<nb_components_to_strip>] | |
## | |
## Downloads an archive from <archive_url> and decompresses it in <dest_dir> | |
## | |
## @param archive_url archive url | |
## @param dest_dir directory in which to decompress the archive (created if not existing) | |
## @param nb_components_to_strip number of components to strip from file names on extraction. Default=1 |