Skip to content

Instantly share code, notes, and snippets.

View hansen033's full-sized avatar

Hansen Chien hansen033

  • Taiwan
View GitHub Profile
import rotatescreen # pip install rotate-screen
# ANSI escape code
class terco:
BL = '\033[0m' # Black
RD = '\033[91m' # Bright Red
BM = '\033[95m' # Bright Magenta
def print_displays_info(displays):
print(f'There are {terco.RD}{len(displays)}{terco.BL} available displays:')
@hansen033
hansen033 / ntpc_lib_random_books.py
Created February 10, 2024 13:18
Open 5 random books in New Taipei City Library WEBPAC
import random
import requests
from bs4 import BeautifulSoup
import webbrowser
def get_random_mid():
# Generate a random number under 2000000
# 1107787 is the biggest known entry
return random.randint(0, 2000000)
@hansen033
hansen033 / AdGuard_DoH_Windows.md
Last active October 27, 2023 11:19 — forked from krcm0209/README.md
Using AdGuard DNS over HTTPS (DoH) on Windows 11 with updated domain

Why

You may want to use AdGuard's DNS over HTTPS[^2] service if you

  1. Want to make it harder for your ISP to know what websites you are requesting (DoH part)
  2. Want to block most traditional ads from your web browsing experience across your entire PC (AdGuard DNS part)
  3. Want to block some malicious site and malware. (AdGuard DNS part)

Setup instructions

@hansen033
hansen033 / tokenPaymentBanks.md
Last active January 2, 2023 17:46 — forked from HenryYang/tokenPaymentBanks.md
在台灣的手機感應 VISA/MASTER/JCB 卡支援銀行對照表

對應表

銀行/支付系統 Apple Pay Google Pay Samsung Pay Garmin Pay Fitbit Pay 台灣行動支付 Hami Pay 支援家數
國泰世華銀行 6
國泰世華銀行 - 金融卡 6
中國信託銀行 7
中國信託銀行 - 金融卡 4
台新國際商業銀行 7
台新國際商業銀行 - 金融卡 6
聯邦銀行 6
@hansen033
hansen033 / rt mart.cpp
Last active June 9, 2018 13:33
2018/4/19
#include<iostream>
#include<math.h>
using namespace std;
int main(){
cout << "How many product are you going to buy in RT-Mart?";
int product;
cin >> product;
int p[product];
for(int t = 0 ; t < product ; t++){
cout << "What is the NO." << t + 1 << " product price?";
@hansen033
hansen033 / 高b681.cpp
Created April 14, 2018 09:00
2018/4/12
#include <iostream>
using namespace std;
int main(){
int x;
while (cin>>x){
if (x>0){
cout << x*2-1 << "\n";
} else if (x<0){
cout << x*-2 << "\n";
}
#include <iostream>
using namespace std;
int main() {
int a, b = 0;
cout << "你想要比較幾個數?";
cin >> a;
int x[a];
for ( int t = 0 ; t < a ; t ++ ){
cin >> x[t];
#include <iostream>
#include <time.h>
#include <stdlib.h>
using namespace std;
int main()
{
int o[9];
o[0] = 0;
srand ( time(NULL) );
for ( int t = 1 ; t < 9 ; t ++ ){
@hansen033
hansen033 / 身分證驗證.cpp
Last active March 11, 2018 07:56
2018/3/11
#include <iostream>
using namespace std;
int main()
{
char o[10];
int total ,f[2];
cout << "身份證字號檢查\n請輸入身份證字號:";
cin >> o;
switch (o[0]){
case 'A':
#include <iostream>
using namespace std;
int main()
{
int year, yearT, day, w, m, date, dbf, dafeb;
//年 1990後幾年 1990後總天 1號前有幾個 月(變) 日 1前空(day before first) 2月有幾天
cout << "y";
cin >> year;
yearT = year - 1990;