Skip to content

Instantly share code, notes, and snippets.

View tobihans's full-sized avatar
🙃
Keep it Super Simple !

Hans Bignon K. Tognon tobihans

🙃
Keep it Super Simple !
View GitHub Profile

Handover documentation

Here's a list of things I find useful to check off when writing handover documentation for source code.

General sanity checks

These get checked at the end, but they're at the front of the document because they're good to keep in mind the whole time

  • Do these instructions work cross-platform? If not, which platform do they work on?
  • If the source of truth is not this document, should some of the questions be answered with links (to eg confluence/other repos)
@tobihans
tobihans / pattern_matching.md
Created October 10, 2024 00:16 — forked from spr2-dev/pattern_matching.md
A quick beginner guide on Lua pattern matching

Lua Pattern Matching Cheat Sheet

Table Of Contents

  1. What's a pattern ?
  2. Positional characters
  3. Common matching characters
  4. Ranges, character sets and logic
  5. Quantifiers
  6. Capture groups
  7. Examples
@tobihans
tobihans / Restore the GRUB Bootloader.md
Created September 21, 2024 19:30 — forked from dianjuar/Restore the GRUB Bootloader.md
Restore the GRUB Bootloader on Manjaro Linux. Usefull when your fresh windows install eats your grub and can not boot into your linux installation, or for some how your grub is missing

Restore the GRUB Bootloader on Manjaro

  1. Chroot into your linux instalation
    1. The easiest way is with mhwd-chroot
      1. Install it yaourt -S mhwd-chroot
      2. Run it sudo mhwd-chroot
      3. DONE, you have chrooted into your linux installation (open a root console of your installed linux OS, is like just open a console with root access)
  2. Restore your GRUB
    1. Install a new GRUB bootloader with grub-install /dev/sda
  3. Recheck to ensure the that installation has completed without any errors grub-install --recheck /dev/sda
@tobihans
tobihans / simple-react-recorder.jsx
Created August 30, 2024 18:55 — forked from cassidoo/simple-react-recorder.jsx
A simple React microphone component, recording audio and showing the blob in the browser, styled with Tailwind.
"use client";
import { useState, useEffect, useRef } from "react";
function SimpleRecordButton() {
const [isRecording, setIsRecording] = useState(false);
const [audioStream, setAudioStream] = useState(null);
const [mediaRecorder, setMediaRecorder] = useState(null);
const [audioBlob, setAudioBlob] = useState(null);
const [recordingTime, setRecordingTime] = useState(0);
const timerRef = useRef(null);
@tobihans
tobihans / ffmpeg-to-480p.sh
Created August 29, 2024 15:50 — forked from blacklee/ffmpeg-to-480p.sh
ffmpeg convert video to 480p
ffmpeg -i input.mp4 -s hd480 -c:v libx264 -crf 23 -c:a aac -strict -2 output.mp4
@tobihans
tobihans / uuidv4test.js
Created July 23, 2024 12:21 — forked from johnelliott/uuidv4test.js
uuid v4 regex
import { v4 as uuid } from 'uuid';
export function generateId() {
return uuid();
}
const v4 = new RegExp(/^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i);
console.log(generateId().match(v4));
//console.log(generateId().length)
@tobihans
tobihans / colorschemes.lua
Created January 21, 2024 13:32
Neovim colorchemes I used/use/will use maybe (lazy spec)
return {
{
"gbprod/nord.nvim",
priority = 1000,
lazy = false,
enabled = true,
opts = {
transparent = false,
terminal_colors = true, -- Configure the colors used when opening a `:terminal` in Neovim
diff = { mode = "fg" }, -- enables/disables colorful backgrounds when used in diff mode. values : [bg|fg]
@tobihans
tobihans / tailwind-palettte-app.json
Created January 3, 2024 23:13 — forked from michaelroper/tailwind-palettte-app.json
Tailwind CSS default colors in Palettte.app's JSON format
[
{
"paletteName": "gray",
"swatches": [
{
"name": "100",
"color": "#f7fafc"
},
{
"name": "200",
@tobihans
tobihans / README.md
Created December 6, 2023 06:46 — forked from jhass/README.md
Proxy to remote server with CORS support

cors.py for mitmproxy

Hacking CORS restriction to enable in-browser XHR to any server.

Usage

Say you are running an web app at localhost, and you want to send XHR to http://remote-server:80, but the CORS restriction forbids access because you are sending requests from an origin that remote-server:80 does not allow.

Run:

@tobihans
tobihans / git lol.md
Created November 17, 2023 10:11 — forked from Omerr/git lol.md
git lol - an alias to Git that shows the commit graph in a pretty format

log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit

To configure as an alias git lol:

git config --global alias.lol "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)&lt;%an&gt;%Creset' --abbrev-commit"