Skip to content

Instantly share code, notes, and snippets.

View tuannat's full-sized avatar

Tuan Nguyen tuannat

View GitHub Profile
@tuannat
tuannat / Snapshots.cfg
Created May 8, 2023 02:06 — forked from wbatty/Snapshots.cfg
Example of how to setup Klipper to use the gocode_shell_command to do timelapse (pre mainsail built in timelapse)
# Requires `gcode_shell_command` extension to Moonraker (installing via KIUAH is the easy way)
# Requires gphoto2 http://www.gphoto.org/
[gcode_shell_command gphoto2_trigger_snapshot]
command: gphoto2 --auto-detect --trigger-capture
timeout: 10. ; make sure this is long enough to account for focus time
verbose: True
[gcode_shell_command gphoto2_init_camera]
command: gphoto2 --auto-detect --set-config capturetarget=1
[printer]
kinematics: delta
max_velocity: 250
max_accel: 2500
max_accel_to_decel: 999999
max_z_accel: 2500
minimum_z_position: 0
square_corner_velocity: 5
print_radius: 130 #
@tuannat
tuannat / readme.md
Created December 18, 2021 04:08 — forked from ChipCE/readme.md
Klipper bed mesh on print area only macro install guide

Klipper mesh on print area only install guide

What this macro do

  • This macro will dymanic change the bed_mesh area based on the size of the printed part. The fw will only probe on the area that the part will be printed (plus mesh_area_offset value)

Setup guide

  • (1) Add the following macrro to your printer config, this will replace the default BED_MESH_CALIBRATE command.
@tuannat
tuannat / add_printer.png
Created December 1, 2021 00:00
notes on how to multiply klipper-instances (and moonraker) to have a multi-printer setup using https://github.com/cadriel/Fluidd (and/or https://github.com/cadriel/FluiddPI)
add_printer.png
class Graph {
num nodesNumber;
List<List<num>> edges;
Graph(this.nodesNumber, List<List<num>> edges) {
this.edges = new Iterable.generate(nodesNumber,
(_) => new List.fixedLength(nodesNumber)).toList();
for (var e in edges) edge(e[0], e[1], e[2]);
}
# -*- coding: utf-8 -*-
import Image
def resize_and_crop(img_path, modified_path, size, crop_type='top'):
"""
Resize and crop an image to fit the specified size.
args:
img_path: path for the image to resize.
{
"auto_complete_delay": 500,
"caret_style": "solid",
"color_scheme": "Packages/Theme - Flatland/Flatland Monokai.tmTheme",
"detect_indentation": false,
"draw_white_space": "all",
"ensure_newline_at_eof_on_save": true,
"file_exclude_patterns":
[
"*.pyc",
@tuannat
tuannat / google_twunter_lol
Created October 31, 2012 01:33 — forked from jamiew/google_twunter_lol
All the dirty words from Google's "what do you love" project: http://www.wdyl.com/
easterEgg.BadWorder.list={
"4r5e":1,
"5h1t":1,
"5hit":1,
a55:1,
anal:1,
anus:1,
ar5e:1,
arrse:1,
arse:1,
@tuannat
tuannat / chat-frontend.js
Created October 29, 2012 02:01 — forked from martinsik/chat-frontend.js
Node.js chat frontend and server
$(function () {
"use strict";
// for better performance - to avoid searching in DOM
var content = $('#content');
var input = $('#input');
var status = $('#status');
// my color assigned by the server
var myColor = false;

Fixing npm On Mac OS X for Homebrew Users

If you just want to fix the issue quickly, scroll down to the "solution" section below.

Explanation of the issue

If you're a Mac Homebrew user and you installed node via Homebrew, there is a major philosophical issue with the way Homebrew and NPM work together. If you install node with Homebrew and then try to do npm update npm -g, you will see an error like this:

$ npm update npm -g