Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@jdembowski
jdembowski / destination-list-api.py
Created November 27, 2023 18:47
destination-list-api.py
#!/usr/bin/python3
import requests, json, sys, re
api_org = '2323049'
# Read the Management API base64 of the management key and secret.
#
# Key: yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
# Secret: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
@jdembowski
jdembowski / wp-rest-api-example.py
Last active January 17, 2024 21:07
Use cookie authentication to obtain a nonce for WP REST API calls that need authentication.
#!/usr/bin/python3
# This Python script will
#
# - Log into a WordPress installation using supplied credentials.
# - Get a single published post using the REST call /wp/v2/posts
# - Get a valid nonce from '/wp-admin/post.php?post=xxx&action=edit'
# - Use cookie+nonce to retrieve on post in draft status via REST.
#
# Getting that valid nonce must be performed prior to each WP REST call
@jdembowski
jdembowski / Configuration.h
Created June 19, 2019 00:18
Anycubic Delta Linear with inductive probe
/**
* Marlin 3D Printer Firmware
* Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
@jdembowski
jdembowski / Configuration_adv.h
Created January 18, 2019 01:07
Wanhao Duplicator i3 V2 Configuration_adv.h for Marlin 1.1.9
/**
* Marlin 3D Printer Firmware
* Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
@jdembowski
jdembowski / Configuration.h
Created January 18, 2019 01:06
Wanhao Duplicator i3 v2 Marlin 1.1.9 Configuration.h file
/**
* Marlin 3D Printer Firmware
* Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
#!/usr/bin/python
# This will need the investigate module installed via 'pip install investigate'
import investigate, json, fileinput, codecs, sys, os, requests, time, re
def slice(l, n):
n = max(1, n)
return [l[i:i + n] for i in range(0, len(l), n)]
# Read key, single line
with open('api-key.txt', 'r') as k:
@jdembowski
jdembowski / functions.php
Created July 22, 2018 12:04
Doctorial Child theme functions.php file
<?php
add_action( 'wp_enqueue_scripts', 'doctorial_child_enqueue_styles' );
function doctorial_child_enqueue_styles() {
$parent_style = 'parent-style';
wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
wp_enqueue_style( 'child-style',
@jdembowski
jdembowski / style.css
Created July 22, 2018 12:04
Child theme style.css file for Doctorial
/*
Theme Name: Doctorial Child theme
Description: A Child theme to remove the theme author's credits from the theme's footer
Version: 0.1
Template: doctorial
*/
<?php
/*
Plugin Name: Make new sites in the network with https URLs
Description: Force new sites in a multisite network to use HTTPS as the scheme.
Plugin Author: Jan Dembowski
This probably should not be necessary and the scheme should be picked up
by WordPress. But I could not get my new sites to use https so here I am.
Slic3r 1.2.9
Start G-code
M116 ; Wait until target temperatures for extruder and heated bed are reached
G28 ; home all axes
M117 Printing...
G0 Z0.3 ; drop to start height
G0 Y3 ; move to edge of print area
G0 X50 F5000 ; move to front of bed