Skip to content

Instantly share code, notes, and snippets.

View mhdcodes's full-sized avatar
🏠
Working from home

MHD mhdcodes

🏠
Working from home
View GitHub Profile
@mhdcodes
mhdcodes / text-enhance.sh
Created February 9, 2026 12:37
Improve clipboard text writing with Groq AI.
#!/bin/bash
# Configuration
API_KEY="${GROQ_API_KEY}" # Set via environment variable or hardcode
MODEL="llama-3.1-8b-instant"
# Read current clipboard
TEXT=$(xclip -o -selection clipboard 2>/dev/null)
# Exit if clipboard is empty
// ==UserScript==
// @name Photopea No Ads
// @version 1.0.0
// @description Remove ads sidebar and maximize canvas workspace in Photopea by spoofing viewport width
// @icon https://www.photopea.com/promo/icon512.png
// @author Claude (based on ml98's approach)
// @namespace http://tampermonkey.net/
// @license MIT
// @match https://www.photopea.com/*
// @match https://vecpea.com/*
import { AtpAgent } from "@atproto/api";
const BSKYHANDLE = "yourhandle.bsky.social";
const BSKYPASS = "your@password";
const main = async () => {
const agent = new AtpAgent({
service: "https://bsky.social",
});
@mhdcodes
mhdcodes / Modulo.ts
Created December 20, 2023 10:45
Typescript
import type { Subtract, Compare } from 'ts-arithmetic';
import type { Equal, Expect } from '@type-challenges/utils'
type Modulo<N1 extends number, Bound extends number> = Compare<Bound, N1> extends 0
? 0
: Compare<Bound, N1> extends 1 ? N1 : Subtract<N1, Bound>
/* _____________ Test Cases _____________ */
type cases = [
Expect<Equal<Modulo<0, 3>, 0>>,
@mhdcodes
mhdcodes / gitflow-breakdown.md
Created April 14, 2019 15:25 — forked from JamesMGreene/gitflow-breakdown.md
A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

@mhdcodes
mhdcodes / Space
Created October 13, 2016 21:38 — forked from nathanacurtis/Space
$space-inset-default = 16px 16px 16px 16px;
$space-inset-xs = 4px 4px 4px 4px;
$space-inset-s = 8px 8px 8px 8px;
$space-inset-m = 16px 16px 16px 16px;
$space-inset-l = 32px 32px 32px 32px;
$space-inset-xl = 64px 64px 64px 64px;
$space-stack-default = 0 0 16px 0;
$space-stack-xs = 0 0 4px 0;
$space-stack-s = 0 0 8px 0;
$space-stack-m = 0 0 16px 0;