用來記錄及同步 POI page template 格式
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
| FROM php:8.3-bookworm | |
| RUN apt update -q && apt upgrade -y \ | |
| && apt-get install -y build-essential git libnode-dev | |
| RUN cp -s /usr/lib/`uname -m`-linux-gnu/libv8* /usr/local/lib/ \ | |
| && cp -rs /usr/include/node/* /usr/local/include/ | |
| # TODO: Use PECL |
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
| <?php | |
| $url = 'http://google.com'; | |
| $ch = curl_init(); | |
| curl_setopt($ch, CURLOPT_URL, $url); | |
| curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | |
| // 啟用 CURL 信息 | |
| curl_setopt($ch, CURLINFO_HEADER_OUT, true); |
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 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 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
| <template> | |
| <button | |
| class="add-to-calendar-button" | |
| @click="windowOpen(getCalendarUrl('google'))" | |
| > | |
| <slot /> | |
| </button> | |
| </template> | |
| <script> |
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
| echo "auto_prepend_file=/opt/www/proxy.php" >> /etc/php5/cli/php.ini |
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
| // 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 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
| // 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 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
| #!/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/NewerOlder