Skip to content

Instantly share code, notes, and snippets.

View michaelwhyte's full-sized avatar

Michael Whyte michaelwhyte

View GitHub Profile
// based on: https://gist.github.com/paulirish/12fb951a8b893a454b32
// which is based on: https://gist.github.com/paulirish/12fb951a8b893a454b32
const $ = document.querySelector.bind(document);
const $$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
};
@michaelwhyte
michaelwhyte / google-calendar-bulk-delete.gs
Last active September 4, 2024 17:43
Bulk delete Google calendar events
function delete_events()
{
// Copy and Paste this script at https://script.google.com and then run it
// This script modified from code found at this Stackoverflow question and answer:
// https://webapps.stackexchange.com/questions/19513/how-to-delete-all-events-on-many-dates-all-at-once-but-not-the-whole-calendar-in
var fromDate = new Date(1995,0,1,0,0,0);
var toDate = new Date(2015,0,1,0,0,0);
@michaelwhyte
michaelwhyte / skeleton-flexbox-grid.css
Last active April 26, 2018 18:59
Skeleton Flexbox Grid
.row {
display: flex;
justify-content: space-between;
}
.one.column,
.one.columns { width: 4.66666666667%; }
.two.columns { width: 13.3333333333%; }
.three.columns { width: 22%; }
.four.columns { width: 30.6666666667%; }
@michaelwhyte
michaelwhyte / show-menu-and-prevent-transition.js
Created May 24, 2018 18:11
Show mobile menu and prevent transition on browser re-size
// Responsive Menu - Dropdown
const body = document.body;
const menu = document.getElementById('menu');
const nav = document.getElementById('main-navigation');
// Below code for preventing nav from animating on
// browser re-size modified from code found at
// this stackoverflow question and answer:
//
// https://goo.gl/6s3pAZ
@michaelwhyte
michaelwhyte / drop-down-nav.css
Created May 31, 2018 14:23
Keyboard accessible drop down navigation
@charset "utf-8";
/* CSS Document */
body {
font-family: Gotham, "Helvetica Neue", Helvetica, Arial, sans-serif;
}
html {
box-sizing: border-box;
}
@michaelwhyte
michaelwhyte / .htaccess
Created June 14, 2018 22:31
Force HTTPS via .htaccess
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
@michaelwhyte
michaelwhyte / composer.json
Created August 3, 2018 16:12 — forked from rogeriopradoj/composer.json
mail.php - phpmailer + mailhog - send mail via smtp
{
"require": {
"phpmailer/phpmailer": "^5.2"
}
}
{
"git.ignoreMissingGitWarning": true,
"emmet.triggerExpansionOnTab": true,
"path-autocomplete.extensionOnImport":true,
"editor.fontSize": 36,
"workbench.colorTheme": "Default Light+",
"terminal.integrated.fontSize": 24
}
<?php // PHP include path that is root relative ?>
<?php include($_SERVER['DOCUMENT_ROOT'].'/path/to/included/file.php'); ?>
@michaelwhyte
michaelwhyte / lighten-darken-color.js
Created June 29, 2019 00:39
Lighten or Darken Color with JavaScript
// Not my code
// This code is from:
// https://github.com/PimpTrizkit/PJs/wiki/12.-Shade,-Blend-and-Convert-a-Web-Color-(pSBC.js)
//
// License
/*
GNU Lesser General Public License v3.0
Permissions of this copyleft license are conditioned on making available complete source code
of licensed works and modifications under the same license or the GNU GPLv3. Copyright and