Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Mohan Dere mohandere

🎯
Focusing
View GitHub Profile
@mohandere
mohandere / 0_reuse_code.js
Created Jun 21, 2017
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@mohandere
mohandere / epic.js
Last active Aug 31, 2017
Writing epics with redux-observable
View epic.js
import * as ajax from '../../utils/ajax';
import 'rxjs/add/operator/catch'
import {
Observable
} from 'rxjs/Observable';
import queryString from 'query-string'
import _ from 'lodash'
import {
PRODUCTS_REQUEST_START,
@mohandere
mohandere / MyModal.js
Last active Oct 12, 2017
Higher Order Component for react-modal to handle modal bottom issue
View MyModal.js
import React from 'react';
import ReactModal from 'react-modal';
import withModal from './withModal';
class MyModal extends React.Component {
constructor(props) {
super(props)
@mohandere
mohandere / accordion.js
Last active Nov 21, 2017
Jquery UI Sortable with Accordion: Save sort order
View accordion.js
scmAcco.accordion({
header: "> div > h3",
collapsible: true,
active: false,
heightStyle: "content",
}).sortable({
update: function(event, ui) {
//On update get new order of elements as an array
var serialized = $(this).sortable("toArray", {
@mohandere
mohandere / app.js
Created Nov 21, 2017
Jquery Panzoom with UI slider and Flexslider
View app.js
var App = {
initialize: function() {
// Initialize flexslider
$flexSlider = self.$('#product-slider'),
$flexSlider.flexslider({
animation: "slide",
slideshow: false,
animationLoop: false,
start: function(slider) {
console.log('in start == slider.currentSlide ==>', slider.currentSlide);
@mohandere
mohandere / vue-infinite-loader.vue
Created Dec 1, 2017
Infinite Loading with Vue.js
View vue-infinite-loader.vue
<template>
<main class="container">
<div>
<header>
<h3>Archives</h3>
</header>
<div v-if="posts && posts.length" class="postsList">
<ul class="row">
<li v-for="(post, index) in posts" class="postItem col-sm-4">
<div class="postContent">
@mohandere
mohandere / vue-infinite-loader.vue
Last active Dec 17, 2019
Infinite Loading with Vue.js
View vue-infinite-loader.vue
<template>
<main class="container">
<div>
<header>
<h3>Archives</h3>
</header>
<div v-if="posts && posts.length" class="postsList">
<ul class="row">
<li v-for="(post, index) in posts" class="postItem col-sm-4">
<div class="postContent">
@mohandere
mohandere / namespaced-bootstrap-v3.3.7.css
Last active Dec 27, 2017
Namespacing bootstrap 3.3.7
View namespaced-bootstrap-v3.3.7.css
/*! Namespaced Bootstrap 3.3.7
* Load Glyphicons Halflings extrnally
* Bootstrap v3.3.7 (http://getbootstrap.com)
* Copyright 2011-2016 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */
/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */
html {
font-family: sans-serif;
@mohandere
mohandere / store.js
Last active Feb 15, 2018
Getting started with create-react-app, Redux, React Router, Redux observable &amp; React Bootstrap(reactstrap)
View store.js
import { createStore, applyMiddleware } from 'redux';
import { createEpicMiddleware } from 'redux-observable';
import createHistory from 'history/createHashHistory';
import { routerMiddleware } from 'react-router-redux';
// import root epic/reducer
import rootEpic from './rootEpic';
import rootReducer from './rootReducer';
import queryString from 'query-string';
View rootReducer.js
import { combineReducers } from 'redux';
import { routerReducer } from 'react-router-redux';
import {
reducer as toastrReducer
} from 'react-redux-toastr'
import common from './common/reducers';
import catalog from './catalog/reducers';
import home from './home/reducers';
import product from './product/reducers';
You can’t perform that action at this time.