Skip to content

Instantly share code, notes, and snippets.

View sagiavinash's full-sized avatar

Sagi Avinash Varma sagiavinash

View GitHub Profile
// rootReducer.js
export default combineReducers({
a: reducerA,
b: reducerB
});
// store.js
import rootReducer from './rootReducer';
export default createStore(rootReducer);
@sagiavinash
sagiavinash / ReactReduxDependencyTargetTree.js
Last active July 29, 2018 12:53
React Redux Dependency Target Tree
RootComponent.js
|_AppContainer.js
|_App.js
|_loginReducer.js
|_PageContainer.js
|_Page.js
|_pageReducer.js
@sagiavinash
sagiavinash / ReactReduxdependencyLegacyTree.js
Last active July 29, 2018 10:53
Sample React Redux Dependency Tree
RootComponent.js
|_store.js
| |_rootReducer.js
| |_loginReducer.js
| |_pageReducer.js
|_AppContainer.js
|_App.js
|_PageContainer.js
|_Page.js
// rootReducer.js
export default combineReducers({
home: homeReducer,
productList: productListReducer
});
// store.js
export default createStore(rootReducer/* , initialState, enhancer */);
// Root.js
@sagiavinash
sagiavinash / NumberLinkedListAdder.java
Last active June 6, 2018 15:51
NumberLinkedListAdder.java
package com.sagiavinash.test;
import java.util.Scanner;
/*
Sample Standard Input:
1 1 1
1 1
Sample Standard Output: (addition)
1 2 2
@sagiavinash
sagiavinash / bash_aliases.sh
Last active May 30, 2018 09:35
my generic bash aliases
function search() {
grep -inr --exclude={vendor\.min\.js,build\.min\.js,build\.js} --exclude-dir={node_modules,dist-test,dist-server,dist-client,coverage} $1 *
}
function replace() {
grep -ilr --exclude-dir={node_modules,dist-test,dist-server,dist-client} "$1" * | xargs -I@ sed -i '' "s/$1/$2/g" @
}
function searchf() {
find . -name "*$1*"
}
function searchd() {
@sagiavinash
sagiavinash / index.js
Created January 1, 2018 10:12
requirebin sketch
var createAction = require('redux-actions').createAction;
function createAsyncTaskActions(asynTaskId) {
return {
start: createAction(
`${asynTaskId}/START`,
() => null,
(query) => query
),
end: createAction(
@sagiavinash
sagiavinash / gist:cf2fe3e53ca7f9350781d90cb56a849a
Created December 16, 2017 17:38
payment-request-api-resources.md
#Web Payments (Chrome Dev Summit 2016)
https://www.youtube.com/watch?v=U0LkQijSeko&t=2s
Integration Guide: https://goo.gl/5LCXH2
Android Pay on the Web Integration Guide: https://goo.gl/4hDSIS
PaymentRequest Sample Code: https://goo.gl/frPqKP
# Unified checkout experience using Web Payment API: Gandhi Kishor Addanki, Samsung (hasgeek talk)
https://www.youtube.com/watch?v=Fsfi9BiVFyc&feature=share
https://medium.com/samsung-internet-dev/how-to-take-payments-on-the-web-with-the-payment-request-api-a523f6fc7c1f
@sagiavinash
sagiavinash / BinaryTreeTraversal.js
Created October 31, 2017 18:02
Binary Tree Traversal - DFS(pre-order, in-order, post-order)
class Stack {
constructor() {
this.items = Array.prototype.slice.call(arguments, 0);
}
push(item) {
this.items.push(item);
}
pop() {
if (!this.items.length) throw Error('Stack is empty: no items to pop');
@sagiavinash
sagiavinash / multiple_classes_output.css
Last active September 22, 2017 08:33
Targeting multiple classes in sass
.a-b.a-c {
color: black;
}