This file contains 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 <set> | |
#include <vector> | |
#include <algorithm> | |
#include <iostream> | |
struct Data | |
{ | |
Data(int d) | |
: data(d) {} | |
int data; |
This file contains 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 <memory> | |
#include <iostream> | |
#include <vector> | |
struct Obj { | |
std::vector<int> data; | |
}; | |
int main() { | |
std::shared_ptr<Obj> local_shared; |
This file contains 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 <map> | |
#include <string> | |
#include <iostream> | |
#include <cstdint> | |
int main() { | |
std::map<std::string, uint8_t> map{{ | |
{"zero", 0}, | |
{"sixty-five", 65} | |
}}; |
This file contains 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 <atomic> | |
#include <thread> | |
#include <iostream> | |
#include <string> | |
static constexpr int ITERATIONS = 1000000; | |
int main() { | |
// std::atomic<long long> num{0}; | |
long long num{0}; |
This file contains 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
#!/usr/bin/env | |
if [ -z "$(docker ps --filter=name=buildkitd -q)" ]; | |
then | |
docker run -d --name buildkitd --privileged moby/buildkit:latest | |
fi | |
export BUILDKIT_HOST=docker-container://buildkitd | |
go run main.go | buildctl build |
This file contains 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
# syntax=docker/dockerfile:1.4 | |
ARG BASE_IMAGE | |
FROM $BASE_IMAGE as base | |
RUN --mount=type=cache,target=/var/cache/apt,sharing=private \ | |
--mount=type=cache,target=/var/lib/apt,sharing=private \ | |
apt-get update && apt-get install -y \ | |
ros-$ROS_DISTRO-demo-nodes-cpp \ | |
ros-$ROS_DISTRO-nav2-bringup \ |
This file contains 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
FROM debian | |
ARG UID | |
ARG GID | |
RUN groupadd -g ${GID} me | |
RUN useradd -g ${GID} -u ${UID} me | |
USER ${UID}:${GID} |
This file contains 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 <memory> | |
class Outside; | |
class Inside { | |
public: | |
Inside(std::shared_ptr<Outside> outside): outside_(outside) {} | |
std::shared_ptr<Outside> outside_; | |
}; |
This file contains 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 <iostream> | |
class MyClass { | |
public: | |
void do_stuff() { | |
auto fn = [this]() { | |
do_more_stuff(); | |
}; | |
fn(); | |
} |
NewerOlder