Skip to content

Instantly share code, notes, and snippets.

Sitian Liu goldensunliu

Block or report user

Report or block goldensunliu

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
goldensunliu / gist:865469b6f5a43779eb2e
Created Mar 18, 2015
Game of life in Processing.js
View gist:865469b6f5a43779eb2e
// Game of Life
int sx, sy;
float density = 0.2;
int lifeSqureWidth = 3;
int[][][] world;
void populate() {
for (int i = 0; i < sx * sy * density; i++) {
View MyProductFeature.styl
@require 'label'
@require 'OrgWideTypography'
@extend .label
@extend $OrgMarketingLayout
View label.styl
display inline
padding .2em .6em .3em
font-size 75%
font-weight bold
line-height 1
color label-color
text-align center
white-space nowrap
vertical-align baseline
View SSR.js
const StyleSheetServer = {
async renderStatic(appRenderFunc) {
const result = await appRenderFunc();
const cssContent = flushToString();
return {
css: {
goldensunliu / font-sizes.styl
Last active May 12, 2016
a font size source with some global selectors
View font-sizes.styl
// Font size definitions
$font-size-smaller = 1rem
$font-size-small = 2rem
$font-size-base = 3rem
// Global font styles
View page.styl
@require 'font-size'
font-size $font-size-base
font-size $font-size-small
goldensunliu / UspsCode.js
Created Jun 13, 2016
USPS state code to state name conversion with a simple Javascript implementation, an array and a function.
View UspsCode.js
const UspsCodesToStateName = {
'AL' : 'Alabama',
'AK' : 'Alaska',
'AZ' : 'Arizona',
'AR' : 'Arkansas',
'CA' : 'California',
'CO' : 'Colorado',
'CT' : 'Connecticut',
'DE' : 'Delaware',
'DC' : 'District of Columbia',
View font-sizes.less
@h1-size: 36px;
@h2-size: 24px;
@h3-size: 18px;
@grey: #212121;
@lightgrey: #616161;
.h1 {
color: @grey;
font-size: @h1-size;
View page.less
@import "./font-sizes";
.page_title {
.page_cta {
View output.css
.page_title {
color: #212121;
font-size: 36px;
.h2 {
color: #212121;
font-size: 24px;
You can’t perform that action at this time.