This file contains hidden or 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
[alias] | |
plog = log --graph --pretty=format:'%Cred%h%Creset %C(cyan)%an%Creset %C(yellow)%d%Creset %s %C(green)(%cr)%Creset' --abbrev-commit |
This file contains hidden or 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
#!/bin/sh | |
# exit the script if any statement returns a non-true return value | |
set -e | |
# exit the script on dereferencing uninitialised variables | |
set -o nounset | |
self=$(basename $0) | |
origin=$(cd "$(dirname "$0")"; pwd) |
This file contains hidden or 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
if (window.history && history.replaceState && (location.search.match(/utm_/) || location.hash.match(/utm_/))) { | |
search = location.search.replace(/(\?|\&)?utm_[a-z]+=[^\&]+/g, '') | |
hash = location.hash.replace(/(#|\&)?utm_[a-z]+=[^\&]+/g, '') | |
history.replaceState({}, '', location.pathname + search + hash); | |
} |
This file contains hidden or 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
$ git config --global alias.branch-hof '!git for-each-ref --shell --format="printf '\''%%30s %%40s %%25s\n'\'' %(authorname) %(refname:short) %(committerdate:relative)" --sort=committerdate refs/remotes/origin | sh' |
This file contains hidden or 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
#!/bin/sh | |
# /etc/ppp/ip-up example script | |
# must have 0755 permissions | |
# must be owned by root | |
/sbin/route add -net 192.168.50 -interface $1 |
This file contains hidden or 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 <cstddef> | |
#include <iostream> | |
#define array_length(a) sizeof(implementation::array_length_requires_array_argument(a)) | |
namespace implementation { | |
template<typename T, size_t N> | |
char (&array_length_requires_array_argument(T (&)[N]))[N]; | |
} // namespace implementation |
This file contains hidden or 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
[user] | |
name = Gregory Pakosz | |
email = redacted | |
[color] | |
ui = auto | |
[core] | |
autocrlf = false | |
excludesfile = /Users/gregory/.gitignore | |
editor = vim | |
whitespace = cr-at-eol |
This file contains hidden or 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
#if defined(_WIN32) && defined(_MSC_VER) && (_MSC_VER < 1800) | |
#define SIZET_FMT "%Iu" | |
#elif defined(__linux__) || (defined(_MSC_VER) && (_MSC_VER >= 1800)) | |
#define SIZET_FMT "%zu" | |
#elif defined(__APPLE__) | |
#define SIZET_FMT "%zu" | |
#else | |
#define SIZET_FMT "%u" | |
#endif |
This file contains hidden or 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
// gcc -O3 -march=native -o simplehashing simplehashing.c | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <stdint.h> | |
#include <math.h> | |
#include <string.h> | |
#include <x86intrin.h> | |
// https://github.com/php/php-src/blob/PHP-7.1/Zend/zend_string.h#L325 |
This file contains hidden or 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 <cstddef> | |
#define array_length(a) sizeof(impl::array_length_requires_array_argument(a)) | |
namespace impl { | |
template<typename T, size_t N> | |
char (&array_length_requires_array_argument(T (&)[N]))[N]; | |
} |