Skip to content

Instantly share code, notes, and snippets.

View gbhasha's full-sized avatar

Galeel Bhasha Satthar gbhasha

View GitHub Profile
@gbhasha
gbhasha / gitconfig
Created September 12, 2017 06:17
Load user level git config based on the working folder
# 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]
@gbhasha
gbhasha / config
Created September 12, 2017 06:13
Load ssh keys based on the GitHub host
# 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
@gbhasha
gbhasha / objectComparison.js
Created November 26, 2016 03:24 — forked from nesbtesh/objectComparison.js
Object comparison JS
export const isObjectEqual = (obj1, obj2) => {
if(!isObject(obj1) || !isObject(obj2)) {
return false;
}
if (obj1 === obj2) {
return true;
}
const item1Keys = Object.keys(obj1).sort();
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
function es6BindAll(context, methodNames) {
methodNames.map(function(methodName) {
context[methodName] = context[methodName].bind(context);
});
};
// Usage:
// es6BindAll(this, ["method1", "method2", "methodX"]);
@gbhasha
gbhasha / index.html
Created September 5, 2016 22:37 — forked from anonymous/index.html
JS Bin ReactJS Template / Sandbox // source http://jsbin.com/fibofo
<!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}
@gbhasha
gbhasha / index.html
Created September 5, 2016 22:37 — forked from anonymous/index.html
JS Bin ReactJS Template / Sandbox // source http://jsbin.com/mutize
<!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}
@gbhasha
gbhasha / dabblet.css
Created December 13, 2012 08:58
Untitled
.block {float: left;width: 200px;height: 200px; }
.pink { background: #ee3e64; }
.blue { background: #44accf; }
.green { background: #b7d84b; }
@gbhasha
gbhasha / dabblet.css
Created December 13, 2012 08:57
Untitled
.box { position: absolute; width: 200px; height: 200px; }
#box_1 { background: #ee3e64; top: 0; left: 0; }
#box_2 { background: #44accf; top: 0; right: 0; }
#box_3 { background: #b7d84b; bottom: 0; left: 0; }
#box_4 { background: #ebde52; bottom: 0; right: 0; }
.orange { background: #f95b34; position: absolute; top: 39%; left: 41%; width: 40px; height: 40px; }
@gbhasha
gbhasha / dabblet.css
Created December 13, 2012 08:44
Untitled
.block {
float: left;
width: 200px;
height: 200px;
}
.pink { background: #ee3e64; }
.blue { background: #44accf; }
.green { background: #b7d84b; }