Skip to content

Instantly share code, notes, and snippets.

@llamasoft
llamasoft / holder.scad
Last active August 2, 2017 20:53
Film Canister Holder
inches = 25.4;
module HexPack(rows, columns, spacing) {
// Assuming the circles are hexagonally packed,
// this is how far their center points are from each other.
// We can find the y spacing of the center points using the Pythagorean theorem because
// the center points between three adjacent circles will form an equilateral triangle.
function pythag(side, hypot) = sqrt(pow(hypot, 2) - pow(side, 2));
hex_x_spacing = spacing;

Keybase proof

I hereby claim:

  • I am llamasoft on github.
  • I am llamasoft (https://keybase.io/llamasoft) on keybase.
  • I have a public key ASCjasuNkOapoGGjEQ0f6CsGhn5hJcXGqW8i100XUUn_pwo

To claim this, I am signing this object:

@llamasoft
llamasoft / wordnet_parse.pl
Created December 6, 2016 18:14
Princeton WordNet Parser Short Example
#!/usr/bin/perl
while (my $line = <>) {
# If no 8-digit byte offset is present, skip this line
if ( $line !~ /^[0-9]{8}\s/ ) { next; }
chomp($line);
my @tokens = split(/ /, $line);
shift(@tokens); # Byte offset
shift(@tokens); # File number
@llamasoft
llamasoft / wordnet_parse.pl
Created December 6, 2016 18:14
Princeton WordNet Database Parser Example
#!/usr/bin/perl
use strict;
use warnings;
# Parses a synonym set line from a data.* file into a Synset hash
sub parse_synset($) {
my $line = shift(@_);