This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| include <BOSL2/std.scad> | |
| include <BOSL2/threading.scad> | |
| UNIT="imperial"; // [imperial, metric] | |
| THREAD_LENGTH_INCHES=1.25; | |
| THREAD_LENGTH_MM=31.75; | |
| module broom_thread_internal_mask(length){ | |
| INCH=25.4;//mm |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //OpenSCAD module to create an ogive of given length for a given circle diameter (gauge) | |
| GAUGE13=2.3;//mm | |
| module ogive(gauge=GAUGE13, length=10){ | |
| //gauge -> the DIAMATER of spoke | |
| //length the fin or ogive length FROM THE CENTER of the spoke | |
| gr = gauge/2; //gauge radius | |
| chord = length * 2; //length is 1/2 of a chord forming a right triangle along with large_radius as hypotenuse and (large_radius - gauge radius) as opposite | |
| large_radius = (chord)^2 / (8 * gr) + (gr / 2); | |
| large_d = large_radius * 2; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| ffmpeg \ | |
| -i $1 \ | |
| -r 15 \ | |
| -vf "scale=320:-1,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" \ | |
| -ss 00:00:00 -to 00:00:01 \ | |
| $2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module mold_base(len, width, height, thickness){ | |
| //floor with extra space for the walls, base corners cutout | |
| difference(){ | |
| cube([len+2*thickness,width+2*thickness, thickness]); | |
| union(){ | |
| cube(thickness); | |
| translate([len+thickness, 0, 0]) | |
| cube(thickness); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function poly_rolling_hash(seed, idx, hash, ppow, p, m) = len(seed) == idx ? | |
| hash : | |
| poly_rolling_hash(seed, idx+1, (hash + (ord(seed[idx]) - ord("a") + 1) * ppow) % m, (ppow * p) % m, p, m); | |
| function seed_from_string(string) = poly_rolling_hash(string, 0, 0, 1, 31, pow(10,9)+9); | |
| //how to use: | |
| rand_val = rands(0, 100, 1, seed_value=seed_from_string("human readable seed") ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function prettySize(bytes){ | |
| let index = 0; | |
| let suffixes = ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"]; | |
| while(bytes > 1000){ | |
| bytes = bytes/1000; | |
| index++; | |
| } | |
| return bytes.toFixed(2)+suffixes[index]; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| IPs=$(sudo arp-scan -l -q | awk '{print $1}' | grep -E [0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\} ) | |
| for ip in $IPs | |
| do | |
| #nmap -O $ip | |
| echo $ip | |
| done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //given a list of 3 element vectors and the size for each node(cylinder diameter) | |
| //this will generate a path going through each point. Especially useful for | |
| //generating models from GPX and KML files for overlaying trail geometry on top | |
| //of terrain | |
| module tracePath(path, size){ | |
| for(i=[0:len(path)-1]){ | |
| if(i+1 < len(path)){ | |
| hull(){ | |
| translate(path[i]) | |
| cylinder(d=size); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| echo $(cat /proc/sys/kernel/random/uuid) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/octave -qf | |
| %usage: ./display_heightmap.m FILENAME FILETYPE | |
| args = argv(); | |
| file_name = args{1}; | |
| file_type = args{2}; %should be one of {"srtm1", "srtm3"}% | |
| if(file_type == "srtm1") | |
| size = 3601; |