This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { base64url } from 'jose' | |
async function getCrypto(): Promise<SubtleCrypto> { | |
if (typeof globalThis !== 'undefined' && globalThis.crypto?.subtle) { | |
return globalThis.crypto.subtle | |
} | |
if (typeof window !== 'undefined' && window.crypto?.subtle) { | |
return window.crypto.subtle | |
} | |
const { webcrypto } = await import('node:crypto') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 '.' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://github.com/vitejs/vite/discussions/3448#discussioncomment-1859773 | |
find src -type f | grep "\.[jt]s$" | xargs -n1 grep -HE "^[^*\n]*(<\/?[a-zA-Z]*>)[\s\w]*$" | cut -d: -f1 | uniq | awk '{print "mv "$1" "$1"x"}' | sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
// fibonacci is a function that returns | |
// a function that returns an int. | |
func fibonacci() func() int { | |
a := 0 | |
b := 1 | |
n := 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rbenv install 2.0.0-p645 | |
#Downloading ruby-2.0.0-p645.tar.gz... | |
#-> https://dqw8nmjcqpjn7.cloudfront.net/5e9f8effffe97cba5ef0015feec6e1e5f3bacf6ace78cd1cdf72708cd71cf4ab | |
#Installing ruby-2.0.0-p645... | |
# | |
#BUILD FAILED (Ubuntu 14.04 using ruby-build 20151028-11-gbd22205) | |
# | |
#Inspect or clean up the working tree at /tmp/ruby-build.20151118185842.4045 | |
#Results logged to /tmp/ruby-build.20151118185842.4045.log | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Making a 32 bit version of Homestead | |
# Clone the settler repository to a directory | |
git clone https://github.com/laravel/settler.git Ubuntu32 | |
# In that directory edit the file called "Vagrantfile" to use a ubuntu 32 box instead of the 64 bit one | |
change this line: | |
config.vm.box = "ubuntu/trusty64" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$province = array( | |
'กระบี่', 'กรุงเทพมหานคร', 'กาญจนบุรี', 'กาฬสินธุ์', 'กำแพงเพชร', | |
'ขอนแก่น', | |
'จันทบุรี', | |
'ฉะเชิงเทรา', | |
'ชลบุรี', 'ชัยนาท', 'ชัยภูมิ', 'ชุมพร', 'เชียงราย', 'เชียงใหม่', | |
'ตรัง', 'ตราด', 'ตาก', | |
'นครนายก', 'นครปฐม', 'นครพนม', 'นครราชสีมา', 'นครศรีธรรมราช', 'นครสวรรค์', 'นนทบุรี', 'นราธิวาส', 'น่าน', | |
'บึงกาฬ', 'บุรีรัมย์', | |
'ปทุมธานี', 'ประจวบคีรีขันธ์', 'ปราจีนบุรี', 'ปัตตานี', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$district = array( | |
'คลองสาน', 'คลองสามวา', 'คลองเตย', 'คันนายาว', | |
'จตุจักร', 'จอมทอง', 'ดอนเมือง', 'ดินแดง', 'ดุสิต', | |
'ตลิ่งชัน', 'ทวีวัฒนา', 'ทุ่งครุ', 'ธนบุรี', | |
'บางกอกน้อย', 'บางกอกใหญ่', 'บางกะปิ', 'บางขุนเทียน', 'บางคอแหลม', 'บางซื่อ', 'บางนา', 'บางบอน', 'บางพลัด', 'บางรัก', 'บางเขน', 'บางแค', 'บึงกุ่ม', | |
'ปทุมวัน', 'ประเวศ', 'ป้อมปราบศัตรูพ่าย', | |
'พญาไท', 'พระนคร', 'พระโขนง', | |
'ภาษีเจริญ', | |
'มีนบุรี', | |
'ยานนาวา', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$country = array( | |
'อัฟกานิสถาน', 'แอลเบเนีย', 'แอลจีเรีย', 'อเมริกันซามัว', 'อันดอร์รา', 'แองโกลา', 'แองกวิลลา', 'ออสเตรเลียนแอนตาร์กติกเทร์ริทอรี', 'แอนติกาและบาร์บูดา', 'อาร์เจนตินา', 'อาร์มีเนีย', 'อารูบา', 'ออสเตรเลีย', 'ออสเตรีย', 'อาเซอร์ไบจาน', | |
'บาฮามาส', 'บาห์เรน', 'บังกลาเทศ', 'บาร์เบโดส', 'เบลารุส', 'เบลเยียม', 'เบลีซ', 'เบนิน', 'เบอร์มิวดา', 'ภูฏาน', 'โบลิเวีย', 'บอสเนียและเฮอร์เซโกวีนา', 'บอตสวานาa', 'เกาะบูเวต (Bouvetøya)', 'บราซิล', 'บริติชอินเดียนโอเชียนเทร์ริทอรี', 'หมู่เกาะบริติชเวอร์จิน', 'บรูไนดารุสซาลาม', 'บัลแกเรีย', 'บูร์กินาฟาโซ', 'บุรุนดี', | |
'กัมพูชา', 'แคเมอรูน', 'แคนาดา', 'กาบูเวร์ดี', 'หมู่เกาะเคย์แมน', 'สาธารณรัฐแอฟริกากลาง', 'ชาด', 'ชิลี', 'จีน', 'เกาะคริสต์มาส', 'หมู่เกาะโคโคส (คีลิง)', 'โคลอมเบีย', 'คอโมโรส', 'สาธารณรัฐคองโก', 'หมู่เกาะคุก', 'คอสตาริกา', 'โกตดิวัวร์ (ไอวอรีโคสต์)', 'โครเอเชีย', 'คิวบา', 'ไซปรัส', 'สาธารณรัฐเช็ก', | |
'เดนมาร์ก', 'จิบูตี', 'ดอมินีกา', 'สาธารณรัฐโดมินิกัน', | |
'เอกวาดอร์', 'อียิปต์', 'เอลซัลวาดอร์', 'อิเควทอเรียลกินี', 'เอริเทรีย', 'เอ |
NewerOlder