Skip to content

Instantly share code, notes, and snippets.

View yujinlin0224's full-sized avatar
🏳️‍⚧️

Yùjǐn Lín yujinlin0224

🏳️‍⚧️
View GitHub Profile
@yujinlin0224
yujinlin0224 / RedirectShopeeProductPage.user.js
Last active October 20, 2023 20:56
Redirect shopee product page
// ==UserScript==
// @name Redirect shopee product page
// @version 1.2
// @namespace https://yurina.dev/
// @downloadURL https://gist.github.com/yujinlin0224/0a3db4c4d3e48377756918378f716430/raw/RedirectShopeeProductPage.user.js
// @updateURL https://gist.github.com/yujinlin0224/0a3db4c4d3e48377756918378f716430/raw/RedirectShopeeProductPage.user.js
// @homepageURL https://github.com/yujinlin0224
// @author yujinlin0224
// @description Redirect shopee product page
// @match http*://shopee.tw/*
@yujinlin0224
yujinlin0224 / DownloadLastestNvidiaDriver.ps1
Last active March 12, 2023 07:26
Download Lastest Nvidia Driver
$ServiceBaseUrl = "https://gfwsl.geforce.com/services_toolkit/services/com/nvidia/services/AjaxDriverService.php"
$ServiceUrlBuilder = [System.UriBuilder]::new($ServiceBaseUrl)
$ServiceUrlQuery = [System.Web.HttpUtility]::ParseQueryString($ServiceUrlBuilder.Query)
$ServiceUrlQuery.Add("func", "DriverManualLookup")
$ServiceUrlQuery.Add("psid", 120) # Geforce RTX 30 Series
$ServiceUrlQuery.Add("pfid", 929) # Geforce RTX 3080
# $ServiceUrlQuery.Add("osID", 57) # Windows 10
$ServiceUrlQuery.Add("osID", 135) # Windows 11
$ServiceUrlQuery.Add("languageCode", 1028) # Chinese, Taiwan
$ServiceUrlQuery.Add("beta", 0)
@yujinlin0224
yujinlin0224 / RedirectWikiwandToWikipedia.user.js
Created October 31, 2022 08:54
Redirect Wikiwand To Wikipedia
// ==UserScript==
// @name Redirect Wikiwand To Wikipedia
// @version 1.0
// @namespace https://yurina.dev/
// @downloadURL https://gist.github.com/yujinlin0224/?/raw/RedirectWikiwandToWikipedia.user.js
// @homepageURL https://github.com/yujinlin0224
// @author yujinlin0224
// @description Redirect Wikiwand To Wikipedia
// @include *://www.wikiwand.com/*
// ==/UserScript==
@yujinlin0224
yujinlin0224 / waifu2x-caffe-video.ps1
Created October 1, 2022 08:05
waifu2x-caffe-video.ps1 (2017/06/04)
# Define some arguments and these default values form "waIfu2x-caffe-cui.exe" that may be used.
param (
[String] $Mode = "noise_scale",
[Decimal] $ScaleRatio = 2.0,
[Int] $ScaleWidth = 0,
[Int] $ScaleHeight = 0,
[Int] $NoiseLevel = 0,
[String] $Process = "cpu",
[Int] $CropSize = 128,
[Int] $GPU = 0,
@yujinlin0224
yujinlin0224 / VideoTrumbnailMaker.ps1
Created October 1, 2022 08:04
VideoTrumbnailMaker.ps1 (2018/07/22)
param (
[Parameter(Mandatory=$True)] [String] $InputPath,
[Parameter(Mandatory=$True)] [String] $OutputDir = [System.IO.Path]::GetDirectoryName("$InputPath"),
[Parameter(Mandatory=$False)] [String] $OutputType = "png",
[Parameter(Mandatory=$True)] [Int] $XCount,
[Parameter(Mandatory=$True)] [Int] $YCount,
[Parameter(Mandatory=$True)] [Int] $Width,
[Parameter(Mandatory=$True)] [Int] $Height
)
@yujinlin0224
yujinlin0224 / MouseNaturalScrolling.ps1
Created August 21, 2022 01:39
Make all mice in Windows scrolling like macOS (natural/reverse mouse scrolling)
Get-ChildItem 'HKLM:\SYSTEM\CurrentControlSet\Enum\HID' -Include 'Device Parameters' `
-Recurse -Depth 2 -ErrorAction 'SilentlyContinue' |
Select-Object -ExpandProperty PSPath |
Where-Object { (Get-Item $_).Property -Contains 'FlipFlopWheel' } |
ForEach-Object { Set-ItemProperty $_ 'FlipFlopWheel' -Value 1 }
@yujinlin0224
yujinlin0224 / InstallWindowsRedists.ps1
Last active February 28, 2023 11:39
[Deprecated, use winget instead] Install all redistributable packages for Windows, including Microsoft Visual C++ 2005-2022 Redistributable Packages and DirectX End-User Runtime.
$tempPath = [System.IO.Path]::GetTempPath()
$vcredistUrlTable = [ordered]@{
'2005'=[ordered]@{
'x86'='https://download.microsoft.com/download/8/B/4/8B42259F-5D70-43F4-AC2E-4B208FD8D66A/vcredist_x86.EXE'
'x64'='https://download.microsoft.com/download/8/B/4/8B42259F-5D70-43F4-AC2E-4B208FD8D66A/vcredist_x64.EXE'
}
'2008'=[ordered]@{
'x86'='https://download.microsoft.com/download/5/D/8/5D8C65CB-C849-4025-8E95-C3966CAFD8AE/vcredist_x86.exe'
'x64'='https://download.microsoft.com/download/5/D/8/5D8C65CB-C849-4025-8E95-C3966CAFD8AE/vcredist_x64.exe'
@yujinlin0224
yujinlin0224 / RedirectMobileToDesktop.user.js
Last active May 11, 2024 16:15
Redirect mobile version of website to desktop version. Supports Facebook, Twitter, Wikipedia and more (in the future).
// ==UserScript==
// @name Redirect Mobile To Desktop
// @version 2.0
// @namespace https://yurina.dev/
// @downloadURL https://gist.github.com/yujinlin0224/e40b68374b7fc8e4549333a83b7cfbd1/raw/RedirectMobileToDesktop.user.js
// @updateURL https://gist.github.com/yujinlin0224/e40b68374b7fc8e4549333a83b7cfbd1/raw/RedirectMobileToDesktop.user.js
// @homepageURL https://github.com/yujinlin0224
// @author yujinlin0224
// @description Redirect mobile version of website to desktop version
// @match http*://m.facebook.com/*
@yujinlin0224
yujinlin0224 / DmhyAddDownloadTorrentFileColumn.user.js
Last active June 4, 2022 11:30
DMHY Add Download Torrent File Column
// ==UserScript==
// @name DMHY Add Download Torrent File Column
// @version 1.3
// @namespace https://yurina.dev/
// @downloadURL https://gist.github.com/yujinlin0224/161893f118dea3fbe6fe3c55ba258d12/raw/DmhyAddDownloadTorrentFileColumn.user.js
// @homepageURL https://github.com/yujinlin0224
// @author yujinlin0224
// @description DMHY Add Download Torrent File Column
// @include /^https?://((www|share)\.)?dmhy\.org(/.*)?$/
// @require https://raw.github.com/emn178/hi-base32/master/build/base32.min.js
@yujinlin0224
yujinlin0224 / Vote.sol
Last active June 16, 2020 05:20
選舉投票
// SPDX-License-Identifier: MIT
pragma solidity >=0.6;
/// @title 選舉投票
contract Vote {
// 投票者
struct Voter {
string id; // 身分證字號
bool canVote; // 是否能投票