Skip to content

Instantly share code, notes, and snippets.

View Terkwood's full-sized avatar
🏳️‍⚧️

Elaine Terkwood

🏳️‍⚧️
  • Salesforce
  • Indiana, USA
  • 01:13 (UTC -04:00)
View GitHub Profile
@Technius
Technius / main.rs
Created April 22, 2019 23:57
Asynchronous process I/O in Rust using tokio
// This code sample needs the dependencies:
// tokio = "0.1"
// tokio-process = "0.2"
use tokio::prelude::*;
use std::process::{Command, Stdio};
use tokio_process::CommandExt;
use std::time::Duration;
fn main() {
@tylergannon
tylergannon / RBTree.rs
Last active March 24, 2025 05:53
Red Black Tree written in Rust
#![allow(dead_code)]
extern crate rand;
use std::cmp::Ord;
use std::cmp::Ordering;
use std::fmt::Debug;
use std::iter::Iterator;
use std::iter::IntoIterator;
use rand::Rng;
@abiodun0
abiodun0 / rbt.hs
Created March 4, 2019 06:02
Red black tree, Haskell
module RedBlackTree
(
Tree,
empty,
member,
insert)
where
data Color = R | B deriving Show
@sb8244
sb8244 / caching.ex
Last active May 23, 2024 07:29
Local/Distributed Caching
defmodule MyApp.AccountLookup.Cache do
@moduledoc """
Provides a cache that can be used for account lookups. This cache is backed by
Cachex for local storage and pg2 for remote distribution. Keys are set to expire
after 7-10 days (randomly distributed) in order to prevent stale data in our cache
over a long time period.
"""
use Cachex.DistributedCache
@sts10
sts10 / alacritty.yml
Last active December 20, 2023 13:54
My Alacritty config yml for MacOS (compliant with v 0.4.1-dev)
# Configuration for Alacritty, the GPU enhanced terminal emulator
# Any items in the `env` entry below will be added as
# environment variables. Some entries may override variables
# set by alacritty it self.
env:
# TERM env customization.
#
# If this property is not set, alacritty will set it to xterm-256color.
#
@lightdiscord
lightdiscord / netlify.sh
Last active July 5, 2021 15:20
Rust and wasm and netlify
#!/usr/bin/env bash
set -e
cweb_version=0.6.16
cweb=https://github.com/koute/cargo-web/releases/download/$cweb_version/cargo-web-x86_64-unknown-linux-gnu.gz
curl -Lo cargo-web.gz $cweb
gunzip cargo-web.gz
chmod u+x cargo-web
@natrim
natrim / convert.sh
Last active February 20, 2025 23:19
Simple conversion script that converts Godot html5 export to gzipped version, with decompressing wasm and pck files using pako
#!/bin/bash
### usage ./convert.sh game
## where game is baseName of the export
if [ ! "$1" ]; then
read -p 'Game name: ' game
else
game="$1"
fi
@peatiscoding
peatiscoding / build-tag-push.py
Created January 24, 2018 15:20
a script to convert your docker-compose.yml (version 2) with build node to image node; this script required DOCKERHUB_USER environment available.
#!/usr/bin/python
import os
import subprocess
import time
import yaml
import re
user_name = os.environ.get("DOCKERHUB_USER")
@willnationsdev
willnationsdev / gdnative_guide_windows64debug.md
Last active June 16, 2022 14:41
A quick guide on building a GDNative C++ project

Creating a GDNative Library (Windows)

This guide specifically shows how to get a Windows 10 x64 OS compiled for a Windows x64 Debug dynamic library and integrate it into a Godot project.

To begin, make sure you are running the appropriate command line tool as an administrator.

Create a SimpleLibrary directory and enter it. This is where our Godot and GDNative projects will exist. For later use, we will also create subdirectories for libraries (lib) and source code (src). Once inside, we get a copy of each necessary repository for C++ NativeScript bindings generation and enter into the cpp_bindings directory.

mkdir SimpleLibrary

@MadratJerry
MadratJerry / find-rls-preview.sh
Last active February 21, 2024 16:56
Find the latest rust nightly version with rls-preview
#!/bin/bash
MAC=false
date -r "$now" +%Y-%m-%d &> /dev/null
if [ "$?" -ne "0" ]; then echo "LINUX"; MAC=false; else echo 'MAC'; MAC=true; fi
now=`date +%s`
while true
do
if [ "$MAC" == "true" ]; then data=`date -r "$now" +%Y-%m-%d`; else data=`date -d @"$now" +%Y-%m-%d`; fi