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 sleep = (milliseconds) => { | |
return new Promise(resolve => setTimeout(resolve, milliseconds)) | |
} | |
await sleep(2000) |
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 1 - using absolute position for center --> | |
<nav class="navbar navbar-expand-md navbar-dark bg-primary"> | |
<a class="navbar-brand abs" href="#">Navbar 1</a> | |
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#collapsingNavbar"> | |
<span class="navbar-toggler-icon"></span> | |
</button> | |
<div class="navbar-collapse collapse" id="collapsingNavbar"> | |
<ul class="navbar-nav"> | |
<li class="nav-item active"> | |
<a class="nav-link" href="#">Link</a> |
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
#!/bin/bash | |
## calculate the difference between 2 dates | |
date2stamp () { | |
date --utc --date "$1" +%s | |
} | |
dateDiff (){ | |
case $1 in | |
-s) sec=1; shift;; |
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
python -m SimpleHTTPServer 8000 |
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 regex = /:[^:\s]*(?:::[^:\s]*)*:/g; | |
const str = `:any-non-whitespace: | |
:kudos: | |
:text1:sample2: | |
:@(1@#\$@SD: :s: | |
:nospace::inbetween: because there are 2 colons in the middle | |
:nospace:middle:nospace:`; | |
let m; | |
while ((m = regex.exec(str)) !== null) { |
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
<div class="content"> | |
<h1>Sticky Footer with Flexbox</h1> | |
<p><button id="add">Add Content</button></p> | |
</div> | |
<footer class="footer"> | |
Footer | |
</footer> |
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
#!/bin/bash | |
mkdir wordpress && cd wordpress | |
touch docker-compose.yml | |
cat > docker-compose.yml <<EOL | |
version: "2" | |
services: | |
wpdb: | |
image: mariadb | |
ports: | |
- "8081:3306" |
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
<div class="square"> | |
<div class="content"> | |
Hello! | |
</div> | |
</div> |
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
function splitTable(maxHeight) { | |
var selector = null | |
var brief201 = document.querySelector('.print-padding.brief201') | |
if (brief201) { | |
selector = '#brief201section10' | |
} | |
if (!selector) { | |
return | |
} | |
var table = document.querySelector(selector) |