Skip to content

Instantly share code, notes, and snippets.

@kolomenkin
kolomenkin / PrecompiledHeader.cmake
Created December 27, 2016 11:09 — forked from larsch/PrecompiledHeader.cmake
cmake module for setting up precompiled headers (MSVC & GCC)
# Function for setting up precompiled headers. Usage:
#
# add_library/executable(target
# pchheader.c pchheader.cpp pchheader.h)
#
# add_precompiled_header(target pchheader.h
# [FORCEINCLUDE]
# [SOURCE_C pchheader.c]
# [SOURCE_CXX pchheader.cpp])
#
@kolomenkin
kolomenkin / submodule_update_alturl.sh
Last active April 25, 2016 12:56 — forked from vi/submodule_update_alturl.sh
"git submodule update --init --recursive" with second change for submodules referencing unpushed code (alternative URIs for submodules)
#!/bin/bash
script_version="1.04"
unset CDPATH
if [[ $1 = "--help" ]]; then
echo >&2 "Script version: $script_version"
echo >&2 "Expected environment example: ALTURL_repo1name=https://github.com/user1/repo1name.git ALTURL_repo2name=https://github.com/user1/repo2name.git ..."
echo >&2 "Expected environment example: mangle_submodule_name() - it should mangle its argument: 'repo/1/name' -> 'repo_1_name'"
echo >&2 "Expected environment example: submodule_recurse_script=update-checkout.sh submodule_recurse_arguments='arg1 arg2 arg3'"
@kolomenkin
kolomenkin / gittemplater.sh
Last active April 25, 2016 12:57 — forked from vi/envtemplater
Simplify setting multiple environment variables using templates
#!/bin/bash
script_version="1.08"
SUBST="@repo@"
SAVE_IFS="$IFS"
if [[ -z $1 || $1 = "--help" ]]; then
echo >&2 "Git-specialized version of tool: $script_version"
echo >&2 "Usage: T_template1=substitution1 ... T_templateN=substitutionN ./envtemplater.sh repo1@template ... repoN@template -- command [arguments]"
echo >&2 "Example: T_github=ALTURL_${SUBST}=https://github.com/vi/${SUBST}.git ./envtemplater.sh dive@github fdlinecombine@github -- ./submodule_update_alturl.sh --force"