Skip to content

Instantly share code, notes, and snippets.

View supersonictw's full-sized avatar
🦋

不知火 Shiranui supersonictw

🦋
View GitHub Profile
@supersonictw
supersonictw / 89s51-1.c
Last active March 7, 2020 13:45
Keli C TEST Code for Atmel AT89S51
#include <reg51.h>
#define LED P1
// (c) 2020 SuperSonic (https://github.com/supersonictw)
sbit buzzer = P0 ^ 1;
void delay500us(int);
void pulse_bz(int, int, int);
@supersonictw
supersonictw / black_hole_4numbers.py
Last active February 29, 2020 08:50
To verify black hole number by python
# /usr/bin/env python3
# (c) 2020 SuperSonic (https://github.com/supersonictw)
import random
def int_split(num: int):
return [i for i in str(num)]
def int_com(num: list):
@supersonictw
supersonictw / control_program.sh
Last active April 26, 2024 12:22
To control program in shell
#!/bin/sh
# control_program.sh
# To control program in shell
# License: MIT (https://ncurl.xyz/s/RD0Yl5fSg)
# https://gist.github.com/supersonictw/007bfb79d6c7bbfc7658549d3c52ab60
case $2 in
"start" )
if [ -f "/tmp/.cp_lock-$1" ]; then
echo "The pidfile already exists."
@supersonictw
supersonictw / violet-schema.xml
Last active February 28, 2020 04:18
The default schema for StarStart! Service
<!--
Violet - The default schema for StarStart! Service
https://github.com/star-inc/butterfly
(c)2020 Star Inc.
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
-->
<!-- Move to https://github.com/star-inc/violet -->
@supersonictw
supersonictw / autocompile_golang.bash
Last active February 29, 2020 10:32
To auto-compile programs for every platforms Go supported
#!/bin/bash
# autocompile_golang.bash
# To auto-compile programs for every platforms Go supported
# (c)2020 Star Inc. (https://starinc.xyz)
# https://golang.org/doc/install/source#environment
GOOS_LIST=('android' 'darwin' 'linux')
GOARCH_LIST=('386' 'amd64' 'arm' 'arm64')
BUILD_LOG_LIST='.compile_log'
{
"Afghanistan": {
"zh_TW": "阿富汗",
"location": [
33,
65
]
},
"Albania": {
"zh_TW": "阿爾巴尼亞",
<?php
/**
* Given a URL, normalize that URL.
* @param String URL
* @return String Normalized URL
*/
function normalizeUrl($input_url)
{
$newUrl = "";
$url = parse_url($input_url);
@supersonictw
supersonictw / PHP 註解規範.md
Last active April 16, 2023 14:23 — forked from angusty/php注释规范
PHP 通用註解寫法

PHP 註解規範

通用註解寫法

一、文件的註解通用樣例(普通程式文件,類文件,函數文件,變量定義文件)

/**
 * XXXXX的文件
 *
@supersonictw
supersonictw / opi_fan.py
Last active April 26, 2024 12:21
Cold down the temperature of OPi automatically.
#!/usr/bin/python3
# opi_fan - Cold down the temperature of OPi automatically.
# License: MIT (https://ncurl.xyz/s/RD0Yl5fSg)
# https://gist.github.com/supersonictw/046e10024038c18ccb46cbf3f1a88b79
from sys import argv
from time import sleep
from gpiod import (
@supersonictw
supersonictw / 取得基本課表資料.js
Last active September 2, 2022 07:07
NKUST 衝堂過濾腳本
// ==UserScript==
// @name 取得基本課表資料
// @namespace https://gist.github.com/supersonictw/81535219f2505a29b4787935c851d6ed
// @version 0.1.7
// @description 把高科課表轉為JSON資料型態
// @author SuperSonic (https://github.com/supersonictw)
// @match https://mobile.nkust.edu.tw/Student/Course*
// @license MIT License
// @grant none
// ==/UserScript==