Skip to content

Instantly share code, notes, and snippets.

View nicholastay's full-sized avatar

Nicholas Tay nicholastay

View GitHub Profile
@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 / 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 / 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 / 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 / schoology-quickdl.user.js
Last active April 20, 2025 15:32
Schoology userscript - Quickly download files off folder browsers (press raw to install) - Be sure to allow popups!
// ==UserScript==
// @name Schoology quick-download files helper
// @namespace http://nicholastay.github.io/
// @version 0.3.0
// @author Nicholas Tay <[email protected]>
// @license MIT
// @icon https://i.imgur.com/QmmYqzZ.png
// @match *://app.schoology.com/*
// @match *://schoology.cgs.vic.edu.au/*
// @grant none
@nicholastay
nicholastay / .babelrc
Created October 6, 2017 02:18
get-osu-requester: request osu with customapi links like nightbot (poc)
{
"presets": [
"es2015"
]
}
@nicholastay
nicholastay / poc_reactions_discord_question.js
Created October 6, 2017 02:11
Old POC for when reactions first came out on discord to use them as a question sort of thing
'use strict';
const Eris = require('eris')
, fs = require('fs')
, repl = require('repl');
let client = new Eris(fs.readFileSync('./key.txt', 'utf8'));
client.on('ready', () => console.log('connected'));
@nicholastay
nicholastay / bttv_lul.css
Created September 30, 2017 13:39
Twitch replace LUL with BTTV LUL
.emoticon[alt="LUL"] {
background: url(//cdn.betterttv.net/emote/567b00c61ddbe1786688a633/1x) left top no-repeat;
box-sizing: border-box;
width: 28px;
height: 28px;
padding-left: 28px;
}
@nicholastay
nicholastay / schoology-infiniscroll.user.js
Last active March 21, 2018 06:47
Schoology userscript - infinitely scroll news feeds (press raw to install)
// ==UserScript==
// @name Schoology infiniscroll feed
// @namespace http://nicholastay.github.io/
// @version 0.1.0
// @homepage https://gist.github.com/nicholastay/665822c67bd3e098d5c43ec31eb4d830
// @author Nicholas Tay <[email protected]>
// @icon https://i.imgur.com/meGrY1N.png
// @include *://app.schoology.com/*
// @include *://schoology.cgs.vic.edu.au/*
// @grant none
@nicholastay
nicholastay / zeroth.user.js
Last active March 21, 2018 06:46
Schoology "Zero Course" userscript - intended for Camberwell Grammar School students (press raw to install)
// ==UserScript==
// @name CGS Schoology ZeroCourse tweak
// @namespace http://nicholastay.github.io/
// @homepage https://gist.github.com/nicholastay/254f63b90e5a82305701836020af7d25
// @version 0.1.6
// @description Reduces Courses tab clutter for CGS students with common YYXXX0 courses on Schoology.
// @author Nicholas Tay <[email protected]>
// @license Zlib
// @icon https://i.imgur.com/PkIuFKy.png
// @match *://app.schoology.com/*