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
body { | |
background: rgb(204, 204, 204); | |
font-family: 'Droid Serif', sans-serif; | |
margin: 0; | |
} | |
input[type='number']::-webkit-inner-spin-button, | |
input[type='number']::-webkit-outer-spin-button { | |
opacity: 1; | |
} | |
.details { |
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
const scrollTop = () => { | |
const scrollPos = document.documentElement.scrollTop || document.body.scrollTop; | |
if (scrollPos > 0) { | |
window.requestAnimationFrame(scrollTop); | |
window.scrollTo(0, scrollPos - scrollPos / 8); | |
} | |
}; | |
// How2use? | |
scrollToTop(); |
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
// Take a pics. | |
const findImages = (el, withDuplicates = false) => { | |
const images = [...el.getElementsByTagName('img')].map(img => img.getAttribute('src')); | |
return withDuplicates ? images : [...new Set(images)]; | |
}; | |
// Examples | |
findImages(document); // ['image1.jpg', 'image2.png'] | |
findImages(document, true); // ['image1.jpg', 'image1.png'] |
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
// Detect device | |
const detectDeviceType = () => | |
/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) | |
? 'mobile' | |
: 'desktop'; | |
// How2use? | |
detectDeviceType(); |
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
const foo = 'name' |
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
const videos = [...document.querySelectorAll('.label.style-scope.ytcp-thumbnail')]; | |
const pattern = /[0-9]:../gi | |
const time = videos.map(item => item.textContent.match(pattern)[0]); | |
const pageTime = time.reduce((acc, curr) => acc += curr.split(':').reduce((acc,time) => (60 * acc) + +time), 0); | |
console.log(`Total time on page ${pageTime} seconds`); |
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 christmas(x) { | |
if(x < 3) { | |
return ""; | |
} | |
let tree = ""; | |
for(let i = 1; i <= x; i++) { | |
for(let j = 1; j <= x + x - 1; j++) { | |
if(j <= x - i || j >= x + i) { | |
tree += " "; | |
} else { |
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
codesign --remove-signature /Applications/Visual\ Studio\ Code.app/Contents/Frameworks/Code\ Helper\ \(Renderer\).app |
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
<div class="creative"> | |
<!-- column-left --> | |
<div class="column-left"> | |
<div class="copy"> | |
<div class="moveable"><div class="text-first">{{ copy1 }}</div></div> | |
<div class="moveable"> | |
<div class="text-second"><span class="line-wrapper">{{ copy2 }}</span></div> | |
</div> | |
</div> | |
</div> |
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 JSSnippet to "snippet" | |
tell application "Keyboard Maestro Engine" | |
set JSSnippet to getvariable "snippet" | |
end tell | |
tell application "Arc" | |
set JSResult to execute front window's active tab javascript JSSnippet | |
end tell |