Skip to content

Instantly share code, notes, and snippets.

View nicholastay's full-sized avatar

Nicholas Tay nicholastay

View GitHub Profile
@nicholastay
nicholastay / discord.css
Last active July 20, 2019 10:49
My personal discord "theme" - use with dark theme & beautifuldiscord
/* ------------------------------------------- *
* | nexerq <3 ~ discord custom css | *
* ------------------------------------------- *
* ~ t: @_nexerq
* ~ discord update ver: Dec 21, 2017
* ~ updated 2018년 1월 22일
*/
@nicholastay
nicholastay / vtt2srt.js
Last active April 2, 2018 06:22
Quick js script to convert vtt format data to srt
function vtt2srt(raw) {
if (raw.substr(0,6) !== 'WEBVTT')
throw new TypeError('data does not look like webvtt');
var vtt = raw.replace('\r', '').trim();
var data = '1\n' + vtt.substr(vtt.indexOf('\n\n')+2); // get past the blank line and get the 1 started
var i = 1; // iterate the sub numbers
return data.replace(/\n\n/g, str => '\n\n' + (++i) + '\n'); // add the numbers at new lines
}
@nicholastay
nicholastay / ffz_backup.js
Last active October 1, 2019 05:11
Native backup system now available. Should use that! (ffz-settings.json)
let prefix = "FFZ:setting:p:0:";
function serializeFfz() {
let output = {};
Object.keys(localStorage).filter(k => k.startsWith(prefix)).forEach(k => output[k.replace(prefix, "")] = localStorage.getItem(k));
return JSON.stringify(output);
}
function restoreFfz(obj) {
Object.keys(obj).forEach(k => localStorage.setItem(prefix + k, obj[k]));
@nicholastay
nicholastay / NickMD.sublime-build
Last active June 27, 2018 12:49
Misc MD to PDF build with pandoc system for sublime
{
"selector": "text.html.markdown",
"cmd": ["pandoc", "--verbose", "-o", "$file_path\\\\$file_base_name.pdf", "$file"],
"variants": [
{
"name": "Pandoc LaTeX PDF (Essay template)",
"cmd": ["pandoc", "--verbose", "--template", "C:\\Users\\Nicholas\\Template\\pandoc_essay.tex", "--pdf-engine=xelatex", "-o", "$file_path\\\\$file_base_name.pdf", "$file"]
},
{
@nicholastay
nicholastay / pandoc_essay.tex
Last active July 5, 2018 04:56
My essay template for pandoc
%!TEX TS-program = xelatex
% pandoc --template my_essay.tex --pdf-engine=xelatex -o output.pdf input.md
\documentclass[11pt]{article}
\usepackage[english]{babel}
\usepackage[a4paper,margin=2cm,left=4cm,top=1.5cm,includehead,includefoot]{geometry}
\usepackage{fontspec}
\setmainfont{Times New Roman}
\usepackage{hyperref}
@nicholastay
nicholastay / chrome_extensions.txt
Last active July 17, 2018 03:54
My list of chrome extensions
chlffgpmiacpedhhbkiomidkjlcfhogd : Pushbullet : version 341
cjpalhdlnbpafiamejdnhcphjbkeiagm : uBlock Origin : version 1_16_12
clngdbkpkpeebahjckkjfobafhncgmne : Stylus : version 1_4_13
gcbommkclmclpchllfjekcdonpmejbdp : HTTPS Everywhere : version 2018_6_21
jchobbjgibcahbheicfocecmhocglkco : Neat URL : version 4_1_5
jinjaccalgkegednnccohejagnlnfdag : Violentmonkey : version 2_9_5
jjjpbgllolhkbnpbkpcllncfmbiggljo : Chrome Font Rendering Enhancer : version 0_0_5
jnhhggibfcaninachhodcaghhdmgecjn : Pastel Space : version 1 (theme: https://www.themebeta.com/index.php/chrome/theme/593276)
ldpochfccmkkmhdbclfhpagapcfdljkj : Decentraleyes : version 2_0_6
oboonakemofpalcgghocfoadofidjkkk : KeePassXC-Browser : version 1_1_7
@nicholastay
nicholastay / twitch-stuff.css
Last active September 6, 2020 11:48
Just some random twitch css stuff (fade topbar + hide following button)
@-moz-document domain("twitch.tv") {
.top-nav__menu {
background: -webkit-gradient(linear, left bottom, right top, color-stop(0%, #4E367B), color-stop(50%, #A61EB0), color-stop(100%, #AB781A));
background: -webkit-linear-gradient(45deg, #4E367B 0%, #A61EB0 50%, #AB781A 100%);
background: linear-gradient(45deg, #4E367B 0%, #A61EB0 50%, #AB781A 100%);
}
.tw-interactive[data-a-target=user-menu-toggle]:hover {
background: hsla(0,0%,100%,.05) !important;
}
@nicholastay
nicholastay / app.yaml
Last active October 2, 2018 06:31
Firebase short URL GAE proxy prototype
runtime: python27
api_version: 1
threadsafe: true
handlers:
- url: /.*
script: main.app
libraries:
- name: flask
@nicholastay
nicholastay / alsong.py
Created January 10, 2019 13:00
ALSong lyrics plugin for MusicBrainz Picard (warn: getting lyrics is synchronous, so UI will be locked)
PLUGIN_NAME = 'ALSong Lyrics'
PLUGIN_AUTHOR = 'Nicholas Tay (nexerq)'
PLUGIN_DESCRIPTION = 'Gets lyric data from ALSong API.'
PLUGIN_VERSION = '0.1.0'
PLUGIN_API_VERSIONS = ['2.0']
PLUGIN_LICENSE = 'Zlib'
# Based on musixmatch plugin as a starting point
from picard.metadata import register_track_metadata_processor
from picard.file import File
@nicholastay
nicholastay / mb2019.layout
Created January 11, 2019 11:21
My MusicBee panel layout
<?xml version="1.0" encoding="utf-8"?>
<ApplicationSettings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<GUI_Skin>Dark\MidnightMETRO.xmlc</GUI_Skin>
<GUI_Borders>false</GUI_Borders>
<LC_HeaderBar>1,0,0|2,0,0|3,0,0</LC_HeaderBar>
<LC_TopPanel />
<LC_BottomPanel>20,0,0</LC_BottomPanel>
<LC_Floating />
<LC_Compact>16,0,0|17,0,0|10,1,0|18,0,0|20,0,0</LC_Compact>
<LC_NPMainPanel>13,0,0</LC_NPMainPanel>