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 | |
declare(strict_types=1); | |
namespace App\Core; | |
use RuntimeException; | |
class SimpleCrypto | |
{ |
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 functools | |
import os | |
import re | |
import sys | |
sys.path.insert(0, os.path.dirname(os.path.realpath(__file__))) | |
# https://github.com/asciimoo/exrex | |
import exrex |
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 | |
/** | |
* Author: [email protected] | |
* Desc: 為了解決中文筆劃排序的問題(只適用繁體中文) | |
* php 可以直接執行 cht_strokesort. | |
*/ | |
final class ChtStroke | |
{ | |
const BIG5_HB_MIN = 0x81; // 高位元組最小值 |
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 build finished successfully! | |
The necessary bits to build these optional modules were not found: | |
_bz2 _curses _curses_panel | |
_dbm _gdbm _lzma | |
_sqlite3 _ssl _tkinter | |
readline zlib _uuid | |
To find the necessary bits, look in setup.py in detect_modules() for the module's name. | |
sudo apt install libbz2-dev libncurses5-dev libgdbm-dev liblzma-dev sqlite3 libsqlite3-dev openssl libssl-dev tcl8.6-dev tk8.6-dev libreadline-dev zlib1g-dev uuid-dev |
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 | |
// Displays details of GD support on your server | |
echo '<div style="margin: 10px;">'; | |
echo '<p style="color: #444444; font-size: 130%;">GD is '; | |
if (\function_exists('gd_info')) { | |
echo '<span style="color: #00AA00; font-weight: bold;">supported</span> by your server!</p>'; |
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 | |
PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:${PATH} | |
SERVER_IP="0.0.0.0" | |
SERVER_PORT="22" | |
SYNC_DIRS=( | |
# MySQL | |
"/usr/local/mysql/bin" |
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 | |
declare(strict_types=1); | |
class IntEncoder | |
{ | |
/** | |
* @var string all unreserved chars in URI | |
* | |
* @see https://en.wikipedia.org/wiki/Percent-encoding#Percent-encoding_in_a_URI |
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
# generate a new pgp key: (better to use gpg2 instead of gpg) | |
gpg --gen-key | |
# maybe you need some random work in your OS to generate a key. so run this command: `find ./* /home/username -type d | xargs grep some_random_string > /dev/null` | |
# check current keys: | |
gpg --list-secret-keys --keyid-format LONG | |
# export private key in gpg: | |
gpg --export-secret-key -a "your_username" |
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 | |
class Lunar | |
{ | |
const MIN_YEAR = 1891; | |
const MAX_YEAR = 2100; | |
const LUNAR_INFO = [ | |
[0, 2, 9, 21936], [6, 1, 30, 9656], [0, 2, 17, 9584], [0, 2, 6, 21168], [5, 1, 26, 43344], [0, 2, 13, 59728], | |
[0, 2, 2, 27296], [3, 1, 22, 44368], [0, 2, 10, 43856], [8, 1, 30, 19304], [0, 2, 19, 19168], [0, 2, 8, 42352], |
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 | |
$foo = []; | |
$foo['love'] = 1; | |
$bar = &$foo['love']; // no harm, huh? | |
$tipi = $foo; | |
$tipi['love'] = 2; |