用來記錄及同步 POI page template 格式
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 convertHtmlToMarkdown(html) { | |
let markdown = html; | |
// Remove excess tab characters | |
markdown = markdown.replace(/\t+/g, ''); | |
// Convert links | |
markdown = markdown.replace(/<a\s+href="([^"]*)"\s*>(.*?)<\/a>/g, '[$2]($1)'); | |
markdown = markdown.replace(/<a\s+target="_blank"\s+rel="noopener"\s+href="(.*?)">(.*?)<\/a>/g, '[$2]($1)'); |
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
<template> | |
<button | |
class="add-to-calendar-button" | |
@click="windowOpen(getCalendarUrl('google'))" | |
> | |
<slot /> | |
</button> | |
</template> | |
<script> |
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
echo "auto_prepend_file=/opt/www/proxy.php" >> /etc/php5/cli/php.ini |
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
// https://dev.to/annarankin/finally-in-promises--trycatch-2c44 | |
async function fnA() { | |
try { | |
await sleep(300); | |
console.log('fnA success'); | |
return 'yooo'; | |
} catch { | |
console.error('fnA error'); | |
} finally { | |
console.log('fnA finally'); |
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 up Roboto for old browsers, only regular + bold | |
@font-face { | |
font-family: Roboto; | |
src: url('Roboto-Regular.woff2'); | |
font-weight: normal; | |
} | |
@font-face { | |
font-family: Roboto; | |
src: url('Roboto-Bold.woff2'); | |
font-weight: bold; |
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
#!/usr/bin/env bash | |
set -e | |
helpFunction() { | |
echo "" | |
echo "Usage: $0 -f file_path -o output_path" | |
echo -e "\t-f file path" | |
echo -e "\t-o output path" | |
exit 1 |
修正 git 權限問題 ref: https://stackoverflow.com/a/6694220
sudo chown -Rc $UID .git/
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
window.addEventListener('scroll', function() { | |
var pageHeight = document.documentElement.offsetHeight; | |
var windowHeight = window.innerHeight; | |
var scrollPosition = window.scrollY || window.pageYOffset || document.body.scrollTop + (document.documentElement && document.documentElement.scrollTop || 0); | |
console.log({pageHeight, windowHeight, scrollPosition}); | |
if (pageHeight <= windowHeight + scrollPosition) { | |
console.log('At the bottom'); | |
} |
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 imeiGen() { | |
var pos; | |
var str = new Array(15).fill(0); | |
var sum = 0; | |
var finalDigit = 0; | |
var t = 0; | |
var lenOffset = 0; | |
var len = 15; | |
var issuer; |
NewerOlder