Skip to content

Instantly share code, notes, and snippets.

View armspkt's full-sized avatar
🧸

armspkt

🧸
  • Bangkok, Thailand
View GitHub Profile
@alvinsng
alvinsng / no-use-effect.md
Created March 17, 2026 20:00
Skill generated by Factory Droid
name no-use-effect
description Enforce the no-useEffect rule when writing or reviewing React code. ACTIVATE when writing React components, refactoring existing useEffect calls, reviewing PRs with useEffect, or when an agent adds useEffect "just in case." Provides the five replacement patterns and the useMountEffect escape hatch.

No useEffect

@notdp
notdp / CLAUDE.md
Created July 18, 2025 09:27
claude code kiro spec agent

System Prompt - Spec Agent

Goal

You are an agent that specializes in working with Specs in Claude Code. Specs are a way to develop complex features by creating requirements, design and an implementation plan. Specs have an iterative workflow where you help transform an idea into requirements, then design, then the task list. The workflow defined below describes each phase of the spec workflow in detail.

Workflow to execute

@jukbot
jukbot / elysia.ts
Last active October 11, 2024 15:19
Example of serving static files (eg. build from vite) using Elysia and bun
import { Elysia } from "elysia";
import { staticPlugin } from '@elysiajs/static';
const app = new Elysia()
app.use(staticPlugin({
prefix: '',
assets : "./dist",
}))
app.get('/', async () => {
@gaearon
gaearon / 00-README-NEXT-SPA.md
Last active January 29, 2026 09:20
Next.js SPA example with dynamic client-only routing and static hosting

Next.js client-only SPA example

Made this example to show how to use Next.js router for a 100% SPA (no JS server) app.

You use Next.js router like normally, but don't define getStaticProps and such. Instead you do client-only fetching with swr, react-query, or similar methods.

You can generate HTML fallback for the page if there's something meaningful to show before you "know" the params. (Remember, HTML is static, so it can't respond to dynamic query. But it can be different per route.)

Don't like Next? Here's how to do the same in Gatsby.

@harsh4870
harsh4870 / jwt-user-asseration.js
Created August 9, 2022 18:21
JWT assertion Node JS
var jwt = require('jsonwebtoken');
const fs = require('fs');
var request = require("request");
var querystring = require('querystring');
var privateKey = fs.readFileSync('./private_key.pem');
#idcs or keycloak URL
var url = "https://example.com/oauth2/v1/token"
var headers = {
'Authorization': 'Basic <BASE-64 ENCODED client ID & Secret>',
@johncolby
johncolby / macos_retina_compared.md
Last active July 6, 2023 19:50
macOS retina scaling comparison

macOS hiDPI retina scaling options compared

These are some photos comparing different macOS retina scaling options. All use a non-vector test pattern displayed at 100% (AAPM TG18). All photos are taken at roughly the same distance, using the same crop. Forgive the slight hand-held motion blur, and focus on these variables:

  • Pixel size
  • UI size
  • Pixel perfection (has any interpolation taken place?)
  • Real estate (how much of the image is displayed in this representative patch?)

Dell U2713H

@alanhe421
alanhe421 / sound.scpt
Last active February 18, 2023 23:22
switch input or output by applescript
set devices to {}
tell application "System Preferences"
reveal pane id "com.apple.preference.sound"
end tell
tell application "System Events"
tell application process "System Preferences"
tell tab group 1 of window "Sound"
click radio button "Output"
tell table 1 of scroll area 1
// First, go to https://shopee.co.th/user/purchase, and open DevTools.
// Step 1 - Run this code to scroll all the way to the bottom.
const timer = setInterval(() => scrollTo(0, 10000000), 800)
setTimeout(() => {
// Step 2 - Stop scrolling after 1 minute.
clearInterval(timer)
// Step 3 - Sum the total purchase price!
@ANTOSzbk
ANTOSzbk / captchaVerification.js
Created March 31, 2020 19:48
Commented code solved Uncaught (in promise) Timeout
async function captchaVerification() {
return await new Promise((resolve, reject) => {
const captcha = document.createElement('div')
captcha.setAttribute('id', 'g-recaptcha')
document.getElementById('main').appendChild(captcha)
const verifyCallback = async (response) => {
if (response) {
const data = {
token: response,
}
-- code for https://youtu.be/tp_5c6jaNQE
create table users (
id serial primary key,
first_name varchar(255) not null,
last_name text,
age int,
email text unique not null
);