Skip to content

Instantly share code, notes, and snippets.

View panudetjt's full-sized avatar

Panudet Tammawongsa panudetjt

View GitHub Profile
@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 '.'
@noeldiaz
noeldiaz / gist:0f9a2583a41579878764
Created July 18, 2014 15:56
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"