Skip to content

Instantly share code, notes, and snippets.

View karacas's full-sized avatar
🏠
Working from home

Karacas karacas

🏠
Working from home
  • Bs.As.
View GitHub Profile
@heiso
heiso / printer.cfg
Last active September 9, 2024 16:48
Klipper printer config - Artillery Genius (MKS gen L)
[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
@dsmith73
dsmith73 / brew-wsl.md
Last active September 3, 2024 06:49
install homebrew on wsl

Installing homebrew / Linuxbrew on Ubuntu-18.04 wsl for Windows 10


open wsl command line

type -

sh -c "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)"  
@tomhicks
tomhicks / plink-plonk.js
Last active July 26, 2024 01:10
Listen to your web pages
@manuelbl
manuelbl / README.md
Created August 3, 2019 09:12
ESP32 as Bluetooth Keyboard

ESP32 as Bluetooth Keyboard

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:

  1. Go to your computers/phones settings
  2. Ensure Bluetooth is turned on
@kevbost
kevbost / WSL Install Guide.md
Created January 25, 2018 19:21
WSL Install Guide Windows

Ubuntu

Windows Subsystem for Linux [Very Easy Installation]

  1. https://msdn.microsoft.com/commandline/wsl/install_guide
    • [Follow instructions carefully and remember your password]
    • [it will prompt for password]
    • [password will not appear while you type, just push enter when finished]
  2. Open "Bash on Ubuntu on Windows"
  3. Run the commands formatted as code separately
  • (they will take a while to complete)
@kitze
kitze / conditionalwrap.js
Created October 25, 2017 16:54
one-line React component for conditionally wrapping children
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>}
>
@kidGodzilla
kidGodzilla / mailthisto-ajax-example.js
Last active April 26, 2023 19:57
MailThis.to Ajax Example
// 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'
});
@chrisveness
chrisveness / crypto-aes-gcm.js
Last active October 5, 2024 16:59
Uses the SubtleCrypto interface of the Web Cryptography API to encrypt and decrypt text using AES-GCM (AES Galois counter mode).
/**
* 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');
@AndiDittrich
AndiDittrich / AesUtil.js
Last active January 7, 2024 03:47
Node.js - AES Encryption/Decryption with AES-256-GCM using random Initialization Vector + Salt
// 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
//
// +--------------------+-----------------------+----------------+----------------+
@skeggse
skeggse / crypto-pbkdf2-example.js
Last active September 22, 2024 06:41
Example of using crypto.pbkdf2 to hash and verify passwords asynchronously, while storing the hash and salt in a single combined buffer along with the original hash settings
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