Skip to content

Instantly share code, notes, and snippets.

@clonn
clonn / 00_README.md
Created November 25, 2023 15:26 — forked from LeZuse/00_README.md
Install node on Apple Silicon M1 both ARM and x86 (Rosetta)

Node.js on Apple Silicon

Node Version Manager (https://github.com/nvm-sh/nvm) works perfectly across native node installations as well as emulated Rosetta installations. The trick I am using here is to install one LTS version of node under Rosetta and another stable version as native binary.

TODO

  • find a way how to run the same node version on both platforms
@clonn
clonn / config.json
Created September 2, 2023 07:18
fixed nodebb invalid csrf token with cloudflare https config
{
"url": "https://DOMAIN",
"secret": "----",
"database": "mongo",
"mongo": {
"host": "127.0.0.1",
"port": 27017,
"username": "",
"password": "",
"database": "",
@clonn
clonn / css-media-queries-cheat-sheet.css
Created June 15, 2022 13:46 — forked from bartholomej/css-media-queries-cheat-sheet.css
CSS Media Query Cheat Sheet (with Foundation)
/*------------------------------------------
Responsive Grid Media Queries - 1280, 1024, 768, 480
1280-1024 - desktop (default grid)
1024-768 - tablet landscape
768-480 - tablet
480-less - phone landscape & smaller
--------------------------------------------*/
@media all and (min-width: 1024px) and (max-width: 1280px) { }
@media all and (min-width: 768px) and (max-width: 1024px) { }
@clonn
clonn / pm2-gui.ini
Created March 29, 2022 02:59
pm2-gui.ini setting file
;
; Home directory of pm2.
;
pm2 = ~/.pm2
;
; The monitor will fetch system CPU/Memory amount after this certain time interval.
; it could be milliseconds or various time formats(https://github.com/zeit/ms)
;
refresh = 5s
;
@clonn
clonn / easyappointment_ubuntu20.04.sh
Last active March 14, 2022 17:58
easyappointment install require on ubuntu 20.04
sudo apt-get install php7.4-cli
sudo apt-get install php-curl
sudo apt-get install php7.4-gd
sudo apt install php-xml
# install composer
# https://www.digitalocean.com/community/tutorials/how-to-install-and-use-composer-on-ubuntu-20-04
composer update
@clonn
clonn / solution.sh
Created March 6, 2022 07:34
MacOS, Mysql, import [ERROR in query 44] Row size too large (> 8126). Changing some
# MacOS
$vim /usr/local/etc/my.cnf
# the content
###
innodb_strict_mode = 0
###
$brew services restart mariadb
@clonn
clonn / easyappointments_install.sh
Last active February 15, 2022 02:50
m1 easyappointments install
cp config-example.php config.php
# edit config the host and db setup
# check details https://github.com/alextselegidis/easyappointments/blob/master/docs/docker.md
composer config --global --auth github-oauth.github.com ${GITHUB_DEVELOPER_TOKEN}
brew install php
brew install composer
composer require phpunit/phpunit
composer require phpspec/prophecy
composer install
@clonn
clonn / q.py
Created January 27, 2022 14:33
requests by BeautifulSoup
import re
import sqlite3
import uuid
import requests
from bs4 import BeautifulSoup
MAX_PAGE = 10000
COOKIES = {
'over18': '1'
@clonn
clonn / mac_homebrew_install.sh
Last active January 1, 2022 02:59
new mac install homebrew
brew install wget
brew install curl
brew install git
nvm install v12.18.0
nvm install v14.17.0

台灣地址解析

此篇紀錄處理門牌地址格式過程遇到的一些問題。

字串解析

地址-WIKI解說,台灣地址大致由下列部分組成

縣市_行政區_街道名稱_門牌編號

>EX: 台中市_中區_台灣大道1段_1號