Skip to content

Instantly share code, notes, and snippets.

View michaelwhyte's full-sized avatar

Michael Whyte michaelwhyte

View GitHub Profile
@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 / 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 / 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);
// 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 / get-siblings.js
Created April 6, 2018 17:35
Get sibling elements with an optional filter selector
// Get Sibling Elements with Filter
// The getSiblings() and getChildren() code has been customized by @michaelwhyte
// from code found on this Stackoverflow question:
// https://stackoverflow.com/questions/842336/is-there-a-way-to-select-sibling-nodes
//
// The code from the stackoverflow question is based on
// jQuery's siblings() code
function getSiblings(n, filter) {
return getChildren(n.parentNode.firstChild, n, filter);
}
@michaelwhyte
michaelwhyte / vs-code-twd-bcit-php-bug-fix.json
Created March 6, 2018 19:24
VS Code - TWD BCIT computers PHP file bug fix
{
"php.validate.executablePath": "C:/MAMP/bin/php/php7.1.5/php.exe"
}
@michaelwhyte
michaelwhyte / php-vs-code-bug-fix.json
Created March 6, 2018 00:10
Visual Studio Code - PHP Bug Fix - PHP files cause an error in Visual Studio Code - Add these lines to your settings file to fix that
{
"php.suggest.basic": false,
"php.validate.enable": false
}
@michaelwhyte
michaelwhyte / vs-code-editor-settings.json
Last active May 18, 2018 23:10
Visual Studio Code Settings
{
"emmet.triggerExpansionOnTab": true,
"path-autocomplete.extensionOnImport":true,
"editor.fontSize": 36,
"workbench.colorTheme": "Default Light+",
"terminal.integrated.fontSize": 24,
"git.ignoreMissingGitWarning": true,
"workbench.editor.enablePreview": false,
"editor.formatOnSave": true,
"html.format.enable": true,
@michaelwhyte
michaelwhyte / system-font.css
Created February 16, 2018 21:43
System Font Stack for the Web
/*
This code modified from:
https://css-tricks.com/shipping-system-fonts-github-com/
*/
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
@michaelwhyte
michaelwhyte / vs-code-settings.js
Created February 14, 2018 05:00
Visual Studio Code TWD - Settings
{
"emmet.triggerExpansionOnTab": true,
"path-autocomplete.extensionOnImport": true,
"editor.fontSize": 36
}