Skip to content

Instantly share code, notes, and snippets.

View charrondev's full-sized avatar

Adam Charron charrondev

View GitHub Profile
// hijack the form submit to add a callback.
$('#appointment-form').submit((event) => {
$.ajax({
url: $('#appointment-form').attr('action'),
type: 'post',
data: $('#appointment-form').serialize(),
success: () => {
$(document.body).toggleClass('appointments-open');
},
error: () => {

Keybase proof

I hereby claim:

  • I am charrondev on github.
  • I am charrondev (https://keybase.io/charrondev) on keybase.
  • I have a public key ASCkxlgizsJJPj4EyePm32X9kZn-JcS-rtWD8ISqqZ4F8wo

To claim this, I am signing this object:

@charrondev
charrondev / loose-obj.php
Last active March 26, 2022 11:34
PHP Object vs Array memory usage with random values
<?php
include_once "./randomString.php";
$s = [];
for ($x = 0; $x < 100000; $x++) {
$obj = new stdClass();
$obj->name = randomString();
$obj->age = rand(1, 100);
$s[] = $obj;
@charrondev
charrondev / webpackHotDevClient.js
Created February 29, 2020 00:51
react-dev-utils/webpackDevClient for react-refresh-webpack-plugin.
/**
* Copyright (c) 2015-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
// This file is a fork of https://github.com/facebook/create-react-app/blob/v3.4.0/packages/react-dev-utils/webpackHotDevClient.js
// It removes all error & warning handling so the new ones from https://github.com/pmmmwh/react-refresh-webpack-plugin/tree/master/src/overlay can be used instead.
@charrondev
charrondev / joe-rogan-experience.xml
Created May 10, 2021 03:51
Joe Rogan Experience Podcast RSS for all episodes
This file has been truncated, but you can view the full file.
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
<channel>
<title>The Joe Rogan Experience</title>
<link>https://open.spotify.com/show/4rOoJ6Egrf8K2IrywzwOMk</link>
<description>The official podcast of comedian Joe Rogan. Follow The Joe Rogan Clips show page for some of the best moments from the episodes.</description>
@charrondev
charrondev / joe-rogan-experience.xml
Created May 10, 2021 03:51
Joe Rogan Experience Podcast RSS for all episodes
This file has been truncated, but you can view the full file.
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
<channel>
<title>The Joe Rogan Experience</title>
<link>https://open.spotify.com/show/4rOoJ6Egrf8K2IrywzwOMk</link>
<description>The official podcast of comedian Joe Rogan. Follow The Joe Rogan Clips show page for some of the best moments from the episodes.</description>
@charrondev
charrondev / tauri_traffic_light_positioner_plugin.rs
Last active October 12, 2024 21:41
This code describes a mechanism to adjust traffic light positioning on MacOS with Tauri 2.x
use objc::{msg_send, sel, sel_impl};
use rand::{distributions::Alphanumeric, Rng};
use tauri::{
plugin::{Builder, TauriPlugin},
Manager, Runtime, Window,
}; // 0.8
const WINDOW_CONTROL_PAD_X: f64 = 15.0;
const WINDOW_CONTROL_PAD_Y: f64 = 23.0;