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 | |
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/ | |
/* Remove Yoast SEO Canonical From All Pages | |
* Credit: Yoast Team | |
* Last Tested: Jun 16 2017 using Yoast SEO 4.9 on WordPress 4.8 | |
*/ | |
add_filter( 'wpseo_canonical', '__return_false' ); |
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
{ | |
// http://eslint.org/docs/rules/ | |
"ecmaFeatures": { | |
"binaryLiterals": false, // enable binary literals | |
"blockBindings": false, // enable let and const (aka block bindings) | |
"defaultParams": false, // enable default function parameters | |
"forOf": false, // enable for-of loops | |
"generators": false, // enable generators | |
"objectLiteralComputedProperties": false, // enable computed object literal property names |
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
# Set Paths | |
# ------------------------------------------------------------ | |
export PATH="$PATH:/usr/local/bin/" | |
export PATH="/usr/local/git/bin:/sw/bin/:/usr/local/bin:/usr/local/:/usr/local/sbin:/usr/local/mysql/bin:$PATH" | |
# Set Default Editor (change 'Nano' to the editor of your choice) | |
# ------------------------------------------------------------ | |
export EDITOR=/usr/bin/nano | |
# Misc shortcuts |
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
//All letters to uppercase. Don't transform non-alphabetic characters (i.e. spaces, punctuation), but do pass them on. | |
function rot13(str) { | |
var codeArr = [], seq, final = ""; | |
for (var i = 0; i < str.length; i++) { | |
uCode = str.charCodeAt([i]); | |
if ((uCode > 64 && uCode < 78) || (uCode > 96 && uCode < 110)) { | |
uCode += 13; | |
codeArr.push(uCode); | |
} else if ((uCode > 77 && uCode < 91) || (uCode > 109 && uCode < 123)){ |
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 getIndexToIns(arr, num) { | |
let numArr = arguments[0], | |
addNum = arguments[1]; | |
numArr.push(addNum); | |
numArr.sort(function(a, b) { | |
return a - b; | |
}); | |
return numArr.indexOf(addNum); | |
} |
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 destroyer(args) { | |
var args = [...arguments] | |
, finalArray = [] | |
, targetArray = args.shift(); | |
finalArray = targetArray.filter(function(el) { | |
return args.every(function(arg) { | |
return ( el !== arg); | |
}); | |
}); |
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 bouncer(arr) { | |
var newArr = arr.filter( function(el) { | |
if (el) { | |
return el; | |
} | |
}); | |
return newArr; | |
} | |
bouncer([7, "ate", "", false, 9]); |
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 mutation(arr) { | |
var str1 = arr.slice(0, 1).join(" ").toLowerCase(), | |
str2 = arr.slice(1).join(" ").toLowerCase(), | |
hits = 0; | |
for (var i = 0; i < str2.length; i++) { | |
if (str1.indexOf(str2[i]) !== -1) { | |
hits += 1; | |
} | |
} | |
if (hits === str2.length) { |
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
// Write a function that splits an array (first argument) into groups the length of size (second argument) and returns them as a two-dimensional array. | |
function chunkArrayInGroups(arr, size) { | |
var newArr = []; | |
beginSlice = 0, | |
endSlice = size; | |
for (var i = 0; i < (arr.length/size); i++) { | |
newArr.push(arr.join("").slice(beginSlice, endSlice).split()); | |
beginSlice += size; |
NewerOlder