This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| """ | |
| apply_z_offset_safe.py | |
| Binary-safe Z offset applier for FlashForge .gx / generic G-code files. | |
| Designed for use with printers that have broken distance sensors or can otherwise not calibrate the z axis. | |
| FlashPrint provides an option for z offset but it only goes from -1 to 1. | |
| - Reads and writes bytes; preserves ALL non-G-code bytes, line endings, and comments. | |
| - Only modifies Z values on lines whose first non-space char is 'G' or 'M'. | |
| - Tracks absolute/relative mode via G90 / G91 in the code portion of those lines. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # qtpy_esp32s2_i2s_stream.py | |
| # | |
| # Continuous 16-kHz mono recording → HTTP POST | |
| # – no sample loss, no packet loss – | |
| # tailored for Adafruit QT Py ESP32-S2 4 MB Flash / 2 MB PSRAM | |
| # | |
| import _thread, gc, time, network, usocket | |
| from machine import Pin, I2S, reset | |
| ### ---------- user settings ---------- ### |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name MusicNerd Auto-Play, Button Selector, and Next | |
| // @namespace http://tampermonkey.net/ | |
| // @version 2.1 | |
| // @description Auto-click play button, number-key-based select song, auto press next musicnerd.io | |
| // @author archonic | |
| // @match https://musicnerd.io/quiz/* | |
| // @grant none | |
| // ==/UserScript== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Type a number and hit enter for that number's look-and-say product. | |
| # Press enter without entering a number to get the next step after the previous product. | |
| def look_and_say(num): | |
| prev_val = None | |
| occurrence = 0 | |
| new_seq = "" | |
| for i in map(int, str(num)): | |
| if i == prev_val: | |
| occurrence += 1 | |
| elif prev_val is None: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from openpyxl import Workbook, load_workbook | |
| from pathlib import Path | |
| import csv | |
| from openpyxl.utils import get_column_letter | |
| downloads_path = str(Path.home() / "Downloads") | |
| src_block_path = downloads_path + "/closed_3.xlsx" | |
| src_cells_start = "N1" | |
| src_cells_end = "X5" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.Arrays; | |
| import java.util.Scanner; | |
| public class ParseUtility { | |
| static String[] asArray(String line){ | |
| return line.split(" "); | |
| } | |
| static int[] asIntArray(String line){ | |
| return asIntArray(asArray(line)); |