Skip to content

Instantly share code, notes, and snippets.

View fowlmouth's full-sized avatar
🦃

Tim E fowlmouth

🦃
View GitHub Profile
@fowlmouth
fowlmouth / Dockerfile
Created September 3, 2023 20:44
Spacetime DB rust module builder image
FROM docker.io/library/rust:1-bookworm
RUN rustup default stable
RUN rustup component add clippy
RUN rustup target add wasm32-unknown-unknown
ARG SPACETIME_VERSION=0.6.1-beta
RUN arch=$(arch | sed s/aarch64/arm64/ | sed s/x86_64/amd64/) \
&& curl https://github.com/clockworklabs/SpacetimeDB/releases/download/v$SPACETIME_VERSION/spacetime.linux-$arch.tar.gz -o spacetime.tgz --fail --location \
@fowlmouth
fowlmouth / git-crypt.md
Created June 20, 2023 13:50 — forked from davidread/git-crypt.md
git-crypt + GPG guide

git-crypt guidance

Some repositories have git-crypt enabled, which encrypts certain files. This doc describes how to add and remove users, using their GPG keys, and has associated scripts. (You can also just share the repo's symmetric key, which is simpler, but not covered here.)

Understanding git-crypt

A repo that has been git-crypt'd should have in its repo:

  • .gitattributes - defines which files should be encrypted
  • .git-crypt/keys/default/0/*.gpg - .gpg file for every user (Each .gpg file is the repo's symmetric encryption key, which has been encrypted for a particular user with their individual public key. The filename is the user key's fingerprint.)
@fowlmouth
fowlmouth / Gemfile
Last active January 14, 2023 19:13
nanoc site deployment skeleton
source 'https://rubygems.org'
gem 'nanoc'
gem 'webrick'
gem 'adsf'
group 'nanoc' do
gem 'nanoc-live'
gem 'kramdown'
@fowlmouth
fowlmouth / build.sh
Created May 29, 2022 17:56
streams issue
#!/bin/sh
c++ main.cc -o main -std=c++20 && ./main
@fowlmouth
fowlmouth / Makefile
Last active March 18, 2022 17:30
c unicode examples
ALL: file string
string: string.o
cc -o $@ $<
file: file.o
cc -o $@ $<
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
struct cli;
typedef void(*cli_cb)(struct cli*, const char***, const char**, void*);
/*
an example of basic closures
*/
#include "runtime.h"
#include <memory>
using closure_fn = value(*)(int, value*, void*);
#include <string>
#include <vector>
#include <utility>
void gsub(std::string& str, std::vector< std::pair< std::string, std::string >> substitutions)
{
for(const auto& sub : substitutions)
{
const std::string& from = sub.first;
const std::string& to = sub.second;
#pragma once
namespace fowl{
namespace templates{
// index<idx, TS...> returns the type at index idx
template<std::size_t idx, typename... txs>
struct index;
#pragma once
#include <iostream>
#include <string>
#include <vector>
#include <memory>
#include <algorithm>
#include <type_traits>
#include <cstdlib>
#include <cxxabi.h>