This file contains 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
// Use this file as a starting point for your project's .eslintrc. | |
// Copy this file, and add rule overrides as needed. | |
{ | |
"env": { | |
"node": true, | |
"es6": true | |
}, | |
"rules": { | |
"array-bracket-spacing": [2, "never"], | |
"block-scoped-var": 2, |
This file contains 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
// Use this file as a starting point for your project's .eslintrc. | |
// Copy this file, and add rule overrides as needed. | |
{ | |
"env": { | |
"node": true, | |
"es6": true | |
}, | |
"rules": { | |
"array-bracket-spacing": [2, "never"], | |
"block-scoped-var": 2, |
This file contains 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
<?php | |
// Define picture element media query values here | |
$m_mqs = 'min-width:321px'; | |
$l_mqs = 'min-width:641px'; | |
$xl_mqs = 'min-width:1281px'; | |
?> | |
<picture alt="Alt tag describing the image represented"> | |
<source src="photo-s.jpg"/> | |
<source src="photo-m.jpg" media="<?php ehco $m_mqs; ?>"/> |
This file contains 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
$("*").each(function() { | |
if ($(this).width() > $(window).width()) { | |
console.log(this); | |
} | |
}); |
This file contains 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 <mike [at] conigliaro [dot] org> | |
# | |
WP_OWNER=www-data # <-- wordpress owner | |
WP_GROUP=www-data # <-- wordpress group | |
WP_ROOT=$1 # <-- wordpress root directory |
This file contains 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
function rateLimiter(thisArray, callback) { | |
var count = 0, // Loop count | |
rateNum = 10, // Items per loop | |
rateTime = 5000, // Time between loops | |
items = []; // Temp array | |
var batches = thisArray.length / rateNum; | |
function splitArray() { | |
items = thisArray.splice(0, rateNum); | |
console.log('batch ' + (count + 1) + ' out of ' + batches); |
This file contains 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
@mixin center-justified { | |
text-align-last: center; | |
text-align: justify; | |
} | |
@mixin left-justified { | |
text-align-last: left; | |
text-align: justify; | |
} | |
@mixin right-justified { | |
text-align-last: right; |
This file contains 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
var a = ["a","a","b","c","c"]; | |
var dupes = a.filter((value,index,self)=>{ return (self.indexOf(value) !== index )}); | |
var cleanArray = a.filter((value,index,self)=>{ return (self.indexOf(value) === index )}); | |
console.log(dupes); | |
console.log(cleanArray); |
This file contains 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
var myArr = [], | |
count = 0, | |
batches = 0, | |
newArr = []; | |
for (var i = 0; i < 103; i++) { | |
myArr.push(i); | |
if (myArr.length > 9) { | |
batches = Math.ceil(myArr.length / 10); | |
} |
This file contains 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
... | |
/** | |
** Disables RSS for staging | |
**/ | |
function disable_rss() { | |
return null; | |
} | |
if($_SERVER["HTTP_HOST"] == "[staging server address]"){ | |
add_filter('default_feed', 'disable_rss'); | |
} |