Skip to content

Instantly share code, notes, and snippets.

View gmh5225's full-sized avatar
๐Ÿ™ƒ

gmh5225.eth gmh5225

๐Ÿ™ƒ
View GitHub Profile
@gmh5225
gmh5225 / doomer-solver.py
Created April 1, 2025 14:41 — forked from DreyAnd/doomer-solver.py
SCC2025 - Doomer solution
from urllib.parse import quote
import httpx
import random
import string
import time
def generate_random_creds() -> str:
username = "".join(random.choices(string.ascii_letters + string.digits, k=8))
password = "".join(random.choices(string.ascii_letters + string.digits, k=8))
@gmh5225
gmh5225 / accessibledetails.md
Created March 29, 2025 04:27 — forked from lunginspector/accessibledetails.md
Accessible Details

Details about how Accessible reads files.

The "bug"

  • Accessible uses Shortucts and various actions to read/extract system files.
  • It combines this actions with a URL, starting with file:///. This URL is the path that Accessible reads at.

Overall Usablity

  • This cannot read the entire filesystem. It can only read stuff in /Applications and /System.
  • This "bug" isn't very notable, however it is useful for reading files such as MobileGestalt for on-device SparseRestore apps, and it can also be used to open apps not usually available to the user.
  • Accessible has been taking advantage of this "bug" for a while now, however it seems that Apple has caught on.

The "patch"

TL;DR: Apple changed the way of reading files with file:///, causing Shortcuts to not be able to read files from that URL.

@gmh5225
gmh5225 / Get-Origins.ps1
Created March 28, 2025 07:56 — forked from curi0usJack/Get-Origins.ps1
PowerShell code to map CDN (Classic or FrontDoor) to their Origin hostname.
Import-Module Az
Connect-AzAccount
$ipre = "^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$"
function Get-ClassicOrigins() {
$profs = Get-AzCDNProfile
$coll = @()
foreach ($prof in $profs) {
@gmh5225
gmh5225 / n-monthly.md
Created March 28, 2025 07:54 — forked from LambdaNote/n-monthly.md
ใƒฉใƒ ใƒ€ใƒŽใƒผใƒˆๅŸท็ญ†ใฎๆ‰‹ๅผ•ใ

ใƒฉใƒ ใƒ€ใƒŽใƒผใƒˆๅŸท็ญ†ใฎๆ‰‹ๅผ•ใ

ใƒฉใƒ ใƒ€ใƒŽใƒผใƒˆใงใฎๅŸท็ญ†ใ‚’ๆคœ่จŽใ„ใŸใ ใใ€ใ‚ใ‚ŠใŒใจใ†ใ”ใ–ใ„ใพใ™ใ€‚ ๅŸท็ญ†ใซ้š›ใ—ใฆๅฝ“็คพใ‹ใ‚‰ใฎใŠ้ก˜ใ„ใ‚’ใพใจใ‚ใพใ™ใ€‚

ๅŸท็ญ†ใ‚’ๆ›ธใๅง‹ใ‚ใ‚‹ๅ‰ใซ

ใพใšใฏไผ็”ปใฎๆ–นๅ‘ๆ€งใ‚’็ทจ้›†่€…ใจๅ…ฑๆœ‰ใ—ใพใ—ใ‚‡ใ†ใ€‚ ๅ†…ๅฎนๆกˆใจๆ›ธๅๆกˆใฎใปใ‹ใซใ€ไปฅไธ‹ใฎ4็‚นใฎ่จ€่ชžๅŒ–ใ‚’ใŠ้ก˜ใ„ใ—ใฆใ„ใพใ™ใ€‚

// color1 and color2 are R4G4B4 12bit RGB color values, alpha is 0-255
uint16_t blend_12bit( uint16_t color1, uint16_t color2, uint8_t alpha ) {
uint64_t c1 = (uint64_t) color1;
uint64_t c2 = (uint64_t) color2;
uint64_t a = (uint64_t)( alpha >> 4 );
// bit magic to alpha blend R G B with single mul
c1 = ( c1 | ( c1 << 12 ) ) & 0x0f0f0f;
c2 = ( c2 | ( c2 << 12 ) ) & 0x0f0f0f;
uint32_t o = ( ( ( ( c2 - c1 ) * a ) >> 4 ) + c1 ) & 0x0f0f0f;

Operational PGP

This is a guide on how to email securely.

There are many guides on how to install and use PGP to encrypt email. This is not one of them. This is a guide on secure communication using email with PGP encryption. If you are not familiar with PGP, please read another guide first. If you are comfortable using PGP to encrypt and decrypt emails, this guide will raise your security to the next level.

@gmh5225
gmh5225 / agent loop
Created March 10, 2025 05:24 — forked from jlia0/agent loop
Manus tools and prompts
You are Manus, an AI agent created by the Manus team.
You excel at the following tasks:
1. Information gathering, fact-checking, and documentation
2. Data processing, analysis, and visualization
3. Writing multi-chapter articles and in-depth research reports
4. Creating websites, applications, and tools
5. Using programming to solve various problems beyond development
6. Various tasks that can be accomplished using computers and the internet
@gmh5225
gmh5225 / grpo_demo.py
Last active February 2, 2025 12:55 — forked from willccbb/grpo_demo.py
GRPO Llama-1B
# train_grpo.py
import re
import torch
from datasets import load_dataset, Dataset
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import LoraConfig
from trl import GRPOConfig, GRPOTrainer
# Load and prep dataset
@gmh5225
gmh5225 / FAQ.md
Created January 28, 2025 19:19 — forked from ngxson/FAQ.md
convert ARM NEON to WASM SIMD prompt

What is your setup?

Just chat.deepseek.com with prompts adapted from this gist.

Does it work in one-shot or I have to prompt it multiple times?

  • For the qX_0 variants, they are actually quite straight-forward so deepseek can come up with a correct result in 1 shot.
  • For the qX_K it's more complicated, I would say most of the time I need to re-prompt it 4 to 8 more times.
  • The most difficult was q6_K, the code never works until I ask it to only optimize one specific part, while leaving the rest intact (so it does not mess up everything)