This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Example of using a Mutation Object | |
* https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver | |
*/ | |
var observer = new MutationObserver(function(mutations) { | |
mutations.forEach(function(mutationRecord) { | |
doSomething(mutationRecord); | |
}); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Add full width row to an element inside a fixed grid container | |
* Note: This is useful when you can't change the parent page's html structure to add a full width container, | |
* such as when the entire page is already inside of a B.S. Container div. Ideally you would solve this without JS, | |
* but sometimes that isn't possible. | |
*/ | |
function renderFullWidthRow(size) { | |
let parentElement = document.querySelector('.parent-element'); | |
let childElement = document.querySelector('.child-element'); | |
let elStyles = window.getComputedStyle(parentElement); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @file: AddEventHandlerThisExample.js | |
* This example demonstrates how to pass 'this' correctly into an event handler | |
* which can be tricky due to events being the execution context inside of event handlers. | |
* | |
* The trick is to use an IIFE that returns an function with its encapsulated variable scope | |
* in order to preserve the value of 'this' inside another variable name (such as 'that') | |
**/ | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function(grunt) { | |
require('jit-grunt')(grunt); | |
// Project configuration. | |
grunt.initConfig({ | |
/** | |
* Sass | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# This script configures WordPress file permissions based on recommendations | |
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions | |
# | |
# Author: Michael Conigliaro | |
# | |
WP_OWNER=changeme # <-- wordpress owner | |
WP_GROUP=changeme # <-- wordpress group | |
WP_ROOT=/home/changeme # <-- wordpress root directory |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function (grunt) { | |
grunt.initConfig({ | |
svgmin: { | |
options: { | |
plugins: [ | |
{ | |
removeViewBox: false | |
}, { | |
removeUselessStrokeAndFill: false | |
} |
NewerOlder