Skip to content

Instantly share code, notes, and snippets.

View raster's full-sized avatar

Pete Prodoehl raster

View GitHub Profile
@raster
raster / CircularPositioning.scad
Last active November 7, 2023 16:51
OpenSCAD code to position things in a circular fashion...
$fn=100;
distance = 10;
howMany = 3;
holeSize = 10;
startAngle = 30;
difference() {
// Rename Artboards.jsx
// for renaming artboards in Adobe Illustrator
// Info: https://graphicdesign.stackexchange.com/questions/104010/how-batch-rename-artboards-in-adobe-illustrator
//
function artBoardName_serial() {
var doc = app.activeDocument;
for (var i = 0, l = doc.artboards.length; i < l; i++) {
if (doc.artboards[i].active) {
}
@raster
raster / ModuleVariables.scad
Last active February 23, 2023 21:32
OpenSCAD demo showing scope of variable in modules / functions.
foo = 0;
echo(foo);
m1();
m2();
m1();
@raster
raster / sprintf.ino
Last active April 23, 2022 14:26
Sprintf Example for Arduino
// Sprintf Example for Arduino
// https://www.programmingelectronics.com/sprintf-arduino/
// Note that sprintf for Arduino does not support float:
// https://forum.arduino.cc/t/solved-why-cant-i-print-a-float-value-with-sprintf/367971
char buffer[25]; // create a buffer long enough to hold string
void setup() {
Serial.begin(115200);
randomSeed(32); // needed only because we use random below in this example
import themidibus.*; // Import the library
MidiBus myBus; // The MidiBus
void setup() {
size(400, 400);
background(0);
MidiBus.list(); // List all available Midi devices on STDOUT. This will show each device's index and name.
@raster
raster / 8KLauncher.ahk
Created January 3, 2021 04:30
An AutoHotKey script for the 8K Controller
#SingleInstance Prompt
F13::
Run https://www.google.com/
return
F14::
Run http://rasterweb.net/raster/
return
F15::
Run https://hackaday.com/blog/
return
#!/bin/sh
/usr/bin/find /Users/pete/Projects/ -name '*.ai' -exec cp -p \{\} /Users/pete/EXAMPLES/ \;
# copy just the .ai files
#!/usr/local/bin/python3
#
# Pete Prodoehl <pete@2xlnetworks.com>
#
# Resizes Game Boy Camera photos to 1280x1152
#
from PIL import Image
import glob
import getopt
/*
* ServoSweeps.ino
*
* Testing the BDG Digital I/O Arduino Shield
*
*/
#include <Servo.h>
@raster
raster / deleteold.sh
Created January 1, 2020 16:35
Shell script to delete old files and empty directories
#!/bin/bash
#
# This will delete JPG files more than 7 days old
# and video files more than 21 days old
# it will also delete old empty directories
CPATH='/mnt/TL'
find $CPATH/images -name "*.jpg" -type f -mtime +7 -delete