Skip to content

Instantly share code, notes, and snippets.

View emadabdulrahim's full-sized avatar
🎨
Designing

Moody (Emad Abdulrahim) emadabdulrahim

🎨
Designing
View GitHub Profile
@imWildCat
imWildCat / codex-gpt-5-codex.sh
Last active October 29, 2025 04:23
codex-enhanced by Ian Nuttall on X
# from: <https://x.com/iannuttall/status/1965090297630826931>
cdx() {
if [[ "$1" == "update" ]]; then
npm install -g @openai/codex@latest
else
codex -m gpt-5-codex --yolo -c model_reasoning_effort="high" -c model_reasoning_summary_format=experimental --search "$@"
fi
}
# Note: with auto confirmation. use at your own risk. thanks!
import React from "react";
export type ColorScheme = "light" | "dark";
export default function useColorSchemePreference(
defaultColorScheme: ColorScheme = "light"
) {
let darkQuery = "(prefers-color-scheme: dark)";
let [colorScheme, setColorScheme] = React.useState<ColorScheme>(
typeof window === "object" && window.matchMedia
@tkon99
tkon99 / name.js
Last active October 31, 2025 17:39
Random Name Generator for Javascript
/*
(c) by Thomas Konings
Random Name Generator for Javascript
*/
function capFirst(string) {
return string.charAt(0).toUpperCase() + string.slice(1);
}
function getRandomInt(min, max) {
@cuth
cuth / debug-scroll.md
Last active November 18, 2025 10:13
Find the elements that are causing a horizontal scroll. Based on http://css-tricks.com/findingfixing-unintended-body-overflow/

Debug Horizontal Scroll

(function (d) {
    var w = d.documentElement.offsetWidth,
        t = d.createTreeWalker(d.body, NodeFilter.SHOW_ELEMENT),
        b;
    while (t.nextNode()) {
        b = t.currentNode.getBoundingClientRect();
 if (b.right &gt; w || b.left &lt; 0) {