Skip to content

Instantly share code, notes, and snippets.

View dev-0x7C6's full-sized avatar
🛹

Bartłomiej Burdukiewicz dev-0x7C6

🛹
View GitHub Profile
@dev-0x7C6
dev-0x7C6 / .gitlab.yml
Created July 9, 2020 09:42
Example: Gitlab pipeline configuration for Yocto builds
image: crops/yocto:ubuntu-20.04-base
variables:
GIT_SUBMODULE_STRATEGY: recursive
LANG: "C.UTF-8"
LC_ALL: "C.UTF-8"
DL_DIR: "/cache/downloads"
CCACHE_TOP_DIR: "/cache/ccache"
SSTATE_DIR: "/cache/sstate"
BB_ENV_EXTRAWHITE: "DL_DIR CCACHE_TOP_DIR SSTATE_DIR"
@dev-0x7C6
dev-0x7C6 / split_string_view.hpp
Last active August 6, 2022 17:56
C++: Split string_view into std::vector<string_view> by delimiter.
// should work correctly, but not tested yet
std::vector<std::string_view> split(const std::string_view str, const char delimiter = ',')
{
std::vector<std::string_view> result;
auto mark = str.begin();
for (auto it = mark; it != str.end(); ++it) {
if (*it == delimiter) {
result.emplace_back(std::string_view(mark, it));