Skip to content

Instantly share code, notes, and snippets.

View hacheraw's full-sized avatar
🙈
life is soup i am fork

Hache_raw hacheraw

🙈
life is soup i am fork
View GitHub Profile
@hacheraw
hacheraw / cheatsheet.md
Last active February 22, 2022 18:09
Chuleta de comandos

Sólo notas personales para que mi yo del futuro lo tenga más fácil

Imágenes

Cambiar ppp de imágenes recursivamente

find . -name "*.jpg" -type f | xargs -0 -d '\n' mogrify -density 72 -units PixelsPerInch

NodeJS + Plesk + nginx + HTTPS (wss://)

Connecting to a WebSocket server via WebSocket Secure connection (wss://) on a Plesk based host.

Create a subfolder or subdomain

As I'm going to have only one NodeJS, I prefer a subdomain: sockets.example.com If you will have several NodeJS Apps you may want something like example.com/socket1, example.com/socket2, ...

Optional: disable PHP

As I will only use NodeJS on that subdomain, and I will redirect all traffic to NodeJS, it is safe to disable PHP

@hacheraw
hacheraw / mimetypes-to-fontawesome.php
Created January 31, 2021 21:38
Mimetype to fontAwesome mapping
/**
* Devuelve un icono de fontAwesome correspondiente a un MimeType
*
* @param string $mimetype por ejemplo 'image/jpeg'
* @param string $class clases extras del icono
* @param string $style tipo de icono: fas, far...
* @return string
*/
function fileIcon(string $mimetype, string $extraClass = '', string $style = 'far'): string
{
@hacheraw
hacheraw / end.gcode
Last active April 12, 2023 18:23
Artillery Sidewinder X1 start and end gcode
M42 P4 S255 ; green led
M42 P5 S0 ; red led
M42 P6 S0 ; blue led
M117 Ta-dah!
M106 S0 ; cooling fan off
M104 S0 ; nozzle heater off
M140 S0 ; bed heater off