Skip to content

Instantly share code, notes, and snippets.

#include <utility>
#include <functional>
using std::function;
using std::move;
template <typename T, typename E>
class Result {
public:
static Result ok(const T &ok) {
@eliaxelang007
eliaxelang007 / Cargo.toml
Created January 10, 2024 09:24
Copy Text File To Clipboard On Windows In Rust!
[package]
name = "ditto"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
thiserror = "1.0.56"
windows-sys = { version = "0.52.0", features = [
@eliaxelang007
eliaxelang007 / periodic_table.json
Last active December 18, 2022 00:57
I took the element data from PubChem and the Royal Society of Chemistry and parsed the fields to make them easier to use in your code.
[
{
"atomic_number": 1,
"symbol": "H",
"name": "Hydrogen",
"atomic_mass": 1.008,
"cpk_hex_color": {
"red": 255,
"green": 255,
"blue": 255
#include <stdbool.h>
#include <stdio.h>
void print_array(int *array, int length)
{
int last_index = length - 1;
printf("[");
for (int i = 0; i < last_index; i++)
{
#include <iostream>
#include <cassert>
using std::cout;
template <typename T, size_t combination_length>
void _combinations(T array[], size_t array_length, void (*callback)(T *items[combination_length]), T *combination[combination_length], int start = 0, int level = 1)
{
assert(combination_length <= array_length && "You can't have a combination that's larger than the original array.");
final Tello tello = await Tello.tello();
await tello.takeoff();
final Tello tello = await Tello.tello();
await tello.flip(FlipDirection.back);
/* Author Elijah Axel L. Ang */
// If working on a local machine, define the arduino functions
// that are normally defined in the arduino environment so that
// the error checker doesn't freak out.
#if defined(linux) || defined(_WIN32) || defined(__APPLE__)
void tone(int pin, int frequency);
void tone(int pin, int frequency, int duration);
void noTone(int pin);
#include <opencv2/opencv.hpp>
#include <opencv2/highgui.hpp>
using namespace cv;
const int rows = 216;
const int columns = 384;
const int chemicals = 2;
bool is_drawing = false;
int brush_size = 2;
from subprocess import run
from pathlib import Path
from re import sub
from sys import stdout, stderr, argv
from time import sleep
from traceback import print_exc
username = ""
def create_remote_repo(repo_folder_path: str):