open wsl command line
type -
sh -c "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)" | [include mainsail.cfg] | |
| [gcode_macro _CLIENT_VARIABLE] | |
| variable_use_custom_pos : False ; use custom park coordinates for x,y [True/False] | |
| variable_custom_park_x : 0.0 ; custom x position; value must be within your defined min and max of X | |
| variable_custom_park_y : 0.0 ; custom y position; value must be within your defined min and max of Y | |
| variable_custom_park_dz : 2.0 ; custom dz value; the value in mm to lift the nozzle when move to park position | |
| variable_retract : 1.0 ; the value to retract while PAUSE | |
| variable_cancel_retract : 5.0 ; the value to retract while CANCEL_PRINT | |
| variable_speed_retract : 35.0 ; retract speed in mm/s |
| /* | |
| Copy this into the console of any web page that is interactive and doesn't | |
| do hard reloads. You will hear your DOM changes as different pitches of | |
| audio. | |
| I have found this interesting for debugging, but also fun to hear web pages | |
| render like UIs do in movies. | |
| */ | |
| const audioCtx = new (window.AudioContext || window.webkitAudioContext)() |
With its built-in Bluetooth capabilities, the ESP32 can act as a Bluetooth keyboard. The below code is a minimal example of how to achieve it. It will generate the key strokes for a message whenever a button attached to the ESP32 is pressed.
For the example setup, a momentary button should be connected to pin 2 and to ground. Pin 2 will be configured as an input with pull-up.
In order to receive the message, add the ESP32 as a Bluetooth keyboard of your computer or mobile phone:
| import React from 'react'; | |
| const ConditionalWrap = ({condition, wrap, children}) => condition ? wrap(children) : children; | |
| const Header = ({shouldLinkToHome}) => ( | |
| <div> | |
| <ConditionalWrap | |
| condition={shouldLinkToHome} | |
| wrap={children => <a href="/">{children}</a>} | |
| > |
| // The following example POSTS data to mailthis.to, redirects the user to a confirmation page, and then sends an email (upon the successful completion of Recaptcha verification) | |
| $.post('https://mailthis.to/test@example.com', { | |
| email: 'foo@bar.co', | |
| _subject: 'hi!', | |
| message: 'Test' | |
| }).then(function () { | |
| location.href = 'https://mailthis.to/confirm' | |
| }); |
| /** | |
| * Encrypts plaintext using AES-GCM with supplied password, for decryption with aesGcmDecrypt(). | |
| * (c) Chris Veness MIT Licence | |
| * | |
| * @param {String} plaintext - Plaintext to be encrypted. | |
| * @param {String} password - Password to use to encrypt plaintext. | |
| * @returns {String} Encrypted ciphertext. | |
| * | |
| * @example | |
| * const ciphertext = await aesGcmEncrypt('my secret text', 'pw'); |
| // SPDX-License-Identifier: MPL-2.0 | |
| // AES Encryption/Decryption with AES-256-GCM using random Initialization Vector + Salt | |
| // ---------------------------------------------------------------------------------------- | |
| // the encrypted datablock is base64 encoded for easy data exchange. | |
| // if you have the option to store data binary save consider to remove the encoding to reduce storage size | |
| // ---------------------------------------------------------------------------------------- | |
| // format of encrypted data - used by this example. not an official format | |
| // | |
| // +--------------------+-----------------------+----------------+----------------+ |
| var crypto = require('crypto'); | |
| // larger numbers mean better security, less | |
| var config = { | |
| // size of the generated hash | |
| hashBytes: 32, | |
| // larger salt means hashed passwords are more resistant to rainbow table, but | |
| // you get diminishing returns pretty fast | |
| saltBytes: 16, | |
| // more iterations means an attacker has to take longer to brute force an |