Skip to content

Instantly share code, notes, and snippets.

😑
Raising Dinos 🦖

Yangshun Tay yangshun

😑
Raising Dinos 🦖
Block or report user

Report or block yangshun

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View what-i-wish-id-known-about-equity-before-joining-a-unicorn.md

What I Wish I'd Known About Equity Before Joining A Unicorn

Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.

This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would

@yangshun
yangshun / emoticon-emoji.json
Created Jan 17, 2017
Mapping of common emoticons to their respective emojis
View emoticon-emoji.json
{
":)": "🙂",
":-)": "🙂",
"(:": "🙂",
":D": "😄",
":-D": "😄",
"=D": "😃",
"=-D": "😃",
":')": "😂",
":'-)": "😂",
@yangshun
yangshun / media-rename.sh
Created Oct 2, 2016
Rename .webm files to .mp4
View media-rename.sh
#/usr/bin/sh
for f in *.webm; do
mv -- "$f" "${f%.webm}.mp4"
done
@yangshun
yangshun / deep-dive-into-nusmods.md
Last active Nov 20, 2018
An explanation of how the timetabling algorithm of NUSMods works
View deep-dive-into-nusmods.md

Deep Dive into NUSMods

Ever wondered how the timetabling algorithm of NUSMods works? Read on to find out.

Firstly start let's define the data representation of a Lesson:

Lesson = {
  ClassNo: string,
  DayText: string,
@yangshun
yangshun / Gulpfile.js
Created Aug 11, 2016
Static web server with styles watching
View Gulpfile.js
'use strict';
var gulp = require('gulp');
var sass = require('gulp-sass');
var webserver = require('gulp-webserver');
gulp.task('sass', function () {
return gulp.src('./sass/**/*.scss')
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest('./css'));
View jquery-injector.js
var script = document.createElement('script');
script.src = '//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js';
script.onload = function () {
// Do something
}
document.getElementsByTagName('head')[0].appendChild(script);
View gen_runes.py
## Directory structure:
## dir
## |-- gen_runes.py
## |-- graphics.py
## |-- PyGif.py
## +-- runes.py
## Put submissions in the same directory as this file.
## Make sure there are no other .py files besides
## the submissions and the whitelisted files
View fix-wordpress-permissions.sh
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org>
#
WP_OWNER=www-data # <-- wordpress owner
WP_GROUP=www-data # <-- wordpress group
WP_ROOT=$1 # <-- wordpress root directory
@yangshun
yangshun / country-code.js
Created Dec 29, 2015
Country Code Scraper
View country-code.js
// From http://www.science.co.il/International/Country-codes.asp
var data = {};
var trs = document.querySelectorAll('table.sortable tbody tr');
for (var i = 0; i < trs.length; i++) {
var item = trs[i];
var tds = item.querySelectorAll('td');
data[tds[2].textContent] = {
name: tds[0].textContent,
View proxy-image.js
// "body-parser": "^1.4.3",
// "express": "^4.4.5",
// "request": "^2.67.0"
var fs = require('fs');
var path = require('path');
var express = require('express');
var bodyParser = require('body-parser');
var app = express();
var http = require('http');
You can’t perform that action at this time.