Skip to content

Instantly share code, notes, and snippets.

View aaaidan's full-sized avatar

Aidan Fraser aaaidan

  • Sunnyvale, California
  • 08:58 (UTC -07:00)
View GitHub Profile
;;;;;
;;;;; Start G-code
;;;;;
; Ender 3 Custom Start G-code
G92 E0 ; Reset Extruder
G28 ; Home all axes
G90 ; Absolute mode
G1 Z2.0 F3000 ; Move Z Axis up little to prevent scratching of Heat Bed
G1 X0.1 Y20 Z0.3 F5000.0 ; Move to start position
@aaaidan
aaaidan / find-toplevel-node-modules-folders.js
Created May 23, 2017 12:57
Helps find node packages you don't need anymore, so you can delete them (or their node_modules)
// Hello
// If you have installed a lot of node packages, your filesystem can become slow, especially
// with npm v2.
// This tool helps you find node projects you forgot about, so you can delete their
// node_modules folders manually.
//
// The only filesystem calls in this script are `readdirSync` and `lstatSync`. Even though
// you trust me, I'd say you are probably the kind of thorough person who will just quickly
// check I'm not lying.
@aaaidan
aaaidan / justify-in-place.js
Created November 3, 2015 23:23
Justify Text Objects "in Place" (Illustrator Script)
///// Justify Text Objects "in place"
/////
///// This script processes the selection in Illustrator, to modify the justification
///// of text fields while preserving their apparent position.
/////
///// This can be useful when many text areas are correctly positioned, but their
///// justification means changing the text content moves them incorrectly.
/////
///// To run, select the text you want to realign, then drop this script file into
///// the document and follow the instructions.
// Run in console, or make a bookmarklet
window.rate1 = 0.0014726723, window.rate2 = 0.003128647, window.rate3 = 0.002828365;
(function() {
var all = document.querySelectorAll("*");
[].forEach.call(all,function(a) { a.style.outline="2px solid #000"; });
var lol = function (t) {
[].forEach.call(all,function(a, i, _){
var r = (Math.sin(t * rate1 + i*123123) * 127.5 + 127.5) << 0,
g = (Math.sin(t * rate2 + i*456456) * 127.5 + 127.5) << 0,
b = (Math.sin(t * rate3 + i*789789) * 127.5 + 127.5) << 0;