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
// 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
/* 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
//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
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
/** | |
* Debounce Function | |
* to reduce # of events fired | |
* example: Scroll listeners | |
*/ | |
function debounce(callback, interval) { | |
let debounceTimeoutId; | |
return function(...args) { | |
clearTimeout(debounceTimeoutId); |
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
/** | |
* Unwrap element | |
*/ | |
function unwrap(wrapper) { | |
// place childNodes in document fragment | |
var docFrag = document.createDocumentFragment(); | |
while (wrapper.firstChild) { | |
var child = wrapper.removeChild(wrapper.firstChild); | |
docFrag.appendChild(child); | |
} |
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 getAncestorByAttribute(elem, attribute) { | |
if (elem.parentElement === null) { | |
return false; | |
} else if (elem.hasAttribute(attribute)) { | |
return elem; | |
} else { | |
return getAncestorByAttribute(elem.parentElement, attribute); | |
} | |
} |
OlderNewer