Discover gists
Effective Modern CMake
Getting Started
For a brief user-level introduction to CMake, watch C++ Weekly, Episode 78, Intro to CMake by Jason Turner. LLVM’s CMake Primer provides a good high-level introduction to the CMake syntax. Go read it now.
After that, watch Mathieu Ropert’s CppCon 2017 talk Using Modern CMake Patterns to Enforce a Good Modular Design (slides). It provides a thorough explanation of what modern CMake is and why it is so much better than “old school” CMake. The modular design ideas in this talk are based on the book [Large-Scale C++ Software Design](https://www.amazon.de/Large-Scale-Soft
| #pragma once | |
| #include "util/types.hpp" | |
| #include "util/std.hpp" | |
| #include "util/ndarray.hpp" | |
| #include "util/collections.hpp" | |
| #include "util/rand.hpp" | |
| #include "util/hash.hpp" | |
| #include "util/assert.hpp" | |
| #include "util/bitset.hpp" |
| # ag <https://github.com/ggreer/the_silver_searcher> | |
| # usage: ag-replace.sh [search] [replace] | |
| # caveats: will choke if either arguments contain a forward slash | |
| # notes: will back up changed files to *.bak files | |
| ag -0 -l $1 | xargs -0 perl -pi.bak -e "s/$1/$2/g" | |
| # or if you prefer sed's regex syntax: | |
| ag -0 -l $1 | xargs -0 sed -ri.bak -e "s/$1/$2/g" |
| #!/bin/sh | |
| # Iterate over an array using POSIX Shell | |
| # Initial data | |
| ARR="a:b:c:d" | |
| # Iteration. Do whatever is needed instead of 'echo "$VAL"'. | |
| CDR="${ARR}:"; while [ -n "$CDR" ]; do CAR=${CDR%%:*}; echo "$CAR"; CDR=${CDR#*:}; done; unset CAR CDR | |
| # IMPORTANT!!! Add semicolon to the end of an array (IT="${ARR}:") to make stop condition working. |
| /* | |
| Whatsapp Spammer by Asyo kesayangan semua dan kasih sayang diberi tanpa batasan demi melawan Azam. | |
| ==================================================================================== | |
| DISCLAIMER: I do not take any responsibility for any damage caused with this script. | |
| WhatsApp might be able identify script users if this becomes a problem. Do only use | |
| this if you are aware of the consquences. | |
| ==================================================================================== | |
| Cara nak pakai : | |
| Copy semua script ni (CTRL+A, CTRL+C) lepastu Add a new Bookmark.kat URL section, | |
| write "javascript:" pastu paste (Ctrl+V) script ni. Bukak WhatsApp Web, pilih contact/group chat dan tekan Bookmark tu. |
Install Golang on Debian / Raspberry Pi
rm -rf /usr/local/go
GOVERSION="1.18.4"
wget "https://golang.org/dl/go${GOVERSION}.linux-amd64.tar.gz" -4
tar -C /usr/local -xvf "go${GOVERSION}.linux-amd64.tar.gz"
rm -rf /usr/local/go
GOVERSION="1.17.12"| Log uploaded on Monday, August 8, 2022, 10:12:48 PM | |
| Loaded mods: | |
| Harmony(brrainz.harmony)[mv:1.4.0.0]: 0Harmony(2.2.2), HarmonyMod(1.4.0) | |
| Core(Ludeon.RimWorld): (no assemblies) | |
| SF Grim Reality(SF.Grim.Reality): (no assemblies) | |
| SRTS Expanded (CE Fork)(smashphil.neceros.srtsexpanded.combatextendedfork)[mv:1.4.6]: 0Harmony(av:2.2.2,fv:2.1.0), SRTS(1.0.0) | |
| HugsLib(UnlimitedHugs.HugsLib)[ov:9.0.1]: 0Harmony(av:2.2.2,fv:1.2.0.1), HugsLib(av:1.0.0,fv:9.0.1) | |
| 1.3 - Imprisonment On The Go! (Make Pawns Prisoners Without Beds)(AgentBlac.MakePawnsPrisoners): MakePawnsPrisoners(1.0.0) |
How to use different ssh deploy keys for multiple private github repositories with Go Modules
Let's assume you are using Go Modules and have a go.mod file that contains multiple private repos each with a different ssh key. How can you get go mod download to do the right thing -- i.e. use ssh key A with private repo A and ssh key B with private repo B?
Ok, here we go!
Let's assume you have some github.com user with multiple private repos:
https://github.com/someuser/private-repo-1