Skip to content

Instantly share code, notes, and snippets.

View ekahialoha's full-sized avatar

Chris Kelsom-Martin ekahialoha

View GitHub Profile
@ekahialoha
ekahialoha / CheckKeypress.js
Created April 30, 2020 15:25 — forked from karmiphuc/CheckKeypress.js
Keypress Validation ALLOW CHARACTERS: a..z A..Z 0..9 - _ . , @ Reference keycode table: http://www.cambiaresearch.com/articles/15/javascript-char-codes-key-codes
$('input').bind('keypress', function(e) {// Kami.2013.12.24.10:57 Allow only letters, numbers, and @ , . - _
var allowedCode = [8, 13, 32, 44, 45, 46, 95];
var charCode = (e.charCode) ? e.charCode : ((e.keyCode) ? e.keyCode :
((e.which) ? e.which : 0));
if (charCode > 31 && (charCode < 64 || charCode > 90) &&
(charCode < 97 || charCode > 122) &&
(charCode < 48 || charCode > 57) &&
(allowedCode.indexOf(charCode) == -1)) {
e.preventDefault();
$('.alert-box.onerror').html('<h3>ALLOW CHARACTERS: a..z A..Z 0..9 - _ . , @</h3>').fadeIn();
@ekahialoha
ekahialoha / rm_node_modules.sh
Created March 9, 2020 00:09 — forked from median-man/rm_node_modules.sh
Remove all node_modules folders recursively.
# removes all node_modules folders recursively
find . -name "node_modules" -exec rm -rf '{}' +
# I found this command on Coderwall at
# https://coderwall.com/p/guqrca/remove-all-node_module-folders-recursively
# Type(<scope>): <subject>
# <body>
# <footer>
# Type should be one of the following:
# * feat (new feature)
# * fix (bug fix)
# * docs (changes to documentation)

Keybase proof

I hereby claim:

  • I am ekahialoha on github.
  • I am ckelsommartin (https://keybase.io/ckelsommartin) on keybase.
  • I have a public key ASAEO5SxyTCVcXfRKGIBc91KF-2ZjUyqrH9pNZG6RAL_7go

To claim this, I am signing this object: