Skip to content

Instantly share code, notes, and snippets.

View panudetjt's full-sized avatar

Panudet Tammawongsa panudetjt

View GitHub Profile
@panudetjt
panudetjt / validate.js
Created October 27, 2024 11:33 — forked from jukbot/validate.js
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 '.'
@panudetjt
panudetjt / gist:2bd3cf8de5e3305b2673
Created October 14, 2015 10:48 — forked from noeldiaz/gist:0f9a2583a41579878764
Homestead 32-bit Version
## 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"