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)', 'บราซิล', 'บริติชอินเดียนโอเชียนเทร์ริทอรี', 'หมู่เกาะบริติชเวอร์จิน', 'บรูไนดารุสซาลาม', 'บัลแกเรีย', 'บูร์กินาฟาโซ', 'บุรุนดี', | |
'กัมพูชา', 'แคเมอรูน', 'แคนาดา', 'กาบูเวร์ดี', 'หมู่เกาะเคย์แมน', 'สาธารณรัฐแอฟริกากลาง', 'ชาด', 'ชิลี', 'จีน', 'เกาะคริสต์มาส', 'หมู่เกาะโคโคส (คีลิง)', 'โคลอมเบีย', 'คอโมโรส', 'สาธารณรัฐคองโก', 'หมู่เกาะคุก', 'คอสตาริกา', 'โกตดิวัวร์ (ไอวอรีโคสต์)', 'โครเอเชีย', 'คิวบา', 'ไซปรัส', 'สาธารณรัฐเช็ก', | |
'เดนมาร์ก', 'จิบูตี', 'ดอมินีกา', 'สาธารณรัฐโดมินิกัน', | |
'เอกวาดอร์', 'อียิปต์', 'เอลซัลวาดอร์', 'อิเควทอเรียลกินี', 'เอริเทรีย', 'เอ |
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
$road = array( | |
'กรุงเกษม', 'กรุงเทพกรีฑา', 'กรุงเทพ-นนทบุรี', 'กรุงธนบุรี', 'กรุงแมน', 'กล้วยน้ำไทตัดใหม่', 'กลันตัน', 'กะออม', 'กระออม', 'กัลปพฤกษ์', 'กัลยาณไมตรี', 'กาญจนาภิเษก', 'กำนันแม้น', 'กำแพงเพชร', 'กำแพงเพชร 1', 'กำแพงเพชร 2', 'กำแพงเพชร 3', 'กำแพงเพชร 4', 'กำแพงเพชร 5', 'กำแพงเพชร 6', 'กำแพงเพชร 7', 'กิ่งแก้ว', 'กิจพานิช', 'เกษมราษฎร์', 'แก้ว', 'แก้วเงินทอง', 'โกสุมรวมใจ', 'ไกรสีห์', | |
'ขวัญ', 'ขาว', 'ข้าวสาร', 'ข้าวหลาม', 'ขุมทอง-ลำต้อยติ่ง', 'เขียวไข่กา', | |
'ครุใน', 'คลองเก้า', 'คลองถมวัดพิเรนทร์', 'คลองถมวัดสระเกศ', 'คลองถมวัดโสมนัส', 'คลองลำเจียก', 'คลองลำปัก', 'คลองสิบ-คลองสิบสี่', 'คอนแวนต์', 'คุ้มเกล้า', 'คู้บอน', 'คู้-คลองสิบ', 'เคหะร่มเกล้า', | |
'งามวงศ์วาน', 'จตุโชติ', 'จรัญสนิทวงศ์', 'จรัสเมือง', 'จรัสเวียง', 'จรูญเวียง', 'จอมทอง', 'จอมทองบูรณะ', 'จักรพงษ์', 'จักรพรรดิพงษ์', 'จักรเพชร', 'จักรวรรดิ', 'จันทน์', 'จันทน์เก่า', 'จันทรุเบกษา', 'จารุเมือง', 'จึงเจริญพาณิชย์', 'เจริญกรุง', 'เจริญนคร', 'เจริญพัฒนา', 'เจริญเมือง', 'เจริญรัถ', 'เจริญราษฎร์', 'เจริญเวียง', 'เจ้าคำรพ', 'เจ้า |