This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* a small mixin for easy use of rem with px as fallback | |
* usage: @include x-rem(font-size, 14px) | |
* usage: @include x-rem(marign, 0 12px 2 1.2) | |
* usage: @include x-rem(padding, 1.5 24px) | |
* | |
*/ | |
@mixin x-rem($property, $values) { | |
// Create a couple of empty lists as output buffers. | |
$base-font-size: 16px; // should be consistent with your html/body font-size |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* a small mixin for easy use of rem. Only for modern browsers. (No px as fallback) | |
* for px fallback refer: https://gist.github.com/gbhasha/938a17d5f83a78f56da7 | |
* usage: @include to-rem(font-size, 14px) | |
* usage: @include to-rem(marign, 0 12px 2 1.2) | |
* usage: @include to-rem(padding, 1.5 24px) | |
* | |
*/ | |
@mixin to-rem($property, $values) { | |
// Create a list as output buffer. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function color_meter(cwith, ccolor) { | |
if (!cwith && !ccolor) return; | |
var _cwith = (cwith.charAt(0)=="#") ? cwith.substring(1,7) : cwith; | |
var _ccolor = (ccolor.charAt(0)=="#") ? ccolor.substring(1,7) : ccolor; | |
var _r = parseInt(_cwith.substring(0,2), 16); | |
var _g = parseInt(_cwith.substring(2,4), 16); | |
var _b = parseInt(_cwith.substring(4,6), 16); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="description" content="ReactJS Template / Sandbox"> | |
<script src="https://fb.me/react-15.1.0.js"></script> | |
<script src="https://fb.me/react-dom-15.1.0.js"></script> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
<style id="jsbin-css"> | |
li {list-style:none} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="description" content="ReactJS Template / Sandbox"> | |
<script src="https://fb.me/react-15.1.0.js"></script> | |
<script src="https://fb.me/react-dom-15.1.0.js"></script> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
<style id="jsbin-css"> | |
li {list-style:none} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function es6BindAll(context, methodNames) { | |
methodNames.map(function(methodName) { | |
context[methodName] = context[methodName].bind(context); | |
}); | |
}; | |
// Usage: | |
// es6BindAll(this, ["method1", "method2", "methodX"]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var object1 = {color: "blue", size: 12}; | |
var object2 = object1 | |
object2.color = "red" | |
object1 === object2 //true | |
object3 = Object.assign({}, object1) | |
object3.color = "red" | |
object1 === object3 //false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const isObjectEqual = (obj1, obj2) => { | |
if(!isObject(obj1) || !isObject(obj2)) { | |
return false; | |
} | |
if (obj1 === obj2) { | |
return true; | |
} | |
const item1Keys = Object.keys(obj1).sort(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Put below code in ~/.ssh/config | |
# Default GitHub | |
Host github.com | |
ForwardAgent yes | |
HostName github.com | |
User git | |
IdentityFile ~/.ssh/id_rsa | |
# private GitHub | |
Host github.orgname.com | |
HostName github.orgname.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# put below code in ~/.gitconfig | |
[includeIf "gitdir:~/Projects/personal/"] | |
path = ~/.gitconfig-personal | |
[includeIf "gitdir:~/Projects/project1/"] | |
path = ~/.gitconfig-project1 | |
[includeIf "gitdir:~/Projects/project2/"] | |
path = ~/.gitconfig-project1 | |
# put below code in ~/.gitconfig-project1 | |
[user] |