Skip to content

Instantly share code, notes, and snippets.

Avatar

Sam Samjin

  • United States
View GitHub Profile
View gist:55ca9dc4adcc9df708954a0c017c5f93

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@Samjin
Samjin / multiple_ssh_setting.md
Created Apr 6, 2017 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts
View multiple_ssh_setting.md

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
View mysql import data
mysql -u root -p epg < epg.sql
@Samjin
Samjin / bashrc custom command
Created Jan 25, 2017
bashrc bashrc custom commands
View bashrc custom command
subl ~/.bashrc
alias goto='cd ~/path/to/yourdir'
source ~/.bashrc //This is like 'save'. Without this step, it won't work.
View fontReplacement
@charset "UTF-8";
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document url-prefix(http://), url-prefix(https://) {
/* Latin */
@font-face { font-family: 'Arial'; unicode-range: U+4E00-9FFF; src: local('Sans') }
@font-face { font-family: 'Helvetica'; unicode-range: U+4E00-9FFF; src: local('Sans') }
@font-face { font-family: 'Verdana'; unicode-range: U+4E00-9FFF; src: local('Sans') }
@font-face { font-family: 'Tahoma'; unicode-range: U+4E00-9FFF; src: local('Sans') }
View SCSS features
$family: unquote("Droid+Sans");
@import url("http://fonts.googleapis.com/css?family=#{$family}");
View em convert, em calculator
// em-calc
@function em-calc($value) {
@if unit($value) == 'px' or unitless($value) {
$value: rem-calc($value, $base: 16px);
}
// Then the value is converted to ems
@return strip-unit($value) * 1em;
}
@Samjin
Samjin / promises.md
Created Aug 31, 2016 — forked from domenic/promises.md
You're Missing the Point of Promises
View promises.md

This article has been given a more permanent home on my blog. Also, since it was first written, the development of the Promises/A+ specification has made the original emphasis on Promises/A seem somewhat outdated.

You're Missing the Point of Promises

Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:

getTweetsFor("domenic", function (err, results) {
    // the rest of your code goes here.
View Rem vs Em
http://webdesign.tutsplus.com/tutorials/comprehensive-guide-when-to-use-em-vs-rem--cms-23984
rem and em units are computed into pixel values by the browser, based on font sizes in your design.
em units are based on the font size of the element they’re used on.
rem units are based on the font size of the html element.
em units can be influenced by font size inheritance from any parent element
rem units can be influenced by font size inheritance from browser font settings.
Use em units for sizing that should scale depending on the font size of an element other than the root.
Use rem units for sizing that doesn’t need em units, and that should scale depending on browser font size settings.
View LearnJS.js
// TWO foundation principles of being a good JS developer
/* 1. You should program to an interface and not to implementation
2. Favor composition over prototype.
*/
/* ==========================================================================
DATATYPEs
========================================================================== */
Object; // object has 5 object reference.
String, Number, Boolean, Null, Undefined;
You can’t perform that action at this time.