Skip to content

Instantly share code, notes, and snippets.

View yinghaochan's full-sized avatar

Ying Hao Chan yinghaochan

View GitHub Profile
@yinghaochan
yinghaochan / bootstrap_homeshick.sh
Created January 11, 2019 01:28 — forked from andsens/bootstrap_homeshick.sh
Script that can set up an entire user account with homeshick automatically
#!/bin/bash -ex
# Paste this into ssh
# curl -sL https://gist.github.com/andsens/2913223/raw/bootstrap_homeshick.sh | tar -xzO | /bin/bash -ex
# When forking, you can get the URL from the raw (<>) button.
### Set some command variables depending on whether we are root or not ###
# This assumes you use a debian derivate, replace with yum, pacman etc.
aptget='sudo apt-get'
chsh='sudo chsh'
@yinghaochan
yinghaochan / scribd_api.js
Created March 17, 2017 01:14
the untouched scribd api
(function(window) {
// Return if we have already run this.
if(window.scribd) { return; }
// Utility //
var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
@yinghaochan
yinghaochan / barChart.html
Last active February 29, 2016 21:10
Bar chart in react
<html>
<head>
<meta name="description" content="React Barchart animated">
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.5.1/lodash.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.6/d3.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.14.7/react-with-addons.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.14.7/react-dom.js"></script>
<meta charset="utf-8">
@yinghaochan
yinghaochan / final_readme.md
Created January 2, 2016 21:20
Readme for redux/meteor

 

Technical details

An implementation of redux with meteor for full stack reactivity and unidirectional data flow. Components are designed to work in isolation, taking state from the redux store or from the database directly, ensuring drop-in code resuability across different views.

Data flow

The redux store is a singleton and stores almost all relevant data.