Skip to content

Instantly share code, notes, and snippets.

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

Juk - a search builder jukbot

🏠
Working from home
  • Opsta
  • Bangkok, Thailand
  • X @jukbot
View GitHub Profile
@jukbot
jukbot / copilot-instructions.md
Last active April 22, 2025 05:24
Copilot instruction, Cursor rules for Go lang 1.24

Go API Development Assistant Prompt (Go 1.24+)

You are an expert AI programming assistant specializing in building APIs with Go, using the standard library's net/http package and the latest features introduced in Go 1.24.

Always use the latest stable version of Go (1.24 or newer) and be deeply familiar with RESTful API design principles, Go idioms, and the evolving capabilities of the standard library.


✅ Responsibilities

@jukbot
jukbot / validate.js
Created August 1, 2024 17:23
Validate input number to allow only numeric, 1 decimal and max to 3 decimal places
export function validateNumberInput (e, min = 0, max = 1e10) {
const currentValue = e.target.value
const validKeys = ['ArrowLeft', 'ArrowRight', 'Backspace', 'Tab', 'Delete', '.']
// Allow valid control keys
if (validKeys.includes(e.key)) {
return
}
// Prevent entering non-numeric keys except '.'
@jukbot
jukbot / Dockerfile
Last active July 7, 2024 04:33
A example of Dockerfile to run elysia static server
FROM oven/bun:latest AS build-stage
WORKDIR /app
ADD package.json bun.lockb ./
RUN bun install --frozen-lockfile
ADD . .
RUN bun run build
FROM oven/bun:1-alpine
WORKDIR /app
@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 () => {
@jukbot
jukbot / playwright.config.ts
Last active August 6, 2024 07:33
playwright.config.ts for Nuxt 3
import { fileURLToPath } from 'node:url'
import { defineConfig, devices } from '@playwright/test'
import type { ConfigOptions } from '@nuxt/test-utils/playwright'
// For first setup !!
// Please run 'npx playwright install' to install the browser
// Increase the timeout to 2 minutes (because Nuxt server is start so slow)
const timeout = 120000
const hostUrl = 'http://0.0.0.0:3001'
@jukbot
jukbot / reset.css
Created November 1, 2023 14:21
CSS Reset (24-10-2023)
/***
GitHub page: https://github.com/elad2412/the-new-css-reset
***/
/*
Remove all the styles of the "User-Agent-Stylesheet", except for the 'display' property
- The "symbol *" part is to solve Firefox SVG sprite bug
- The "html" attribute is exclud, because otherwise a bug in Chrome breaks the CSS hyphens property (https://github.com/elad2412/the-new-css-reset/issues/36)
*/
*:where(
@jukbot
jukbot / MaterialButtonGroup.kt
Created September 12, 2021 14:29 — forked from akexorcist/MaterialButtonGroup.kt
Material Button Group for Material Button in Android
package com.akexorcist.materialdesign
import android.content.Context
import androidx.core.view.MarginLayoutParamsCompat
import androidx.core.view.ViewCompat
import android.util.AttributeSet
import android.util.Log
import android.view.View
import android.widget.LinearLayout
import com.google.android.material.shape.AbsoluteCornerSize
@jukbot
jukbot / server.js
Created September 11, 2021 13:07 — forked from leanazulyoro/server.js
Next.js SSR Cache using LRU Cache
const express = require('express')
const next = require('next')
const Cache = require('lru-cache');
const compression = require('compression')
const port = parseInt(process.env.PORT, 10) || 3000
const dev = process.env.NODE_ENV !== 'production'
const app = next({ dev })
@jukbot
jukbot / sample.js
Created August 31, 2021 17:16 — forked from jeffhuangtw/sample.js
[nodejs] server side check "androidpublisher.purchases.subscriptions.get" with "service account"
// Google Play API Key
// ref: http://stackoverflow.com/questions/35127086/android-inapp-purchase-receipt-validation-google-play
// ref: https://developers.google.com/android-publisher/authorization
// ref: http://google.github.io/google-api-nodejs-client/18.0.0/index.html#toc14__anchor
//
// install npm package
// ref: https://github.com/google/google-api-nodejs-client
// $ npm install googleapis --save
//
const google = require('googleapis');

Conventinal Commit Messages

See how a minor change to your commit message style can make a difference. Examples

Have a look at CLI util git-conventional-commits to ensure this conventions and generate changelogs

Commit Formats

Default