❤️🔥
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 parallel = async (...items) => { | |
const temp = []; | |
for (const item of items) { | |
temp.push(await item); | |
} | |
return temp; | |
}; | |
const finalResult = await parallel(someResult(), anotherResult()); | |
//or |
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($, Drupal) { | |
"use strict"; | |
var exitModalCookie = $.cookie("__exitModal"); | |
// set up exit intent listener to fire modal | |
var exitIntent = function(e) { | |
if (e.clientY < 0 ) { | |
// init remodal | |
var exitModal = $('[data-remodal-id=exit-modal]').remodal(); | |
exitModal.open(); | |
// prevent sowing this more than once per page |
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
data:text/html, <html contenteditable><body style="font-family:menlo, 'lucida console', 'courier new', monospace; margin:20px;border:solid 1px #ccc; padding: 10px;"> |
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:document.body.contentEditable = 'true'; document.designMode='on'; void 0 |
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:(function(){function c(){var e=document.createElement("link");e.setAttribute("type","text/css");e.setAttribute("rel","stylesheet");e.setAttribute("href",f);e.setAttribute("class",l);document.body.appendChild(e)}function h(){var e=document.getElementsByClassName(l);for(var t=0;t<e.length;t++){document.body.removeChild(e[t])}}function p(){var e=document.createElement("div");e.setAttribute("class",a);document.body.appendChild(e);setTimeout(function(){document.body.removeChild(e)},100)}function d(e){return{height:e.offsetHeight,width:e.offsetWidth}}function v(i){var s=d(i);return s.height>e&&s.height<n&&s.width>t&&s.width<r}function m(e){var t=e;var n=0;while(!!t){n+=t.offsetTop;t=t.offsetParent}return n}function g(){var e=document.documentElement;if(!!window.innerWidth){return window.innerHeight}else if(e&&!isNaN(e.clientHeight)){return e.clientHeight}return 0}function y(){if(window.pageYOffset){return window.pageYOffset}return Math.max(document.documentElement.scrollTop,document.body.scrollTop)}funct |
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 getQueryStrAsObj = () => { | |
const paramsToObject = (keys) => { let result = {}; for(let entry of keys) result[entry[0]] = entry[1]; return result }; | |
const params = new URLSearchParams(location.search.substr(1, location.search.length - 1)); | |
return paramsToObject(params.entries()); | |
}; |
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 sleep(ms) { | |
return new Promise(resolve => { | |
console.log(`starting ${ms}`); | |
setTimeout(() => { | |
console.log(`done ${ms}`); | |
resolve(ms); | |
}, ms); | |
}); | |
} |
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/sh | |
git config --global alias.co checkout | |
git config --global alias.ci commit | |
git config --global alias.st status | |
git config --global alias.br branch | |
git config --global alias.hist "log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short" | |
git config --global alias.type 'cat-file -t' | |
git config --global alias.dump 'cat-file -p' |
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
data:text/html;charset=utf-8,<title>In-Browser Text Editor</title><style>body%7Bbackground%3A%23123%3Bcolor%3A%23333%3Bpadding%3A20px%3Bmargin%3A0%2520auto%3Bwidth%3A90%25%7Dtextarea%7Bbackground%3A%23fbfbfb%3Bborder%3A0%3Bcolor%3A%23333%3Bfont-family%3Asans-serif%3Bfont-size%3A2rem%3Bheight%3A98%25%3Bline-height%3A1.4%3Bmargin%3A0%2520auto%3Boutline%3A0%3Bpadding%3A4rem%3Bwidth%3A100%25%7Dbutton%7Bbackground-color%3A%23fbfbfb%3Bborder%3A1px%2520%23ccc%2520solid%3Bcolor%3A%23999%3Bcursor%3Apointer%3Bfloat%3Aright%3Bmargin%3A10px%25200%3Bpadding%3A5px%252010px%7D%40media%2520%28max-width%3A768px%29%7Bbody%7Bwidth%3A100%25%3Bpadding%3A0%7Dtextarea%7Bpadding%3A10px%7Dbutton%7Bfloat%3Anone%7D%7D</style><body><button%20onclick="sM();%20return%20false">Email%20this</button><textarea%20contenteditable%20id=TE%20spellcheck=false%20placeholder=Write...%20autofocus></textarea><script>function%20sM(){var d=new Date();var t=d.toDateString()+' '+d.toLocaleTimeString();var%20a="mailto:[email protected]?subject="+escape("In |
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($, Drupal) { | |
"use strict"; | |
var exitModalCookie = $.cookie("__exitModal"); | |
// set up exit intent listener to fire modal | |
var exitIntent = function(e) { | |
if (e.clientY < 0 ) { | |
// init remodal | |
var exitModal = $('[data-remodal-id=exit-modal]').remodal(); | |
exitModal.open(); | |
// prevent sowing this more than once per page |
OlderNewer