Skip to content

Instantly share code, notes, and snippets.

View 0atman's full-sized avatar
🦀
Oxidising

Tristram Oaten 0atman

🦀
Oxidising
View GitHub Profile
@0atman
0atman / markup-example.rs
Last active April 3, 2021 10:01
markup.rs is pug with brackets
html {
head {
title { "example.com" }
style {
"body { background: #fafbfc; }"
"#main { padding: 2rem; }"
}
}
body {
@Header { "example.com" }
/*******************************************************************
A telegram bot for your Adafruit Feather M0 with KeyboardFeatherWing
Adapted from telegram code written by Brian Lough
*******************************************************************/
#include <Adafruit_GFX.h>
#include <SPI.h>
#include <WiFi101.h>
#include <Wire.h>
#include <Adafruit_ILI9341.h>
@0atman
0atman / main.rs
Last active January 15, 2021 10:19
Simple C programming bootstrap file in Rust
#![feature(start, libc, lang_items)]
#![no_std]
#![no_main]
#![feature(rustc_private)]
extern crate libc;
extern { // A list of imported C functions
pub fn printf(format: *const u8, ...) -> i32;
}
@0atman
0atman / rust-research.org
Last active November 3, 2020 09:09
Noodling with rust, with rustic-babel

Rust Research

org-babel

Include crates with :crates '((regex . 0.2)) syntax. However there is a bug in org-babel that only lets you use decimal versions, not semver. Shave off the bugfix suffix. I opened an issue here brotzeit/rustic#176 with a PR to fix here brotzeit/rustic#180

extern crate regex;
@0atman
0atman / hello.py
Created September 14, 2020 11:47
testing github api
print("hello")
@0atman
0atman / Dockerfile
Created September 14, 2020 08:22
multi-stage docker file for building bare-metal, tiny, rust containers
# Build Stage #
FROM rust:1.40.0 AS builder
WORKDIR /usr/src/
RUN rustup install nightly
RUN rustup default nightly
RUN rustup target add x86_64-unknown-linux-musl
RUN USER=root cargo new app
WORKDIR /usr/src/app
@0atman
0atman / pyinstaller.sh
Created September 2, 2020 14:35
pyinstaller works well!
λ python hello.py
hi
λ pyinstaller hello.py
18 INFO: PyInstaller: 4.0
18 INFO: Python: 3.8.2
24 INFO: Platform: Linux-5.4.0-45-generic-x86_64-with-glibc2.29
24 INFO: wrote /home/oatman/projects/pyinsttest/hello.spec
26 INFO: UPX is available.
@0atman
0atman / stillalive.nim
Last active June 20, 2020 16:05
The code for my video cover of Jonathan Coulton's "Want You Gone" here https://youtu.be/k6giW_6_bFY
import strutils
import terminal
import autotyperpkg/typer
const lyrics = """
1#
0#Forms FORM-29827201#
0#Test Assessment Report
This was a triumph.
I'm making a note here:
@0atman
0atman / wantyougone.nim
Last active June 6, 2020 18:52
The code from my music video, "Want You Gone", available here https://youtu.be/zvLGFe_8yWU
import strutils
import autotyperpkg/typer
const lyrics = """
Forms FORM-29827281-12-2:
Notice of Dismissal
Well here we are again
It's always such a pleasure
Remember when you tried

The Bloglist Manefesto

  • Anonymous and protected forever
  • Create account with just an email
  • Privacy protection baked in from the start
  • Hosted in a freedom-protecting country
  • Partner with EFF or similar
  • Back up forever
  • Profitable