Skip to content

Instantly share code, notes, and snippets.

View ldong's full-sized avatar
❤️
Love & Peace

Alan Dong ldong

❤️
Love & Peace
  • Sunnyvale, CA
View GitHub Profile
<template name="Profile">
{{> DashboardHeaderTop}}

<div class="profile">
    <div class="row">
        <div class="col-xs-10 col-xs-offset-1 col-sm-6 col-sm-offset-3 col-md-6 col-md-offset-3">
            <h2>Profile</h2>
@ldong
ldong / components.my-input.js
Created October 12, 2016 00:41
New Twiddle
import Ember from 'ember';
export default Ember.Component.extend({
isMatched: null,
didUpdateAttrs() {
this._super(...arguments);
},
actions: {
@ldong
ldong / Ember_React_LifeCycle.md
Last active October 15, 2020 14:05
Ember vs React LifeCycle

Life Cycle Comparsion of Ember and React

React Hook Ember Hook Server? Initial Render? Rerender? Purpose
componentWillMount init Yes Yes No Set initial component state without triggering re-render
componentDidMount didInsertElement No Yes No Provides opportunity for manual DOM manipulation
componentWillReceiveProps willReceiveAttrs No No Yes React to changes in component attributes, so that setState can be invoked before render
shouldComponentUpdate Maybe N/A No No Yes Gives a component an opportunity to reject downstream revalidation
componentWillUpdate willUpdate No No Yes Invoked before a template is re-rendered to give the component an opportunity to inspect the DOM before updates have been applied (example)
componentDidUpdate didUpdate No No Yes Invoked after a template is r
@ldong
ldong / ember.js
Created September 29, 2016 22:11 — forked from crofty/ember.js
// Version: v1.0.0-pre.2-396-g99357c2
// Last commit: 99357c2 (2013-01-14 11:38:40 +0000)
(function() {
/*global __fail__*/
/**
Ember Debug
@ldong
ldong / TooltipArrowPointer.md
Created September 1, 2016 23:17
TooltipArrowPointer.md

Dynamic Change Arrow

//Logics
computeXYCord(mainElement, tooltipElement, borderWidth=10) {
  const position = this.get('pointerDirection').toLowerCase();
  const tooltipElementSelector = '.tutorial-component';

  console.log('====== setting position to be', position, '======');
@ldong
ldong / ChromeCodeSnippets.md
Created August 30, 2016 19:16
Chrome Code Snippets

Show Element Position

var element = $('#chart-map');
var e = element[0];

// console.log(
// 'page: ( ' + e.pageX + ',' + e.pageY,  ')',
// 'client: ( ' + e.clientX + ',' + e.clientY,  ')',
// 'screen: ( ' + e.screenX + ',' + e.screenY, ')');
g=git
ga='git add'
gaa='git add --all'
galias='alias | grep git'
gapa='git add --patch'
gb='git branch'
gba='git branch -a'
gbda='git branch --merged | command grep -vE "^(\*|\s*master\s*$)" | command xargs -n 1 git branch -d'
gbl='git blame -b -w'
gbnm='git branch --no-merged'
@ldong
ldong / brew_for_new_mac.md
Last active April 10, 2018 20:07
Brew formulas that definitely **NEED** to be installed https://tinyurl.com/brew-for-new-mac
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

brew install tree rmtrash ag sift python python3 gawk tmux cscope ctags fasd git git-flow aria2 wget mmv rename

brew install tig jq fpp cloc htop ctop shellcheck mycli

brew tap homebrew/command-not-found
@ldong
ldong / learning_bootstrap3.md
Created August 2, 2016 04:43
learning boostrap

Learning Bootstrap

@media (min-width: 768px) and (max-width: 991px) { }
@media (min-width: 992px) and (max-width: 1199px) { }
@media (min-width: 1200px) { }
@ldong
ldong / zsh_keybindings.zsh.md
Created July 30, 2016 03:10
Zsh keybindings

Zsh keybindings

# Keybindings #
###############

# Keybindings to make special keys work - https://wiki.archlinux.org/index.php/Zsh#Key_Bindings
bindkey -v # vi mode
bindkey "\e[1~" beginning-of-line # Home