Skip to content

Instantly share code, notes, and snippets.

FROM debian:12-slim
RUN dpkg --add-architecture i386 && \
apt-get update && \
apt-get install -y wget && \
mkdir -pm755 /etc/apt/keyrings && wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key && \
wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/debian/dists/bookworm/winehq-bookworm.sources && \
apt-get update && \
apt-get install -y \
cabextract \
@Dr-Emann
Dr-Emann / main.c
Last active April 26, 2023 15:56
Testing Apple File System Compression for RJVB/afsctool#62
#include <assert.h>
#include <errno.h>
#include <fcntl.h>
#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/xattr.h>
#include <unistd.h>
@Dr-Emann
Dr-Emann / ExportAttachments.py
Last active August 25, 2022 00:06
A script to export attachments from ArcGIS Pro 3, based on a "CleanID" field on the base (non-attach) table. Will export files in the passed directory, named like `ATT{CLEAN_ID}.jpg`
import os
from functools import lru_cache
import arcpy
from arcpy import da
base_table = arcpy.GetParameterAsText(0)
files_dir = arcpy.GetParameterAsText(1)
if not (base_table and files_dir):
@Dr-Emann
Dr-Emann / ExportAttachmentsFancy.py
Last active August 25, 2022 00:16
A script to export attachments from ArcGIS Pro 3, pulling fields from either the attach table or the base table. Will create files based on the passed format string (expecting a string like "C:\Path\{CleanID}-{ATT_NAME}")
from __future__ import print_function
import os.path
import string
import sys
from functools import lru_cache
import arcpy
from arcpy import da
@Dr-Emann
Dr-Emann / playground.rs
Created October 30, 2018 17:16 — forked from rust-play/playground.rs
Code shared from the Rust Playground
use std::sync::{Arc, Mutex, MutexGuard};
use std::thread;
use std::thread::JoinHandle;
type SafeNode = Arc<Mutex<TreeNode>>;
#[derive(Debug)]
struct TreeNode {
value: u16,
children: Vec<TreeNode>,
@Dr-Emann
Dr-Emann / playground.rs
Created April 27, 2017 17:00 — forked from anonymous/playground.rs
Rust code shared from the playground
extern crate rand;
use rand::{thread_rng, Rng};
use rand::distributions::{Normal, IndependentSample};
struct SinglePack {
open_block: Vec<f64>,
open_sum: f64,
blocks: Vec<Vec<f64>>,
}
@Dr-Emann
Dr-Emann / NaiveRust.rs
Last active September 12, 2016 15:55 — forked from jackmott/NaiveRust.rs
Naive Rust Game
// Implementation contributed by https://github.com/Maplicant
// Optimized game implementation in Rust
extern crate time;
use time::precise_time_ns;
use std::ops::{Add, Sub, Mul};
const NUM_BLOCKS: usize = 65535;
const NUM_ENTITIES: usize = 1000;
const CHUNK_COUNT: usize = 100;
@Dr-Emann
Dr-Emann / fast.rs
Created October 1, 2015 04:46 — forked from pnispel/fast.rs
bad rust?
let start = time::now();
let metadata = try!(fs::metadata(&path));
let mut file = try!(File::open(&path));
let mut buf = vec![0u8; metadata.len() as usize];
try!(file.read(&mut buf));
buf.make_ascii_lowercase();
let mut str: &str = try!(str::from_utf8(&buf));
pub struct Brick {
pub peer: Peer,
pub path: Path,
}
use std::fmt;
impl fmt::Display for Brick {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}:{}", self.peer.hostname, self.path.display())

Keybase proof

I hereby claim:

  • I am dr-emann on github.
  • I am dr_emann (https://keybase.io/dr_emann) on keybase.
  • I have a public key whose fingerprint is 4CC6 37E4 32B9 86CB 25A1 7977 D9AC DE1A 2C61 D85D

To claim this, I am signing this object: