Skip to content

Instantly share code, notes, and snippets.

View gnehs's full-sized avatar
🥞
pancake.tw

gnehs gnehs

🥞
pancake.tw
View GitHub Profile
@gnehs
gnehs / get-master-suica-event-cards-tw.js
Last active September 9, 2023 07:52
取得適用於 Master Card 西瓜卡活動的信用卡
const headers = {
accept: "application/json, text/plain, */*",
"content-type": "application/json",
};
async function getBankList() {
let result = await fetch(
"https://specials.priceless.com/website/api/v1/issuer",
{
headers,
referrerPolicy: "origin-when-cross-origin",
@gnehs
gnehs / index.mjs
Created August 3, 2023 07:06
Remove [Fonts] section from ass file
import fs from "fs";
fs.readdirSync(".").forEach((file) => {
if (file.split(".").at(-1) === "ass") {
let fileData = fs.readFileSync(file, { encoding: "utf-8" }).split("\n");
let isFont = false;
let newFile = [];
for (let line of fileData) {
let matchSectionName = line.match(/\[(.+)\]/);
if (matchSectionName) {
if (matchSectionName[1] === "Fonts") isFont = true;
@gnehs
gnehs / index.js
Created August 29, 2021 11:35
Using MetaMask with Puppeteer
/*
Get MetaMask here: https://github.com/MetaMask/metamask-extension/releases
*/
const puppeteer = require('puppeteer')
let extId
async function main() {
const metamaskPath = path.join(__dirname, '/metamask-chrome-10.0.2')
@gnehs
gnehs / NTUT-Assessment-Autofill.user.js
Last active May 31, 2021 07:52
北科網路教學評量自動填寫小精靈
// ==UserScript==
// @name 北科網路教學評量自動填寫小精靈
// @namespace https://gnehs.net/
// @version 0.3
// @downloadURL https://gist.github.com/gnehs/1728a52ff8ec1f4831d5749d935717c0/raw/NTUT-Assessment-Autofill.user.js
// @description 幫你自動填寫北科教學評量系統
// @author gnehs
// @match https://isms-nagios.ntut.edu.tw/tgrade/PortalTGrade.jsp
// @require https://cdn.jsdelivr.net/npm/sweetalert2@11
// @grant none
@gnehs
gnehs / plugin.js
Last active July 27, 2020 06:23
jellyfin-font-replace
define(['browser', 'require', 'events', 'apphost', 'loading', 'dom', 'playbackManager', 'appRouter', 'appSettings', 'connectionManager', 'htmlMediaHelper', 'itemHelper', 'screenfull', 'globalize'], function (browser, require, events, appHost, loading, dom, playbackManager, appRouter, appSettings, connectionManager, htmlMediaHelper, itemHelper, screenfull, globalize) {
'use strict';
function tryRemoveElement(elem) {
var parentNode = elem.parentNode;
if (parentNode) {
// Seeing crashes in edge webview
try {
@gnehs
gnehs / mkv.sh
Last active March 22, 2024 21:55
抽取 MKV 字幕檔並轉為繁體
#!/bin/sh
echo "------------------------"
echo " 字幕轉轉醬"
echo " 抽取資料夾下的影片並輸出字幕檔案"
echo "------------------------"
echo " 字幕轉轉醬使用了繁化姬的 API 服務"
echo " https://zhconvert.org/"
echo "------------------------"
echo " "
read -p "❓ 輸入資料夾位置:" videodir