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
import { createClient, destroyPage } from './puppeteerClient.mjs'; | |
const waitMs = (msec) => new Promise(res => setTimeout(() => res(), msec)); | |
const getLastPageFromPage = async (page) => { | |
return await page.evaluate(() => { | |
const urls = Array.from(document.querySelectorAll('.pagination a[href]')) | |
if (urls.length) { | |
const lastUrl = urls.pop().href; | |
return lastUrl.match(/\d+/g).map(Number)[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
'use client'; | |
import { initializeApp, getApps } from "firebase/app"; | |
import { getAuth, connectAuthEmulator } from "firebase/auth"; | |
import { getFirestore, connectFirestoreEmulator } from "firebase/firestore"; | |
import { getStorage, connectStorageEmulator } from "firebase/storage"; | |
import { firebaseConfig } from "./config"; // replace with your firebase config | |
const init = () => { | |
const appNotAvailable = getApps().length === 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
#!/usr/bin/bash | |
# generate the keystore and show the result | |
storepassword="password" | |
outkeystore="mygen.keystore" | |
if [ $# -gt 0 ]; then | |
outkeystore="$1" | |
fi | |
if [ $# -gt 1 ]; then |
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
<!DOCTYPE html> | |
<html lang="zh-Hant-TW"> | |
<head> | |
<meta charset="UTF-8"> | |
<script src="http://code.jquery.com/jquery.min.js"></script> | |
</head> | |
<body> | |
<input id="imgurClientId" type="text"> |
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
<!DOCTYPE html> | |
<html lang="zh-Hant-TW"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<link href="https://cdn.datatables.net/1.11.3/css/jquery.dataTables.min.css" rel="stylesheet" /> | |
</head> | |
<body> |
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 { google } = require('googleapis'); | |
const dotenv = require('dotenv'); | |
dotenv.config(); | |
const auth = new google.auth.GoogleAuth({ | |
//keyFile: './client_secret.json', // GOOGLE_APPLICATION_CREDENTIALS | |
scopes: [ | |
'https://www.googleapis.com/auth/calendar', | |
'https://www.googleapis.com/auth/calendar.events', | |
], |
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 express = require('express'); | |
const bodyParser = require('body-parser'); | |
const app = express(); | |
const crypto = require('crypto'); | |
const multer = require('multer'); | |
const upload = multer(); | |
app.use(bodyParser.urlencoded({ extended: true })); | |
// app.use(express.urlencoded()); // deprecated |
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
<!DOCTYPE html> | |
<html lang="zh-Hant-TW"> | |
<head><base target="_top"><meta charset="UTF-8"></head> | |
<body> | |
<h1>上傳HTML檔案</h1> | |
<form id="upload_form" onsubmit="onSubmit(event)"> | |
<label for="html_name">網頁名稱</label> | |
<input id="html_name" type="text" name="the-name" required /> | |
<br /> | |
<label for="file_chooser">請選檔案</label> |
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
# /* vim: set ai ts=4 ft=sh: */ | |
# | |
# Copyright 2011, The Android Open Source Project | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.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
echo "install uncompress utils" | |
sudo apt install xz-utils lzip | |
echo "download source codes" | |
wget -c https://www.gnupg.org/ftp/gcrypt/gnutls/v3.6/gnutls-3.6.16.tar.xz -O - | tar -xJ | |
wget -c https://ftp.gnu.org/gnu/nettle/nettle-3.4.1.tar.gz -O - | tar -xz | |
wget -c https://gmplib.org/download/gmp/gmp-6.2.1.tar.lz -O - | tar --lzip -x | |
wget -c http://ftp.gnu.org/gnu/libtasn1/libtasn1-4.9.tar.gz -O - | tar -xz | |
wget -c https://ftp.gnu.org/gnu/libunistring/libunistring-0.9.10.tar.xz -O - | tar -xJ | |
wget -c https://github.com/libffi/libffi/archive/refs/tags/v3.0.9.tar.gz -O - | tar -xz |
NewerOlder