Skip to content

Instantly share code, notes, and snippets.

@mscalora
mscalora / overrides.ini
Created November 24, 2023 16:53
Prusa Slicer Defaults Test INI
[print:*common*]
perimeters = 4
skirts = 0
first_layer_speed = 18
[print:*MK4*]
first_layer_speed = 19

Prusa Slicer Default Print Settings

Description

I hate skirts, I find them to be a big waste of time, a small waste of filament with little or no value. The purge line in the preamble is plenty for my printer. I got tired of turning them off manually every time I used a built-in print setting. By editing this file you can change the built-ins although you have to do this again every time a new "settings update" is applied. In the future I might automate the process with a file watcher mechanism that will run every night or something. I also like to print with at least 3 parimeters and I slow down the first layer by 10% from the usual 20.

Edit

@mscalora
mscalora / server.py
Created November 23, 2022 14:34
Python 3 HTTP Server Example
from http.server import BaseHTTPRequestHandler, HTTPServer
from urllib import parse
import json
def run_server(port):
class Server(BaseHTTPRequestHandler):
def do_GET(self):
self.send_response(200)
#!/usr/bin/env node
# credit to Lenny Domnitser for the logic of this tool, see: https://domnit.org/blog/2007/07/fix-encoding.html
#
# This tool will fix encoding errors in text files. In my case a sql backup file contained latin1 char
# sequences that appeared like: The “magic” of ’THings’
#
# Usage: fix_encodings.js <in-file> [<out-file>]
#

Keybase proof

I hereby claim:

  • I am mscalora on github.
  • I am mscalora (https://keybase.io/mscalora) on keybase.
  • I have a public key ASBipYrZDCrdzGvlafxUvRxpYnb_7D_AWslP7efmBgH5vAo

To claim this, I am signing this object:

@mscalora
mscalora / ttd_dom_ready.js
Created April 3, 2021 11:35
simplified ttd_dom_ready - does not support (old) IE
(function (){
window.ttd_dom_ready = window.ttd_dom_ready || function (cb) {
if (document.readyState === "complete" ||
(document.readyState !== "loading" && !document.documentElement.doScroll)) {
cb();
} else {
let mcb = () => {
document.removeEventListener("DOMContentLoaded", mcb);
cb();
};
@mscalora
mscalora / counter.html
Last active March 15, 2021 13:38
Perfect JS Counter
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Counter</title>
<style>
html {
height: 100%;
margin: 0;
padding: 0;
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>☃️</text></svg>">
@mscalora
mscalora / spin-the-needle.js
Created April 1, 2020 18:48
Work towards a spin the needle animation using SVG
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Make</title>
<style>
</style>
</head>
<body>
// From: NicolasLetellier @ https://gist.github.com/Yimiprod/7ee176597fef230d1451#gistcomment-3058093
function objectDiff(object, base) {
function changes(object, base) {
const accumulator = {};
Object.keys(base).forEach((key) => {
if (object[key] === undefined) {
accumulator[`-${key}`] = base[key];
}
});