Skip to content

Instantly share code, notes, and snippets.


MaverickTse MaverickTse

View GitHub Profile
MaverickTse /
Last active Sep 23, 2017
work division on doujin publication in Japan




  1. 作畫 (Roy)
  2. 翻譯 (MT)
  3. 按平台格式要求修正 (Roy, MT)
  4. 將文件及說明交給日方登記及上傳
  5. [若是實體物] 支付生產費予日方 (Roy, Ken)
MaverickTse / rec.ps1
Created Sep 22, 2017
Webcam recording using FFmpeg(need zeranoe or with text/font libs included)
View rec.ps1
cd "D:\ffmpeg-z"
./ffmpeg.exe -y -s 640x480 -framerate 25 -rtbufsize 100MB -f dshow -i video="Logitech HD Webcam C525":audio="Microphone (HD Webcam C525)" -vf "drawtext=expansion=strftime:fontfile=arial.ttf:text='%a %d\.%m\.%Y / %H\:%M\:%S':x=10:y=10:fontcolor=white: box=1: boxcolor=0x00000000@0.7" -vcodec h264 -acodec aac -t 00:58:00 $("D:/"+(Get-Date -UFormat "%Y%m%d%-%H%M").ToString()+".mp4")
MaverickTse /
Created Sep 22, 2017
Scan a mono 16bit signed PCM wave file for sound level exceeding certain threshold
import os
import numpy as np
import argparse
import as w
def GetHMS(total_seconds:int):
hr = np.floor(total_seconds/3600)
q1 = total_seconds % 3600
m = np.floor(q1/60)
MaverickTse / extract_audio.ps1
Created Sep 22, 2017
PowerShell script to extract audio using FFmpeg. Down-mixing to mono
View extract_audio.ps1
if ($folder){
cd $folder
$filelist= Get-ChildItem -Path $folder -Name -Include *.mp4
Write-Output $filelist
ForEach ($f in $filelist){
$bname = (Get-Item $f).BaseName
MaverickTse / render_length_estimate.html
Created Aug 16, 2017
Estimate rendered length of a string in SVG and HTML5 canvas
View render_length_estimate.html
<meta lang="en-us" encoding="utf-8"/>
<title>Canvas Test</title>
function check_txt_length()
var txt = document.getElementById("sample").value;
var cv = document.createElement("canvas");
MaverickTse / jpmynum_checkdigit_avx.cpp
Last active Apr 8, 2017
Calculating Japan's My Number check digit using AVX intrinsics
View jpmynum_checkdigit_avx.cpp
#include <string>
#include <immintrin.h> //AVX
#include <tmmintrin.h> //SSSE3
#include <iostream>
#include <stdexcept>
#include <array>
/// Function to calculate check digit with AVX2 intrinsics
/// parm: a 11 digit number as string
/// ret: an unsigned integer 0~11
MaverickTse / main.cpp
Created May 15, 2016
Vulkan initialization with GLFW and VK_CPP
View main.cpp
// vulkan_fw_test.cpp : Defines the entry point for the console application.
#pragma comment(lib,"vulkan-1.lib") //DLL version
#pragma comment(lib,"glfw3.lib")
#define GLFW_INCLUDE_VULKAN //as required by GLFW
#include "stdafx.h" // optional headers
#include "vulkan\vk_cpp.hpp" //copy this header to your VulkanSDK include folder
#include "GLFW\glfw3.h" //GLFW header
View twitter_star.css
/* Reference: */
/* The is the old default star, no animation */
.HeartAnimationContainer:before,.Icon--heart:before{content:"\f147";display:block;font-family:"rosettaicons";font-weight:normal;font-style:normal;text-align:center;-webkit-font-smoothing:antialiased;} .HeartAnimation,.HeartAnimation{display:none!important;}
.tweet-action[rel="favorite"]:hover,.tweet-detail-action[rel="favorite"]:hover,.tweet-action[rel="favorite"]:focus,.tweet-detail-action[rel="favorite"]:focus,.tweet-action[rel="favorite"]:active,.tweet-detail-action[rel="favorite"]:active,[rel="favorite"],.Icon--favorited,.Icon--colorFavorited,.ProfileTweet-action--favorite .ProfileTweet-actionButton:hover *,.ProfileTweet-action--favorite .ProfileTweet-actionButton:focus,.ProfileTweet-action--favorite .ProfileTweet-actionCount:hover,.ProfileTweet-action--favorite .ProfileTweet-actionCount:focus,.twe