Skip to content

Instantly share code, notes, and snippets.

View trantorLiu's full-sized avatar

Chun-Yi Liu trantorLiu

View GitHub Profile
View Ruby on Rails Table of
trantorLiu /
Last active June 6, 2018 05:08
Codementor React Tutorial Series

Codementor React Tutorial Series -- From Dummy to Ninja

The React Quick Start Guide

In this sesction, you'll learn JSX, the concept of React components, and play around with React.

React Beginner Tutorial: Building a Board Game from Scratch

Practice what you learnt by building a board game. You will learn the conecpt of states, and how to compose components.

The Flux Quickstart Guide

Now you are familiar with React, you are ready to get started with Flux -- the client-side application architecture from Facebook.

trantorLiu / handlebars-pagination-helper.js
Last active August 10, 2023 14:01
Handlebars pagination helper.
View handlebars-pagination-helper.js
Handlebars.registerHelper('pagination', function(currentPage, totalPage, size, options) {
var startPage, endPage, context;
if (arguments.length === 3) {
options = size;
size = 5;
startPage = currentPage - Math.floor(size / 2);
endPage = currentPage + Math.floor(size / 2);