Skip to content

Instantly share code, notes, and snippets.

View myjian's full-sized avatar

Ming-yuan Jian myjian

View GitHub Profile
@myjian
myjian / README.md
Last active April 14, 2024 17:06
maimai_player_score.json example
Column Required Description
songName yes
chartType yes 0 = STD, 1 = DX
difficulty yes 0 = BASIC, ..., 3 = MASTER, 4 = Re:MASTER
achievement yes player score for this chart (do not include %)
genre yes when songName is "Link"
level optional field for the internal lv (also known as chart constant)
levelIsPrecise true or false
@myjian
myjian / maimai_song_list.json
Last active September 26, 2023 20:05
maimai_song_list.json example
[
{
"dx": 1,
"name": "おとせサンダー"
},
{
"dx": 1,
"name": "阿修羅ちゃん"
},
{
@myjian
myjian / collect-score.js
Last active March 17, 2024 16:36
Collect score from maimai dx net
/*
收集並複製 maimai 成績
Collect score from maimai dx net.
使用方法:
1. 登入 maimai dx net
2. 畫面停留在首頁就行
3. 按下 F12 開啟網頁開發者工具
4. 切換到開發者工具的 Console 分頁
5. 複製並貼上以下程式碼到 Console 內
@myjian
myjian / nextfile.js
Created September 30, 2018 07:21
mpv user script to navigate to previous/next file
/**
* mpv user script to navigate to previous/next file
* Usage: Add the following lines to input.conf
*
* MBTN_BACK script-message navigate prev
* MBTN_FORWARD script-message navigate next
* Shift+LEFT script-message navigate prev
* Shift+RIGHT script-message navigate next
* WHEEL_LEFT script-message navigate prev
* WHEEL_RIGHT script-message navigate next
@myjian
myjian / hdx3-video-redirect.js
Last active August 18, 2018 23:13
Intelligently get password and play video for hdx3
/**
* This is a set of user scripts that open direct link to video for
* hdx3 blog when user hits the "確定" button next to the password input.
*
* Installation:
* 1. Install Tampermonkey browser extension.
* 2. Create a new script. Copy and paste PART 1 and save.
* 3. Create another script. Copy and paste PART 2 and save.
* 4. Restart the browser, OR reload any existing hdx3 pages.
*
@myjian
myjian / extract.py
Last active December 27, 2017 00:23
Extract Japanese zip file
import zipfile
import shutil
zipname = "brs.zip"
with zipfile.ZipFile(zipname) as z:
for fileinfo in z.infolist():
with z.open(fileinfo) as f:
unicode_filename = fileinfo.filename.decode("shift_jis").encode("utf-8")
with open(unicode_filename, "wb") as outputfile:
@myjian
myjian / Solution.java
Last active October 3, 2016 23:48
The Skyline Problem
import java.util.*;
public class Solution {
public List<int[]> getSkyline(int[][] buildings) {
// idxes: idx -> list of (start(1) or end(0), building idx)
TreeMap<Integer, List<int[]>> idxes = new TreeMap<>();
for (int i = 0; i < buildings.length; i++) {
int[] b = buildings[i];
if (!idxes.containsKey(b[0])) idxes.put(b[0], new LinkedList<int[]>());
if (!idxes.containsKey(b[1])) idxes.put(b[1], new LinkedList<int[]>());
@myjian
myjian / file-upload-example.js
Created December 11, 2015 10:31
File Upload using Multer with Express (Node.JS)
var express = require('express');
var multer = require('multer');
var upload = multer({ dest: 'uploads/'});
var PORT = 3000;
var app = express();
var htmlHeader = '<!DOCTYPE html>'
+ '<html lang="en">'
+ '<head>'
<link rel="apple-touch-icon" sizes="57x57" href="/apple-touch-icon-57x57.png">
<link rel="apple-touch-icon" sizes="114x114" href="/apple-touch-icon-114x114.png">
<link rel="apple-touch-icon" sizes="72x72" href="/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="144x144" href="/apple-touch-icon-144x144.png">
<link rel="apple-touch-icon" sizes="60x60" href="/apple-touch-icon-60x60.png">
<link rel="apple-touch-icon" sizes="120x120" href="/apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" sizes="76x76" href="/apple-touch-icon-76x76.png">
<link rel="apple-touch-icon" sizes="152x152" href="/apple-touch-icon-152x152.png">
<link rel="icon" type="image/png" href="/favicon-196x196.png" sizes="196x196">
<link rel="icon" type="image/png" href="/favicon-160x160.png" sizes="160x160">
@myjian
myjian / scrape.js
Last active August 29, 2015 14:01
CCSP-HW4
var request = require('request');
var cheerio = require('cheerio');
var fs = require('fs');
var appledailyURL = [
'http://www.appledaily.com.tw/realtimenews/section/new/1',
'http://www.appledaily.com.tw/realtimenews/section/new/2',
'http://www.appledaily.com.tw/realtimenews/section/new/3',
'http://www.appledaily.com.tw/realtimenews/section/new/4',
'http://www.appledaily.com.tw/realtimenews/section/new/5'];