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
const dynamoose = require('dynamoose') | |
const AWS = require('aws-sdk') | |
const { v4: uuid } = require('uuid') | |
const credentials = new AWS.Credentials('akid', 'secret', 'session') | |
const ddb = new AWS.DynamoDB({ | |
credentials, | |
region: 'us-east-1', | |
endpoint: 'http://localhost:8000' | |
}) |
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
const path = require('path') | |
const fs = require('fs') | |
const files = fs.readdirSync(path.dirname('.')) | |
const toFunctionName = (str) => str.replace( | |
/([-_][a-z])/g, | |
(group) => group.toUpperCase() | |
.replace('-', '') | |
.replace('_', '') |
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
const mockFn = (mockResult) => jest.fn(() => ({ | |
promise: () => Promise.resolve(mockResult) | |
})) | |
const implementation = { | |
method1: mockFn({ result1: '' }), | |
method2: mockFn({ result2: '' }), | |
... | |
} |
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 bash | |
[ "$(id -u)" != "0" ] && echo "Please run as root" && exit 1 | |
function usage { | |
echo "Usage: | |
./simulate_bad_connection.sh (-a | --address) <dest-ip-address> | |
[ -d | --delay ] <delay-in-ms> | |
[ -t | --timeout ] <timeout-seconds> | |
" |
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 bash | |
set -ex | |
STEAM_DIR=/data/steam/steamapps | |
AOE2DE_DIR=$STEAM_DIR/compatdata/813780 | |
AOE2DE_WIN_DIR=$AOE2DE_DIR/pfx/drive_c/windows | |
AOE2DE_WIN_SYS32_DIR=$AOE2DE_WIN_DIR/system32 | |
AOE2DE_WIN_SYS64_DIR=$AOE2DE_WIN_DIR/syswow64 |
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 ros:galactic | |
COPY setup.sh . | |
COPY launch.test.py . | |
RUN . /opt/ros/$ROS_DISTRO/setup.sh && python3 -m launch_testing.launch_test launch.test.py |
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 <algorithm> | |
#include <vector> | |
#include <iostream> | |
int main() { | |
std::vector<int> a = { 0, 1, 2, 3 }; | |
std::vector<int> b; | |
std::transform( | |
a.begin(), a.begin(), |
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 | |
FROM ubuntu | |
RUN apt-get update && apt-get install -y python3 | |
SHELL ["/usr/bin/python3", "-c"] | |
RUN <<EOF | |
import platform | |
my_os = platform.system() | |
if my_os.lower() == "linux": | |
print("oh yeah") | |
else: |
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
test: | |
g++ -std=c++17 -O3 main.cpp -ltbb -lbenchmark -lpthread -o benchmark | |
./benchmark |
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(); | |
} |
OlderNewer