Skip to content

Instantly share code, notes, and snippets.

View miraclx's full-sized avatar
🦀
Pirate of the Crab-ibean

Miraculous Owonubi miraclx

🦀
Pirate of the Crab-ibean
View GitHub Profile
Frame 24: 1514 bytes on wire (12112 bits), 1514 bytes captured (12112 bits)
-> 1st fragment
Frame 26: 1514 bytes on wire (12112 bits), 1514 bytes captured (12112 bits)
-> 2nd fragment
Frame 28: 1166 bytes on wire (9328 bits), 1166 bytes captured (9328 bits)
-> 3rd/final fragment
Ethernet II, Src: ... (...), Dst: IPv4mcast_fb (01:00:5e:00:00:fb)
Internet Protocol Version 4, Src: 10.130.27.220, Dst: 224.0.0.251
User Datagram Protocol, Src Port: 38395, Dst Port: 5353
Multicast Domain Name System (response)
@truebit
truebit / alacritty.yml
Last active November 4, 2025 09:00 — forked from programus/alacritty.yml
pull down from top alacritty (like iTerm2)
window:
# Window dimensions (changes require restart)
#
# Number of lines/columns (not pixels) in the terminal. The number of columns
# must be at least `2`, while using a value of `0` for columns and lines will
# fall back to the window manager's recommended size.
dimensions:
columns: 500
lines: 30
@rctlmk
rctlmk / Cargo.toml
Created April 21, 2023 23:37
SplitPane
[dependencies]
egui = "0.21"
egui_extras = "0.21"
eframe = "0.21"
@toksdotdev
toksdotdev / why-size-of-option-t-is-doubled.md
Last active May 9, 2022 16:21
An explanation of why the size of Option<T> is always often double the size of T

Someone asked a question some weeks back about why size_of::<Option<T>> is always double. Answer is because of alignment.

Explanation

How are Rust enum represented in C?

C doesn't have the ability to directly represent complex Rust enum, hence, the need for a workaround. To understand that, let's take a look at how Option<i32> is represnted in C.

E.g. Given:

@miraclx
miraclx / index.html
Created February 15, 2021 03:23
join_split vs split_flat (https://jsbench.github.io/#355b4874bc15a7566433f1976369d984) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>join_split vs split_flat</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
@miraclx
miraclx / GitHubRepoSize.user.js
Last active November 17, 2023 16:44
Calculate repo size and inject into GitHub page
// ==UserScript==
// @name GitHub Repo Size
// @namespace https://gist.github.com/miraclx/aad03f43fe8ac85682b0243f4f242f0d
// @description Calculate repo size and inject into GitHub page
// @icon https://github.githubassets.com/favicons/favicon.png
// @version 0.2.0
// @author miraclx
// @license Apache-2.0
// @supportURL https://gist.github.com/miraclx/aad03f43fe8ac85682b0243f4f242f0d
// @grant GM_xmlhttpRequest
@miraclx
miraclx / discharge.txt
Last active January 18, 2021 07:45
Instructions for disabling hibernate/hybrid sleep when battery critical on Linux
First, not hibernate
You actually want to disable hybrid sleep
You may not already know it, but trust me
That's what you want
Okay? Good
  1. apt install bbswitch
  2. /etc/modprobe.d/bbswitch.conf
        options bbswitch load_state=0 unload_state=1
    To run bbswitch without bumblebeed on system startup, do not forget to add bbswitch to /etc/modules-load.d.
    nano /etc/modules-load.d
        bbswitch
@anildigital
anildigital / cleanup_swap.md
Last active December 2, 2025 07:45
Cleanup swap space on macOS

To see current swap usage

sysctl -a | grep swap

Use only when when your system is in a very bad shape

$ sudo pkill -HUP -u _windowserver 
@Ikxyz
Ikxyz / NUBAN
Created September 27, 2019 15:23
Nigeria Uniform Bank Account Number (NUBAN) IN A JSON ARRAY
const NUBAN = [
{"bank": "ACCESS BANK", "code": "044"},
{"bank": "ACCESSMOBILE", "code": "323"},
{"bank": "ASO SAVINGS AND LOANS", "code": "401"},
{"bank": "CELLULANT", "code": "317"},
{"bank": "CENTRAL BANK OF NIGERIA", "code": "001"},
{"bank": "CITIBANK", "code": "023"},
{"bank": "CORONATION MERCHANT BANK", "code": "559"},
{"bank": "CORPORETTI", "code": "310"},
{"bank": "COVENANT MICROFINANCE BANK", "code": "551"},