Skip to content

Instantly share code, notes, and snippets.

View sabarjp's full-sized avatar

Josh sabarjp

View GitHub Profile
@sabarjp
sabarjp / gcode end for ender3 in prusa slicer
Last active December 3, 2019 04:04
gcode end ender3 prusaslicer
G4 ; wait
M221 S100
M106 S0 ; turn off cooling fan
M104 S0 ; turn off extruder
M140 S0 ; turn off bed
G91
G1 F1800 E-3
G90
{if layer_z < max_print_height}G1 Z{z_offset+min(layer_z+30, max_print_height)}{endif} ; Move print head up
G28 X0 ; home x and y axis
@sabarjp
sabarjp / gcode start for ender3 in prusaslicer with bltouch
Last active February 22, 2023 17:20
gcode start ender3 prusaslicer
M117 Heating... ;Put printing message on LCD screen
M300 S2500 P100; Beep
M204 T1250 ; sets acceleration (P, T) and retract acceleration (R), mm/sec^2
M221 S{if layer_height<0.075}100{else}100{endif} ; Set flow
M104 S140 ; set extruder temp
M140 S[first_layer_bed_temperature] ; set bed temp
;G1 Z50 ; this is a good start heating position
G28 X Y; Home X Y
G1 Y10 ; this is a good start heating position
@sabarjp
sabarjp / matrix_math.js
Created February 18, 2016 17:44
js matrix math
function makeMatrixFromVec2(x, y) {
return [
x, 0, 0,
0, y, 0,
0, 0, 0
];
}
function makeVec2FromMatrix3(mat3) {
return {
@sabarjp
sabarjp / liner.js
Created September 14, 2015 04:25
Node line reader example
var stream = require('stream')
var liner = new stream.Transform({objectMode: true})
liner._transform = function(chunk, encoding, done){
var data = chunk.toString();
if (this._lastLineData){
data = this._lastLineData + data;
}
var lines = data.split('\n');