Skip to content

Instantly share code, notes, and snippets.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
// Distances are in thousands of an inch
width = 1000; // One inch wide
length = 6000; // Six inches long
base_thickness = 250; // Quarter inch thickness
camera_holder_ring_thickness = base_thickness;
module camera_holder_ring() {
translate([0,width,0])
@croepha
croepha / dump_safari_history.py
Created July 5, 2014 01:56
Python script to get history from safari, because safari won't give you the time the site was visited
import plistlib, os.path, datetime, pytz, tzlocal, sys
_, start_days, end_days = sys.argv
start_days = int(start_days)
end_days = int(end_days)
apple_epoch = datetime.datetime(
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
// units are in mm
// dims of amp
amp_outside_width = 150; // about 6 inches
amp_outside_height = 40;
amp_fin_depth = 10; // less than half an inch
amp_fin_thickness = 2;
amp_fin_inside_distance = 5;
@croepha
croepha / gist:d006ec1f62dd4dcb1774c5116d1cebff
Created October 28, 2016 15:47
custom ubuntu core config:
sudo /snap/bin/ubuntu-image \
--extra-snaps=/home/cro/home_root/mnt/2/snapcraft_kernel_build_test/linuxium-kernel_4.4.0-45.66_amd64.snap \
-c beta -o ${DIR2_}/ics-ubuntu-image.img \
${DIR4_}/ics.model
LOOP_DEVICE=$(sudo losetup --partscan --find --show \
${DIR2_}/ics-ubuntu-image.img)
sudo mount ${LOOP_DEVICE}p3 ${DIR4_}/custom_image
@croepha
croepha / main.cpp
Last active December 7, 2016 16:38
work in progress software renderer for 3d
/*
watch -n.1 "clang++ --std=c++11 -g main.cpp -shared -o _target.so && mv _target.so target.so"
Ortho: http://i.imgur.com/bJ3VqNz.png
# clang++ --std=c++11 -g main.cpp -o target && ./target
*/
#include <assert.h>
#include <stdio.h>
#if 0 /* (sh-mode)
set -e
LPATH=/Users/cro/Documents/PersonalProjects/Graphics/
# -Ofast
[ ! ]&& time clang++ -g --std=c++11 -fPIC -Wall \
$LPATH/text_test.cpp \
-Wno-writable-strings \
-Wno-unused-function \
#if 0 /* (sh-mode)
set -e
LPATH=/Users/cro/Documents/PersonalProjects/Graphics/
tu_name=cube_rotate_thing
# -Ofast
[ ! ]&& time clang++ -g --std=c++11 -fPIC -Wall \
-D "RELOADABLE_CODE=\"$LPATH${tu_name}_reloadable.cpp.so\"" \