Skip to content

Instantly share code, notes, and snippets.

@knowuh
knowuh / photo.py
Last active May 28, 2023 10:49
Blender script to turn an image data block into 3D cubes...
import bpy
import colorsys
"""
cubify-image.py - Turns each pixel of an image into a scaled cube.
Noah Paessel | @knowuh - updated on 2022-02-13 (test w Blender 3.1b)
MIT license http://opensource.org/licenses/MIT
WARNING: This script will generate a thousands objects (one per image pixel)
I recommend only using it with image with less than 40,000 pixels (200x200).
@knowuh
knowuh / CsvToMesh.py
Created April 12, 2023 13:20
Import a CSV file to a new mesh. All the vertices will be at 0,0,0. Use GeoNodes to map attributes.
bl_info = {
"name": "CSV Mesh Importer",
"author": "Noah and GTP4 :D",
"version": (1, 0),
"blender": (3, 5, 0),
"location": "View3D > Tool Shelf > CSV Mesh Importer",
"description": "Import a mesh from a CSV file",
"category": "Import-Export",
}
Sample # Northing (UTM) Easting (UTM) North Offset (m) East Offset (m) Distance km Total thickness (cm) Mass loading (kg /m2) Deposit denisty (Kg / m3)
CN_1 526028 1380972 6357.00 1687.00 6.58 27 531.74 1107.80
CN_2 525477 1380291 6908.00 2368.00 7.30 47 286.00 1059.27
CN_3 524516 1379866 7869.00 2793.00 8.35 22 498.23 1060.06
CN_4 523595 1379462 8790.00 3197.00 9.35 21 248.27 1128.48
CN_5 522674 1379481 9711.00 3178.00 10.22 20 245.58 1169.45
CN_6 521642 1379304 10743.00 3355.00 11.25 15 235.00 1175.02
CN_7 520715 1378964 11670.00 3695.00 12.24 11 171.60 1143.99
CN_8 519877 1378201 12508.00 4458.00 13.28 5 120.24 1093.08
CN_9 520742 1379432 11643.00 3227.00 12.08 13 62.85 1256.96
@knowuh
knowuh / keybase.md
Created August 20, 2018 19:47
public keybase.io verification

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@knowuh
knowuh / ordered_by_helper.rb
Created August 29, 2013 17:07
rspec matcher for checking that a collection is sorted by an attribute
RSpec::Matchers.define :be_ordered_by do |attribute|
match do |actual|
result = true
reverse_indicator = "_desc"
if attribute =~ /#{reverse_indicator}/
symbol = attribute.gsub(/#{reverse_indicator}/,'').to_sym
sorted = actual.sort{ |a,b| b.send(symbol) <=> a.send(symbol)}
else
sorted = actual.sort{ |a,b| a.updated_at <=> b.updated_at}
end
@knowuh
knowuh / proposed-rubric.json
Last active February 23, 2018 22:22
Proposed rubric format ( NP 2018-02-23)
{
"id": "RBK1",
"version": "12",
"updatedMsUTC": 1519424087822,
"originUrl": "http://concord.org/rubrics/RBK1.json",
"scoreUsingPoints": false,
"showRatingDescriptions": false,
"criteria": [{
"id": "C1",
"description": "Use mathematical and/or computational representations to support explanations of factors that affect carrying capacity of ecosystems at different scales. ",
@knowuh
knowuh / convert_sass_to_scss
Created September 2, 2011 20:03
convert sass to scss by example
#convert .sass files to scss files:
bundle exec sass-convert -R --from sass --to scss ./public/stylesheets/sass/
# delete the old sass files:
find ./public/stylesheets/sass -name "*.sass" | xargs rm
# rename the directory.
mv ./public/stylesheets/sass ./public/stylesheets/scss
@knowuh
knowuh / es_input.cfg
Created September 1, 2017 20:17
Emulation Station Controller Configuration file 2017-09-01 paessel
<?xml version="1.0"?>
<inputList>
<inputConfig type="joystick" deviceName="USB Gamepad " deviceGUID="03000000790000001100000010010000">
<input name="a" type="button" id="1" value="1" />
<input name="b" type="button" id="2" value="1" />
<input name="down" type="axis" id="1" value="1" />
<input name="hotkeyenable" type="button" id="8" value="1" />
<input name="left" type="axis" id="0" value="-1" />
<input name="leftshoulder" type="button" id="4" value="1" />
<input name="right" type="axis" id="0" value="1" />
import SharingContext from "./sharing-context"
export type Jpeg = {type: "image/jpeg", extension: "jpg" }
export type Csv = {type: "text/csv", extension: "csv" }
export type Binary = {type: "application/octet-stream", extension: "bin" }
export type Json = {type: "application/json", extension: "json" }
export type RepresentationType = Jpeg | Csv | Binary | Json
export type Url = string
var width = 500;
var height = 500;
var radius = 5;
var margin = { top:10, bottom:60, left:25, right:10 }
var scatterPlot;
var scaleHRs;
var scaleGames;
var svg;
var data;