Skip to content

Instantly share code, notes, and snippets.

get-backup-filepath() {
PS3='Pick a file to revert from: '
select fname in $(head -n 10 <(ls $BACKUP_SAVE_LOCATION --sort=time))
do
if [[ $fname = "" ]]; then
echo $REPLY is not a valid option
else
echo "${BACKUP_SAVE_LOCATION}$fname"
break
fi
;;; Emojis bro
(use-package emojify
:hook (after-init . global-emojify-mode))
@dylan-sessler
dylan-sessler / anonymous-gist.
Created March 4, 2022 01:52
you gotta have it evan
;;; Emojis bro
(use-package emojify
:hook (after-init . global-emojify-mode))
@dylan-sessler
dylan-sessler / anonymous-gist.js
Created March 4, 2022 16:37
we did the thing
const perPartVolumeRemoved = perPartCostMaterial - partGroup.part.volume
const roughingTime = partGroup.part.cncRoughingTools.reduce((accumulator, cncRoughingTool) =>
getRoughingTime(accumulator, cncRoughingTool, materialProductionGroupParams.cncFeedRate, perPartVolumeRemoved)
, 0)
@dylan-sessler
dylan-sessler / anonymous-gist.js
Created March 4, 2022 16:38
we did the thing!
const perPartVolumeRemoved = perPartCostMaterial - partGroup.part.volume
const roughingTime = partGroup.part.cncRoughingTools.reduce((accumulator, cncRoughingTool) =>
cncRoughingToolsToRoughingTime(accumulator, cncRoughingTool, materialProductionGroupParams.cncFeedRate, perPartVolumeRemoved)
, 0)
@dylan-sessler
dylan-sessler / anonymous-gist.js
Created March 4, 2022 20:02
other code point
function cncRoughingToolsToRoughingTime(accumulator, cncRoughingTool, feedRate, perPartVolumeRemoved) {
const volumeToRemove = perPartVolumeRemoved * cncRoughingTool.volumeRatio
const widthOfCut = cncRoughingTool.diameter / 4
const depthOfCut = cncRoughingTool.diameter / 4
const removalRate = widthOfCut * depthOfCut * feedRate
const toolRoughingTime = volumeToRemove / removalRate
return accumulator + toolRoughingTime
}
;; This buffer is for text that is not saved, and for Lisp evaluation.
;; To create a file, visit it with <open> and enter text in its buffer.
function fixedCostImTooling(partGroup, materialProductionGroupParams) {
const NUMBER_OF_SETUPS = 2 // This is because there are two parts of a mold
const fixedPartCostLabor = (
materialProductionGroupParams.fixedPartReviewLabor +
materialProductionGroupParams.fixedPartPostProcessingLabor +
materialProductionGroupParams.fixedPartProgrammingLabor +
materialProductionGroupParams.productionToolDialInFixed +
materialProductionGroupParams.productionToolDialInVariable * partGroup.part.surfaceArea +
materialProductionGroupParams.perPartSetupLabor * NUMBER_OF_SETUPS
#!/bin/bash
# This script runs an exercise program with custom intervals and exercises. The
# goal is to make sticking to a recommended program as easy as typing in the
# alias to run the script.
# I expect that this will remove the amount of internal conflict for stopping
# the program early, cheating on the amount of time for each exercise, and just
# generally reduce the amount of internal noise experienced on a daily basis. I
# see this as a decision fatigue reduction technique. People like being told
module.exports = async function primitiveCost(productionGroup){...}
// ⚠ CIRCULAR DEPENDENCY WEIRDNESS ⚠
// We truly want a circular dependency in our application because we happen to
// use another manufacturing process (SLA) in order to manufacture the master
// for casted parts. This just requires a specific sequencing of exports and
// requires as outlined in https://stackoverflow.com/a/21264251
// Just make sure your necessary exports (primitiveCost) are defined before you
// require a file with a circular dependency. Node tries to prevent infinite loops and handles circular dependencies as follows: