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
Default: | |
find * -type d -exec chmod 755 {} \; | |
find * -type f -exec chmod 644 {} \; | |
For Groups: | |
find * -type d -exec chmod 775 {} \; | |
find * -type f -exec chmod 664 {} \; |
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 scrollToDiv(target) { | |
var loc = $(target).offset(); | |
jQuery("html,body").animate({ | |
scrollTop: loc.top-150//, | |
//scrollLeft: loc.left | |
}); | |
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
function formatParamsObjectToURL( params ){ | |
return "?" + Object | |
.keys(params) | |
.map(function(key){ | |
return key+"="+encodeURIComponent(params[key]) | |
}) | |
.join("&") | |
} |
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
// javascript word cut | |
function cut(n) { | |
return function textCutter(i, text) { | |
var short = text.substr(0, n); | |
if (/^\S/.test(text.substr(n))) | |
return short.replace(/\s+\S*$/, ""); | |
return short; | |
}; | |
} |
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
//Modal styles - mostly based on Bootstrap | |
@mixin modal() { | |
position: fixed; | |
pointer-events: none; | |
opacity: 0; | |
top: 0; | |
right: 0; | |
bottom: 0; | |
left: 0; | |
z-index: 1050; |
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
/** | |
* Filter the except length to 20 words. | |
* | |
* @param int $length Excerpt length. | |
* @return int (Maybe) modified excerpt length. | |
*/ | |
function wpdocs_custom_excerpt_length( $length ) { | |
return 20; | |
} | |
add_filter( 'excerpt_length', 'wpdocs_custom_excerpt_length', 999 ); |
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
/* Coursey of https://alligator.io/css/css-scrollbars */ | |
/* The emerging W3C standard | |
that is currently Firefox-only */ | |
* { | |
scrollbar-width: thin; | |
scrollbar-color: blue orange; | |
} | |
/* Works on Chrome/Edge/Safari */ |
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 corsTest(url) { | |
console.log("cors-test"); | |
var http = new XMLHttpRequest(); | |
http.open('GET', url, true); | |
http.onreadystatechange = function() {//Call a function when the state changes. | |
console.log(http.responseText) | |
} |
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
/** | |
* Debounce Function | |
* to reduce # of events fired | |
* example: Scroll listeners | |
*/ | |
function debounce(callback, interval) { | |
let debounceTimeoutId; | |
return function(...args) { | |
clearTimeout(debounceTimeoutId); |
OlderNewer