Skip to content

Instantly share code, notes, and snippets.

View Shivabeach's full-sized avatar

Brad Shivabeach

  • Oak Ridge Tn
View GitHub Profile
@gitdagray
gitdagray / util.js
Last active February 8, 2024 14:15
Javascript Utility Functions
// Youtube tutorial here: https://youtu.be/LDgPTw6tePk
// These functions are designed to be exported, but you could create a class instead. See tutorial video.
// #1 proper case
export const properCase = (string) => {
return `${string[0].toUpperCase()}${string.slice(1).toLowerCase()}`;
};
@Shivabeach
Shivabeach / admin.js
Last active November 30, 2019 20:40
ajax form one size fits all
#ajax can be any form ID or class name. I just use ajax
$('form#ajax').on('submit', function(){
var that = $(this),
url = that.attr('action'),
type = that.attr('method'),
data = {};
that.find('[name]').each(function(index, value){
var that = $(this),
name = that.attr('name'),