Skip to content

Instantly share code, notes, and snippets.

View 120 Coal to 90 Plastic Inline
0eNq9XctuHUeS/ZWG1mYj3w9vZzW72Q8aA0q6tomhSA4fjTYa/ve5ktzNsliRdc4J6+4kUTwRGZWZERnPf757f/tyeni8uXt+9+M/3918uL97evfjf//z3dPNz3fXt5//7fnXh9O7H9/dPJ8+vfvh3d31p89/+3B//uFvP7y7uft4+se7H+NvPxz+ysPt9dPzzYer99ePm99Mv/3th3enu+eb55vTV8pf/vLr/9y9fHp/ejxD/xvgp/PvXz0/Xt89Pdw/Pl+9P90+n9Ef7p/Ov3t/95nuGe8qpvLX+sO7X8+/GeNf65nSx5vH04ev/6V85vMbAslBICAEMk2gcisoDgLQCurrR7x5OF0931/9/Hj/cvdxD/sz4ob5HbSmoUGcdgI7tCNOh4YGcTrZjxbIjxaDgwK07yJ9NgN5NmNyUMCk9Ho6T/94eDw9PV09PdzePD+ff7h7cn4HzxB4cdwtCaJQHWcfo/DH47oLmf66FcseSD8GyYcg4xgkHILMY5B4BJLCIUgchyDxGGQegqRjkHYIko9B+iFIOQYphyD1GKQeghzv2Hi4Y9Pxjo2HOzYNxxUMnc7kUSPQHZaD4wrGKHjUCCSlnN5c8mctfnr8qs2Ry7i8IfPDv63cu4eX53d7VL8x/CCS1Ufy+BBuFlX3d21mzL3NtV0MuKbB1W/X3/bAGYNvox3egKc98Nfj+/7+5nbfIthc9PvLnwhIXYOUgICkA5CoGd4FeoMAiigc7bySHbcZxmZxUKgQheq4zTAKzUEBk1L33pfdvrzuX56N26sM14Wp0ZzMBfK6wLa/g+vrQQVM8WDzvncf1dcDfHP3dHo03igbq7FBr/tE8LwBx3jODPggwQsD3knwyoA3Erxhn7KQn7IzPFeS58GAFxJ8YgLJnEAacx434BDPTVSoxt3RkkM3YdLIDs2BUSiUOyXYd/ceePWqpSHY1K25tJJEsjNm/DS2E+AuqYcgr8fywy+nTzcfrm+vHm6v757XjpP0xvd2FuL5zzdf1v10f3v
@chadaustin
chadaustin / Coal to Plastic
Last active Dec 12, 2020
Factorio Blueprints
View Coal to Plastic
0eNq9XctuHUeS/ZWG1qaR74cXs5kfmP2gMaCka5sYiuTwYbTR8L/PleRulqSKrHNOWHcnieKJyKjMjMh4/vPN29uX08Pjzd3zm5/++ebm3f3d05uf/vufb55ufrm7vv34b8+/P5ze/PTm5vn04c0Pb+6uP3z827v78w//+OHNzd370z/e/BT/+OHwVx5ur5+eb95dvb1+3Pxm+uPvP7w53T3fPN+cPlP+9Jff/+fu5cPb0+MZ+t8AP59//+r58fru6eH+8fnq7en2+Yz+cP90/t37u490z3hXMZUf6w9vfj//Zow/1jOl9zePp3ef/0v5yOdXBJKDQEAIZJpA5VZQHASgFdTXj3jzcLp6vr/65fH+5e79HvZHxA3zO2hNQ4M47QR2aEecDg0N4nSyHy2QHy0GBwVo30X6bAbybMbkoIBJ6fV0nv7x8Hh6erp6eri9eX4+/3D35PwJniHw4rhbEkShOs4+RuHL47oLmX7cimUPpB+D5EOQcQwSDkHmMUg8AknhECSOQ5B4DDIPQdIxSDsEyccg/RCkHIOUQ5B6DFIPQY53bDzcsel4x8bDHZuG4wqGTmfyqBHoDsvBcQVjFDxqBJJSTt9c8mctfnr8rM2Ry7h8Q+aHf1u5dw8vz2/2qH5l+EEkq4/k8SHcLKru79rMmHuba7sYcE2Dq1+vv+2BMwbfRjt8A572wF+P79v7m9t9i2Bz0e8vfyIgdQ1SAgKSDkCiZngX6A0CKKJwtPNKdtxmGJvFQaFCFKrjNsMoNAcFTErde192+/K6f3k2bq8yXBemRnMyF8jrAtv+Dq6vBxUwxYPN+959VF8P8M3d0+nReKNsrMYGve4TwfMGHOM5M+CDBC8MeCfBKwPeSPCGfcpCfsrO8FxJngcDXkjwiQkkcwJpzHncgEM8N1GhGndHSw7dhEkjOzQHRqFQ7pRg39174NWrloZgU7fm0koSyc6Y8dPYToC7pB6CvB7Ld7+ePty8u769eri9vnteO07SN763sxDPf775tO6n+9u
View md5.rs
fn imagehash(path: &Path) -> std::io::Result<Digest> {
let mut f = File::open(path)?;
let mut buffer = [0u8; 1024*1024];
let mut context = Context::new();
loop {
let read = f.read(&mut buffer)?;
if 0 == read {
return Ok(context.compute());
}
View bashrc-prompt.sh
# Append history
shopt -s histappend
#HISTCONTROL="ignorespace:ignoredups:erasedups"
HISTCONTROL=ignorespace:erasedups
HISTSIZE=100000
HISTFILESIZE=-1
CAA_AT_PROMPT=1
function __caa_before_command {
if [ -z "$CAA_AT_PROMPT" ]; then
View st.rs
#!/usr/bin/env run-cargo-script
use std::process::Command;
fn main() -> std::io::Result<()> {
let args: Vec<std::ffi::OsString> = std::env::args_os().collect();
if args.len() > 1 {
eprintln!("no arguments allowed");
std::process::exit(1);
}
View st.rs
#!/usr/bin/env run-cargo-script
//! ```cargo
//! [dependencies]
//! ```
use std::process::Command;
fn main() -> std::io::Result<()> {
let mut path = std::env::current_dir()?;
View yaml_overrides.py
import collections
import yaml
# Try to preserve order in the front matter.
def dict_representer(dumper, data):
return dumper.represent_dict(data.items())
def dict_constructor(loader, node):
return collections.OrderedDict(loader.construct_pairs(node))
View datausage.py
#!/usr/bin/env python3
from xfinity_usage.xfinity_usage import XfinityUsage
import datetime
import json
import os
results = XfinityUsage(
os.environ['XFINITY_USER'],
os.environ['XFINITY_PASSWORD'],
@chadaustin
chadaustin / tmpfile.cpp
Last active Jan 11, 2018
How to atomically write a file without giving it a temporary name
View tmpfile.cpp
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>
// Can't get O_TMPFILE to work for some reason.
#ifndef __O_TMPFILE
# define __O_TMPFILE (020000000 | __O_DIRECTORY)
#endif
View mmaptest.cpp
// g++ -Wall -o mmaptest mmaptest.cpp
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <assert.h>
int main() {