Skip to content

Instantly share code, notes, and snippets.

@KojoBailey
KojoBailey / epub3_calibre.md
Last active January 1, 2025 22:11
My process for creating EPUB 3 digital manga

Quick copy-paste access (if you know, you know):

<spine page-progression-direction="rtl">
.calibre1 {
  display: flex;
  justify-content: center;
  align-items: center;
 height: 100vh;

ZSH CheatSheet

This is a cheat sheet for how to perform various actions to ZSH, which can be tricky to find on the web as the syntax is not intuitive and it is generally not very well-documented.

Strings

Description Syntax
Get the length of a string ${#VARNAME}
Get a single character ${VARNAME[index]}
@jetfir3
jetfir3 / download_fusion.sh
Last active January 1, 2025 22:05
Download VMware Fusion Pro Without a Broadcom Account
#!/usr/bin/env bash
# Download VMware Fusion Pro without Bcom account
#
# By default, the latest verson will be downloaded, extracted and prepped for install
# Use '-k' to keep download file compressed, exiting after download
# Use '-v VERSION' to specify desired version (13.0.0 or higher required)
KEEP_COMPRESSED=false
USER_VERSION=""
@oshea00
oshea00 / kabsch.py
Last active January 1, 2025 22:04
3D best-fit using Kabsch algorithm
import numpy as np
from math import sqrt
scaling = False
# Implements Kabsch algorithm - best fit.
# Supports scaling (umeyama)
# Compares well to SA results for the same data.
# Input:
# Nominal A Nx3 matrix of points
@timvisee
timvisee / falsehoods-programming-time-list.md
Last active January 1, 2025 21:58
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
@nakst
nakst / maths.cpp
Last active January 1, 2025 21:45
// NOTE Compile without fast math flags.
/*
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
@bramtechs
bramtechs / upgrade-debian-wsl.md
Last active January 1, 2025 21:45
Upgrade Debian 9, (current WSL) to Debian 12 (bookworm testing)

Upgrade Debian 9 (current WSL) to Debian 12 (bookworm testing)

Note: I do not maintain this gist anymore, but people report that it still works. Please check the comments for any revisions or extra things you should take into consideration.

As of writing, the Debian distro for WSL (Windows Subsystem for Linux) is quite old.

You can get more up-to-date package managers, text-editors and compilers by upgrading WSL to Debian 12 (current testing).

  • Root required
  • Use at your own risk, preferably on a fresh installation.

Protección de las credenciales enviadas por el navegador al servidor proxy

Problema

Es sabido que durante el proceso de autenticación en un servidor proxy HTTP las credenciales se envian en texto plano. Lo anterior pudiera convertirse en un problema de seguridad. Esta vulnerabilidad permite a un usuario malicioso capturar fácilmente el par usuario contraseña utilizando un ataque de tipo MitM.

Solución

Una solución viable consiste en configurar el servidor proxy con soporte para SSL, de modo que el tráfico enviado desde el navegador hacia este viaje por un canal seguro. Para esto, el navegador debe ser capaz de comunicarse con el servidor proxy a través del protocolo HTTP sobre SSL/TLS.

@aserhat
aserhat / 0 - setup
Last active January 1, 2025 21:38
QEMU and HVF
# Summary
A few notes I took to see if I could use MacOS as Hypevirsor in a similar fashion to Linux
I wanted to see how few addons were needed instead of using Parallels, Virtual Box, VM Fsion etc.
The idea is to use QEMU, Hypervisor Framework (https://developer.apple.com/documentation/hypervisor) and some custom host networking.
# Installations
brew install qemu (For controlling Hypervisor Framework)
brew install cdrtools (For making cloud init iso's)
http://tuntaposx.sourceforge.net/download.xhtml (For customer tap based networking)
@basham
basham / css-units-best-practices.md
Last active January 1, 2025 21:32
CSS Units Best Practices

CSS units

Recommendations of unit types per media type:

Media Recommended Occasional use Infrequent use Not recommended
Screen em, rem, % px ch, ex, vw, vh, vmin, vmax cm, mm, in, pt, pc
Print em, rem, % cm, mm, in, pt, pc ch, ex px, vw, vh, vmin, vmax

Relative units

Relative units