This file contains hidden or 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
@startuml | |
' uncomment the line below if you're using computer with a retina display | |
' skinparam dpi 300 | |
!define Table(name,desc) class name as "desc" << (T,#FFAAAA) >> | |
' we use bold for primary key | |
' green color for unique | |
' and underscore for not_null | |
!define primary_key(x) <b>x</b> | |
!define unique(x) <color:green>x</color> | |
!define not_null(x) <u>x</u> |
This file contains hidden or 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
# Terminal Cheat Sheet | |
pwd # print working directory | |
ls # list files in directory | |
cd # change directory | |
~ # home directory | |
.. # up one directory | |
- # previous working directory | |
help # get help | |
-h # get help |
This gist is a simple no-brainer description of the 3 ways (actually 2.5) the Web handle events.
The declarative inline HTML event listener is mostly an indirection of DOM Level 0 events, meaning this simply uses the equivalent of tag.onclick = listener
behind the scene.
click me
This file contains hidden or 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 t = [] | |
function yFib(n) { | |
return (function(fn) { | |
return fn(fn, n) | |
})(function(fn, n) { | |
t.push(n) | |
if (n <= 1) { | |
return n | |
} else { |
This file contains hidden or 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
%%[ | |
var @contextInsertDate | |
set @contextInsertDate = AttributeValue("YOUR_TSD_DE_INSERT_DATE") | |
set @contextInsertDate = format(@contextInsertDate,"yyyyMMddhhmmss") | |
var @exclude | |
set @exclude = 0 |
This file contains hidden or 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
<script language="javascript" runat="server"> | |
// Author: Eliot Harper <eliot@eliot.com.au> | |
// Revision date: January 31, 2021 | |
// DISCLAIMER | |
// While due care has been taken in the preparation of this | |
// supplied code example, no liability is assumed for incidental | |
// or consequential damages in connection with or arising out its | |
// use. Example code is provided on an "as is" basis and no | |
// expressed or implied warranty of any kind is made for the |
This file contains hidden or 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
scrollTo = (el) => { | |
window.scroll({ | |
behavior: 'smooth', | |
left: 0, | |
top: el.offsetTop | |
}); | |
} | |
document.getElementById("btt").addEventListener('click', () => { | |
scrollTo(document.getElementById("top")); |
This file contains hidden or 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
### example based on Tailwind CSS | |
### demo: https://codepen.io/ttntm/full/eYNRQYz | |
---- | |
<div class="map_canvas relative"> | |
<div class="map_overlay absolute top-0 left-0 flex flex-col justify-center"> | |
<span class="self-center text-center text-2xl text-petrolblue">Click to activate this map</span> | |
</div> | |
<iframe class="map no_scroll" width="100%" height="400" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://www.openstreetmap.org/export/embed.html?bbox=16.35138720273972%2C48.19426099352119%2C16.354927718639377%2C48.19583796732457&layer=mapnik&marker=48.19504948648988%2C16.353157460689545"></iframe> | |
</div> | |
<style> |
This file contains hidden or 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
// document is necessary; window context requires a click into the page body for it to work (at least in Chrome) | |
document.addEventListener('keydown', function(e){ | |
if((e.key=='Escape'||e.key=='Esc'||e.keyCode==27)){ // if necessary: target specific node with: && (e.target.nodeName=='BODY') | |
// if necessary: e.preventDefault(); | |
// do something with the ESC button press, i.e. close modal/NAV/lightbox etc. | |
} | |
}, true); |