Skip to content

Instantly share code, notes, and snippets.

View whs's full-sized avatar

Manatsawin Hanmongkolchai whs

View GitHub Profile
@whs
whs / proxy.yaml
Last active February 21, 2024 16:12
proxy-real-ip-cidr: 130.211.0.0/22,35.191.0.0/16,35.201.111.115/32,103.21.244.0/22,103.22.200.0/22,103.31.4.0/22,104.16.0.0/13,104.24.0.0/14,108.162.192.0/18,131.0.72.0/22,141.101.64.0/18,162.158.0.0/15,172.64.0.0/13,173.245.48.0/20,188.114.96.0/20,190.93.240.0/20,197.234.240.0/22,198.41.128.0/17,2400:cb00::/32,2606:4700::/32,2803:f800::/32,2405:b500::/32,2405:8100::/32,2a06:98c0::/29,2c0f:f248::/32
@whs
whs / gist:fee38e6236f176d6b27895592307cbf4
Created December 1, 2023 02:53
K2AUSBKeyboard Privacy Policy
The application does not collect or transmit any personal, device, interaction or performance information.
@whs
whs / openapi.json
Created March 7, 2022 14:33
Wise Old Man OpenAPI
{
"openapi": "3.0.0",
"info": {
"title": "Wise Old Man REST API",
"version": "1.0.0"
},
"servers": [
{
"url": "https://api.wiseoldman.net"
}
@whs
whs / machine.js
Created August 15, 2020 17:45
Generated by XState Viz: https://xstate.js.org/viz
Machine({
id: 'loading',
initial: 'hide',
states: {
hide: {
on: {
SHOW_NOW: 'show',
SHOW: {
actions: send('SHOW_NOW', { delay: 50, id: 'show' }),
},
// from this
I18n.t(`business.${domain}.call`)
// to this
switch(domain){
case Domain.FOOD:
return I18n.t('business.FOOD.call')
case Domain.BEAUTY:
return I18n.t('business.BEAUTY.call')
}
t.importDeclaration(
[t.importDefaultSpecifier(t.identifier('th'))],
t.stringLiteral('file'),
)
path.replaceWith(
t.callExpression(t.identifier('alert'), [
t.stringLiteral('Hello world')
])
)
export default function({ types: t }) {
return {
visitor: {
// visitor contents
}
};
};
import I18n from 'common/I18n'
import TH from 'th/category.gyoza-restaurants'
import EN from 'en/category.gyoza-restaurants'
console.log(I18n.t({
th: TH,
en: EN,
}))
import I18n from 'common/I18n'
console.log(I18n.t('category.gyoza-restaurants'))