Skip to content

Instantly share code, notes, and snippets.

View serxa's full-sized avatar

Sergei Trifonov serxa

  • ClickHouse Inc.
  • Amsterdam
  • 06:34 (UTC +02:00)
View GitHub Profile
@serxa
serxa / c++expr
Last active February 15, 2022 07:38
Bash script to compile, run and benchmark C++ one-liners
#!/usr/bin/env bash
set -e
usage() {
cat <<EOF >&2
USAGE: c++expr [-c CXX | -C | -I] [-i INCLUDE] [-b STEPS] [-t TESTS] [-o FILE] [-O CXX_OPTS...] [-g 'GLOBAL CODE'] 'MAIN CODE'
OPTIONS:
-c CXX use specified c++ compiler
-C use cmake
-I integrate into ClickHouse build tree in current directory
@serxa
serxa / git.sh
Last active May 6, 2022 12:49 — forked from ViBiOh/git.sh
Git sync
#!/usr/bin/env bash
git_is_inside() {
git rev-parse --is-inside-work-tree 2>&1
}
git_root() {
if [[ $(git_is_inside) != "true" ]]; then
pwd
return