This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
# keep track of the last executed command | |
trap 'last_command=$current_command; current_command=$BASH_COMMAND' DEBUG | |
# echo an error message before exiting | |
trap 'echo "\"${last_command}\" command filed with exit code $?."' EXIT | |
find . -name '*.cue' -print0 | | |
while IFS= read -r -d '' line; do | |
type=$(file "$line") | |
if ! echo $type | grep "with BOM" > /dev/null; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:18.04 | |
RUN apt-get update -y && apt-get upgrade -y | |
RUN apt-get install -y wget locales fontconfig apt-transport-https software-properties-common \ | |
language-pack-zh-hans language-pack-zh-hant language-pack-ja language-pack-en language-pack-ko \ | |
ttf-wqy-microhei fonts-arphic-ukai fonts-arphic-uming fonts-ipafont-mincho fonts-ipafont-gothic fonts-unfonts-core \ | |
xvfb python-numpy \ | |
x264 libx264-dev libvpx5 \ | |
libgtk-3-0 libnotify4 libnss3 libxss1 libxtst6 xdg-utils libatspi2.0-0 \ | |
libappindicator3-1 libsecret-1-0 libasound2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# assume yank.sh is located at ~/yank.sh | |
map <leader>yy :<C-U>silent '<,'>:w !~/yank.sh<CR>:redraw<CR> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#version 120 | |
in float flifespan; | |
void main() { | |
gl_FragColor = vec4(1.0f / lifespan, 0, 0, 0); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name MSSSUG better comments | |
// @namespace http://youmu.moe/ | |
// @version 0.7 | |
// @description Add floor and quote to MSSSUG comment system | |
// @author John Tan (johnmave126@gmail.com) | |
// @match *://ihome.ust.hk/~msssug/* | |
// @updateURL https://gist.github.com/raw/3287b8d85a071b672344614432f97464/better_msssug.meta.js | |
// @downloadURL https://gist.github.com/raw/3287b8d85a071b672344614432f97464/better_msssug.user.js | |
// @grant none |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Display Floor Number | |
// @namespace http://youmu.moe/ | |
// @version 0.1 | |
// @description Display Floor Number in MSSSUG election page | |
// @author John Tan | |
// @match http://ihome.ust.hk/~msssug/election_single/* | |
// @grant none | |
// ==/UserScript== | |
/* jshint -W097 */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var restify = require('restify'); | |
// Authentication | |
var passport = require('passport'); | |
var LocalStrategy = require('passport-local').Strategy; | |
var sessions = require("client-sessions"); | |
var server = restify.createServer(); | |
server.use(restify.queryParser()); | |
server.use(restify.bodyParser({mapParams: false})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
application/vnd.lotus-1-2-3 .123 | |
text/vnd.in3d.3dml .3dml | |
video/3gpp2 .3g2 | |
video/3gpp .3gp | |
application/octet-stream .a | |
application/x-authorware-bin .aab | |
audio/x-aac .aac | |
application/x-authorware-map .aam | |
application/x-authorware-seg .aas | |
application/x-abiword .abw |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <windows.h> | |
#include <stdio.h> | |
#include <string.h> | |
int main(void) { | |
FILE *fp; | |
char name[1024]; | |
SYSTEMTIME base_time; | |
FILETIME base_time_f; | |
HANDLE fd; |