Skip to content

Instantly share code, notes, and snippets.

const EventEmitter = require('events')
class TestEmitter extends EventEmitter {
constructor( opts = {} ) {
super(opts)
this.name = opts.name
this.testFireIncrementer = 0
}
testFire() {
const init = function(type) {
let id = 0;
return (name, props=null) => {
id +=1;
return {
id,
type,
name,
...props
}
#! /bin/bash
find_me="Process image"
results=()
next_idx=0
while read -r LineFromFile || [[ -n "${LineFromFile}" ]]; do
if [[ $LineFromFile =~ "$find_me" ]]; then
results[$next_idx]=$LineFromFile
next_idx=$((next_idx+1))
fi
@ocommaj
ocommaj / __init__.py
Last active May 3, 2021 03:33
DemoRack
bl_info = {
"name": "DemoRack",
"description": "Make Mini Rack Units Dynamically",
"author": "Jim O'Connor <hello@ocommaj.com>",
"version": (0, 0, 1),
"blender": (2, 90, 1),
"category": "3D View"
}
module_names = [ 'standoff_props', 'standoff_operator', 'standoff_panel' ]
@ocommaj
ocommaj / enderReact.js
Last active April 28, 2021 19:38
Hiring Process Challenge for Ender Property Management - React Todo List
import React, { useState } from "https://cdn.skypack.dev/react@v17.0.1";
import ReactDOM from "https://cdn.skypack.dev/react-dom@v17.0.1";
import { v4 } from "https://cdn.skypack.dev/uuid@v8.3.1";
// use "generateId()" function to create a unique id
const generateId = v4;
function TodoForm(props) {
const { createTodo } = props;
const [inputValue, setInputValue] = useState();
@ocommaj
ocommaj / standoff_mesh.py
Last active October 19, 2021 11:06
Script using Blender Python 'bpy' and 'bmesh' modules to generate printable mounting points for different sizes of hardware
import bpy
import bmesh
class Standoff:
def __init__(self, name="Std", m_diam=3, depth=3, segments=64):
self.name = name
self.depth = depth
self.segments = segments
self.radii = self.__radii(m_diam)
import bpy
from addon_utils import check, enable
C = bpy.context
D = bpy.data
SCALE_LENGTH = 0.001
LENGTH_UNIT = 'MILLIMETERS'
MASS_UNIT = 'GRAMS'
CLIP_END = 100000
PRINT_UTIL = "object_print3d_utils"