Skip to content

Instantly share code, notes, and snippets.

@lumascet
lumascet / esphome.yaml
Last active May 17, 2024 03:29
FYSETC-E4 esphome roller blinds
substitutions:
device_name: "lush-cover-controller"
pulley_diameter_mm: "21.963"
gear_ratio: "1880/2000"
distance_mm: "2050"
acceleration: 500 steps/s^2
velocity: 2500 steps/s # 200 (motor steps) * ${microsteps}
back_off_steps: "200" # back off some steps to reduce stepper energize noise
open_current_x: 1000ma

Quick start

Tauri is shipped with state management function/feature by default.

Basic usage is quite simple: a variable of State type can be accessed on the tauri commands which you have defined; in other words, "with tauri commands, they'll magically inject state for you," so that once a variable is managed you can inject them directly as additional input when defining the command.

Example Implementation

@spiermar
spiermar / nginx.conf
Created September 12, 2018 06:42
Nginx RMTP to HLS and DASH
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
pid /var/run/nginx.pid;
events {
@MaxXor
MaxXor / btrfs-guide.md
Last active May 17, 2024 03:25
Btrfs guide to set up an LUKS-encrypted btrfs raid volume with included maintenance & recovery guide

Encrypted Btrfs storage setup and maintenance guide

Initial setup with LUKS/dm-crypt

This exemplary initial setup uses two devices /dev/sdb and /dev/sdc but can be applied to any amount of devices by following the steps with additional devices.

Create keyfile:

dd bs=64 count=1 if=/dev/urandom of=/etc/cryptkey iflag=fullblock
chmod 600 /etc/cryptkey
@rdb
rdb / js_linux.py
Last active May 17, 2024 03:24
Access joysticks/game controllers from Python in Linux via the joystick driver. See https://discourse.panda3d.org/t/game-controllers-on-linux-without-pygame/14128
# Released by rdb under the Unlicense (unlicense.org)
# Based on information from:
# https://www.kernel.org/doc/Documentation/input/joystick-api.txt
import os, struct, array
from fcntl import ioctl
# Iterate over the joystick devices.
print('Available devices:')
@EmadAdly
EmadAdly / install-android-sdk-in-ubuntu.md
Last active May 17, 2024 03:23
install JDK and Android SDK on Linux Ubuntu

install openjdk

sudo add-apt-repository ppa:openjdk-r/ppa
sudo apt-get update
sudo apt-get install openjdk-8-jdk
@aveao
aveao / bird1-bird-vultr.conf
Last active May 17, 2024 03:20
BIRD 1 and 2 configs for BGP stuffs (HE Tunnelbroker, Vultr etc)
router id [our IPv4];
protocol bgp vultr
{
local as [our ASN];
source address [our IPv4 from vultr];
import all;
export filter {
if net ~ [[the IPv4 block we want to announce]] then accept;
reject;
@cgonzalezdai
cgonzalezdai / como-subir-un-proyecto-local-a-github.md
Last active May 17, 2024 03:18
Como subir un proyecto local a github

Como subir un proyecto local a github.

desde la web de github

Creamos un nuevo repositorio en https://github.com. Le damos nombre, descripción, seleccionamos si va a ser un proyecto publico o privado si es el caso, y dejamos el check de crear README sin marcar. Le damos a crear repositorio y con esto ya tenemos el repositorio donde alojaremos nuestro proyecto.

desde la terminal del equipo donde esta el proyecto que queremos subir a github

Nos vamos a la carpeta del proyecto y ejecutamos estos comandos.

git init

git add .
@JohnCoates
JohnCoates / AutoHook.h
Created May 26, 2017 22:06
Simple Objective-C Method Hooking
@protocol AutoHook <NSObject>
@required
+ (NSArray <NSString *> *)targetClasses;
@end
@butaji
butaji / gist:1208599
Created September 10, 2011 18:17
Download all files from url with wget
wget -r -l1 -A.mp3 <url>
#http://techpatterns.com/forums/about894.html