Skip to content

Instantly share code, notes, and snippets.

View fl0aten's full-sized avatar
🐢
World's okayest developer.

Dominic Holzinger fl0aten

🐢
World's okayest developer.
View GitHub Profile
# In order to use this you need to increase max_extrude_cross_section in your extruder config or klipper will complain. I set mine to 30
[gcode_macro PURGE_BLOB]
gcode:
# This is for a 300mm bed. If you have a diferent bed size you may want to adjust the line below
{% set rand_pos = (105 + ( printer.system_stats.cputime * 1000 ) % 60) %} ; Generate pseudo random start pos so we dont wear out that one spot on the bed.
M117 Purging at X{ rand_pos }
# The start pos will be within the "handle" of the flex plate where there is some extra Y space available so we can go all the way to Y0
# If your setup does not have this extra space then just increase the y valie in the line "G1 X{ rand_pos } Y0 Z1 F18000"
G92 E0 ; zero the extruder
@nandoquintana
nandoquintana / instagram_hashtags.py
Created December 5, 2019 09:51
Find instagram hashtags through a regular expression in Python
import re
txt = """
hola @gorka!!!!!! #ñam???? #normal #subtêrráneo @nandoquintana #puravida!!! #espagne🇪🇸
#凤凰卫视
"""
not_in_hashtags = "\"$%&'()*+,-./:;<=>?[\]^`{|}~\n#@ "
hashtags = re.findall(f'\#[^{re.escape(not_in_hashtags)}]+', txt)
@syntaqx
syntaqx / cloud-init.yaml
Last active March 26, 2024 21:02
cloud init / cloud config to install Docker on Ubuntu
#cloud-config
# Option 1 - Full installation using cURL
package_update: true
package_upgrade: true
groups:
- docker
system_info:
@inso
inso / Nginx redirect to named location
Last active February 27, 2024 17:46 — forked from ilguzin/nginx_redirect_2named_location
NGINX: Redirect from current location into named location
# Solution 1
# Use only codes greater than 418, do not use common status codes 404, 402, 403, etc
location /location1 {
error_page 463 = @app; return 463;
}
# Solution 2 (drawbacks unknown)
location /location2 {
try_files /dev/null @app;
}
/* VT100 terminal reset (<ESC>c) */
console.log('\033c');
/* numbers comparations */
> '2' == 2
true
> '2' === 2