Install build tools:
brew install autoconf automake libtool
Then install PECL:
Install build tools:
brew install autoconf automake libtool
Then install PECL:
#!/usr/bin/env ruby | |
# encoding: UTF-8 | |
@dot_cycle = ['⣾','⣽','⣻','⢿','⡿','⣟','⣯','⣷'] | |
#braille random: 0x2800 - 0x28ff | |
@z_arrow = ['←','↖','↑','↗','→','↘','↓','↙'] | |
@z_b = ['b','ᓂ','q','ᓄ'] | |
@z_d = ['d','ᓇ','p','ᓀ'] |
<?php | |
// copied from python code at https://stackoverflow.com/a/23221582/3103058 | |
function base32_decode($key) { | |
// https://www.php.net/manual/en/function.base-convert.php#122221 | |
$key = strtoupper($key); | |
list($t, $b, $r) = array("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567", "", ""); | |
foreach(str_split($key) as $c) | |
$b = $b . sprintf("%05b", strpos($t, $c)); | |
foreach(str_split($b, 8) as $c) | |
$r = $r . chr(bindec($c)); |
<?php | |
define('OAUTH2_CLIENT_ID', ''); | |
define('OAUTH2_CLIENT_SECRET', ''); | |
$authorizeURL = 'https://github.com/login/oauth/authorize'; | |
$tokenURL = 'https://github.com/login/oauth/access_token'; | |
$apiURLBase = 'https://api.github.com/'; | |
session_start(); |
public static void exportAllDatabases(final Context context) { | |
Log.d(LOG_TAG, "exportAllDatabases: "); | |
File sd = Environment.getExternalStorageDirectory(); | |
if (sd.canWrite()) { | |
final File[] databases = new File(context.getFilesDir().getParentFile().getPath() + "/databases").listFiles(); | |
for (File databaseFile: databases) { | |
final String backupFilename = databaseFile.getName() + "-" + Build.SERIAL + | |
"-" + System.currentTimeMillis() + ".db"; | |
File backupFile = new File(sd, backupFilename); | |
FileChannel inputChannel = null; |
/* | |
* Copyright 2007 Richard Chen | |
* mail: richardchen0310@gmail.com | |
* | |
* 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 | |
* |
<?php | |
/** | |
* 依照 2023 年最新規則進行驗證 | |
* | |
* @see https://www.fia.gov.tw/singlehtml/3?cntId=c4d9cff38c8642ef8872774ee9987283 | |
* | |
* @param string $vat | |
* | |
* @return bool |
editor.on('PastePostProcess', (e) => { | |
setTimeout(async () => { | |
const doc = new DOMParser().parseFromString(editor.getContent(), `text/html`); | |
const promises = []; | |
for (const img of doc.querySelectorAll('img')) { | |
const src = img.src; | |
const p = new Promise((resolve) => { | |
fetch(src) |