Skip to content

Instantly share code, notes, and snippets.

View chhuang's full-sized avatar

Chang chhuang

  • Sydney
  • 14:22 (UTC +10:00)
View GitHub Profile
@chhuang
chhuang / react-es5-v-es6.js
Last active July 17, 2016 13:13
React ES5 v/s ES6
// 1. require/import
// ES5: require
var React = require('react');
var { Component, PropTypes } = React;
// ES6: import
import React, { Component, PropTypes } from 'react';
// 2. Module import/export
@chhuang
chhuang / README.md
Created July 30, 2016 15:04
iTerm2 + Zsh + Antigen

1. Homebrew

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

2. Zsh

brew install zsh
echo "/usr/local/bin/zsh" | sudo tee -a /etc/shells
chsh -s /usr/local/bin/zsh $USER
@chhuang
chhuang / css.md
Last active September 16, 2016 03:54
CSS fundamentals

CSS Formatting

  • Use soft tabs (2 spaces) for indentation
  • Do not use ID selectors
  • Use a mix of Single-Line and Multi-Line for CSS properties
  /* If there is only 1 property, use one-liner */
  .footer { background: #fff; }
 
@chhuang
chhuang / front-end-testing.md
Last active November 23, 2016 23:12
Front end testing ecosystem.
@chhuang
chhuang / awesome-links.md
Last active February 7, 2017 13:10
Awesome links
@chhuang
chhuang / README.md
Created July 27, 2016 06:43
Show Git history for a specific line in Sublime

Don't use blame because git blame only shows the LAST commit of that particular line.

  1. Install sublime-text-git
  2. shift + command + p in Sublime
  3. Type in Custom command
  4. Select Git: Custom Command. It'll open a panel at the bottom of Sublime.
  5. Type in log -L START_LINE_NUMBER,END_LINE_NUMBER:CURRENT_FILE_NAME.EXT

For example: log -L 1,1:index.js will show the git history for line #1 of index.js.