Skip to content

Instantly share code, notes, and snippets.

View cceckman's full-sized avatar

Charles Eckman cceckman

View GitHub Profile
@cceckman
cceckman / rm2-tailscale.sh
Created May 20, 2023 16:10
Tailscale setup for remarkable
#!/bin/sh
#
# Original: https://github.com/cceckman/homelab/blob/main/helpers/rm2-tailscale.sh
# I am the original author of this document and release it into the public domain.
# Go wild.
#
# This script enables [Tailscale] on a [reMarkable 2] tablet.
#
# Tailscale is run in [userspace networking] mode, so any outbound applications
# will need to be configured to proxy via tailscaled.
@cceckman
cceckman / stitches.js
Created September 30, 2019 04:43
JS Stitch calculator
var inputs = {
swatch: {
stitches: 20,
length: 4 # Really any unit, as long as it's the same as target_length
},
pattern: {
multiple: 6,
plus: 2
},
target_length: 21 # Really any unit, as long as it's the same as swatch.length
@cceckman
cceckman / main.go
Last active December 14, 2017 07:55
Embedding != inheritance. This is Go (not Java/Python/C++ with 'Foo' as a virtual method), so this outputs FooBar instead of CrowBar.
package main
import(
"fmt"
)
type FooBar struct {}
func (f *FooBar) Foo() string {
return "Foo"
digraph G {
start -> v [label="Ctrl+X"] ;
start -> PRINT [label="Z"];
v -> QUIT [label="Ctrl+C"];
v -> start [label="ε"];
}
@cceckman
cceckman / main.go
Created November 5, 2017 07:02
Show gist
// Demonstrate bug: spacer doesn't render its background color.
package main
import (
"log"
"github.com/marcusolsson/tui-go"
)
func Theme() *tui.Theme {
@cceckman
cceckman / 01-pv-gce.yml
Created May 22, 2017 06:58
Non-working PV
# after having run `$ gcloud compute disks create --size=2GB gce-nfs-disk`
apiVersion: v1
kind: PersistentVolume
metadata:
name: nfs-pv
labels:
app: test
spec:
capacity:
storage: 2Gi
@cceckman
cceckman / gist:cd171aa8ec212ca47d43
Last active August 29, 2015 14:03
Packet decoder to 10-bit samples
// For chasecaleb of #xkcd. Untested- use at your own risk!
// I took this on just as a challange, so please review / check against your own work.
#define PACKET_DATA_SZ 22
#define SAMPLE_BITS 10
typedef struct {
uint32_t timestamp;
char data[PACKET_DATA_SZ];
} sample_packet_t;
@cceckman
cceckman / minheap.cpp
Created April 7, 2014 18:33
minheap implementation
#include "minheap.h"
/* Default constructor */
minheap::minheap()
{
// Ensure that there is always an empty element at index 0
values.push_back(0);
};
void minheap::insert(int v)
@cceckman
cceckman / test.sh
Created March 18, 2014 04:42
BC output dependent on other targets
#!/bin/bash
mkdir bc
mkdir bclink
git clone [email protected]:thestinger/rust-core
rustc --emit=bc --out-dir=bc rust-core/core/lib.rs
rustc --emit=bc,link --out-dir=bclink rust-core/core/lib.rs
diff bc/core.bc bclink/core.bc
@cceckman
cceckman / Makefile-onetarget
Last active August 29, 2015 13:57
Inconsistency emit bc,link
SHELL=/bin/bash
TARGET := arm-linux-noeabi
CHIP := arm926ej-s
rpi: CHIP := arm1176jzf-s
GCC_PREFIX := $(GCC_PREFIX)arm-none-eabi-
RUSTC := $(RUST_ROOT)/bin/rustc
#RUSTCFLAGS := -O --target $(TARGET) -Z no-landing-pads -Z debug-info -Z extra-debug-info --cfg $(CHIP)