Skip to content

Instantly share code, notes, and snippets.

View Leo1003's full-sized avatar

Shao-Fu Chen Leo1003

  • Taipei
  • 11:24 (UTC +08:00)
View GitHub Profile
@Leo1003
Leo1003 / wikipedia_desktop_redirect.js
Created October 10, 2022 18:40
Useful Greasemonkey scripts
// ==UserScript==
// @name wikipedia_desktop_redirect
// @namespace https://jspenguin.org/monkey
// @description Redirect mobile wikipedia to desktop version
// @include http://*.m.wikipedia.org/*
// @include https://*.m.wikipedia.org/*
// @version 1
// @grant none
// ==/UserScript==
@Leo1003
Leo1003 / keybase.md
Created July 30, 2021 02:46
Keybase proof

Keybase proof

I hereby claim:

  • I am leo1003 on github.
  • I am shfchen (https://keybase.io/shfchen) on keybase.
  • I have a public key ASC35GeTsejPkFYkzajAq8_EVAYJJUN-elsbNNJs6IR9Nwo

To claim this, I am signing this object:

@Leo1003
Leo1003 / Makefile
Last active October 9, 2022 13:07
Leo's makefile
# Toolchain settings
TARGET :=
CC := $(TARGET)gcc
CXX := $(TARGET)g++
AS := $(TARGET)as
LD := $(TARGET)gcc
GDB := $(TARGET)gdb
BUILD ?= debug
@Leo1003
Leo1003 / fission.lua
Last active February 8, 2020 14:42
NuclearCraft Fission Reactor controller for OpenComputers
local component = require("component")
local event = require("event")
local term = require("term")
local thread = require("thread")
local function eprint(s)
io.stderr:write(s.."\n")
end
local DETECT_TIME = 1
Method (_ON, 0, Serialized) // _ON_: Power On
{
If ((OSYS >= 0x07DC))
{
\_SB.PCI0.PGON (Zero)
If ((GPRF != One))
{
VREG = VGAB /* \_SB_.PCI0.PEG0.PEGP.VGAB */
}
}
@Leo1003
Leo1003 / inversion.c
Created October 10, 2018 13:10
A small program which can count inversions in an array
#include<stdio.h>
#include<string.h>
#define ARR_SIZE 100000
unsigned long long ans = 0;
int v[ARR_SIZE];
int tmp[ARR_SIZE];
void merge_sort(int l, int r)
@Leo1003
Leo1003 / base_convertor.c
Created October 10, 2018 13:08
A convertor convert number between BIN, OCT, DEC, and HEX
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef _WIN32
#define getcx getchar
#else
#define getcx getchar_unlocked
#endif
@Leo1003
Leo1003 / random_sorting.cpp
Last active June 8, 2018 15:04
random_sorting
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <chrono>
#include <random>
#include <vector>
#include <utility>
using namespace std;
vector<pair<int, int>> arr;
@Leo1003
Leo1003 / TIOJ.md
Last active April 15, 2018 09:25
TODOLIST
  • Cache Users & Problems AC Statistics
  • Password Recovery
  • E-mail Validation
  • Admin Page
    • Judge Status
    • Judge Manage
    • System Statistics
    • Remove(Merge) Active Admin
  • Permission System (Optional)
  • Problems
@Leo1003
Leo1003 / TrayIconRepair.bat
Last active December 26, 2018 15:12
WindowsScripts
@echo off
echo Reset Internet Explorer for Each User Initialization...
ie4uinit -show
ie4uinit -ClearIconCache
echo Delete Cache Database...
taskkill /f /im explorer.exe
del /f /q "%LocalAppData%\IconCache.db"
del /f /q "%LocalAppData%\Microsoft\Windows\Explorer\iconcache_*.db"
del /f /q "%LocalAppData%\Microsoft\Windows\Explorer\thumbcache_*.db"
echo Delete Cache Registry...