Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Mohan Dere mohandere

🎯
Focusing
Block or report user

Report or block mohandere

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mohandere
mohandere / yoast-seo-sitemap.php
Last active Jun 25, 2019
Wordpress yoast seo plugin, generate custom sitemap for custom URLS
View yoast-seo-sitemap.php
<?php
/**
* Create a new custom yoast seo sitemap
*/
add_filter( 'wpseo_sitemap_index', 'ex_add_sitemap_custom_items' );
add_action( 'init', 'init_wpseo_do_sitemap_actions' );
// Add custom index
@mohandere
mohandere / blogFactory.js
Last active Aug 29, 2015
Angular Factory/Service for Interaction with Wordpress Blog
View blogFactory.js
function fzBlogFactory($http, $sce, config) {
function allPosts() {
return httpRequest('posts?filter[category_name]=post');
}
function postByID(id) {
return httpRequest('posts/' + id);
}
function featuredPosts() {
@mohandere
mohandere / wp-auto-installer.js
Last active Aug 14, 2018
Wordpress auto installer script PHP
View wp-auto-installer.js
;(function($){
/*
Script Name: WP Auto Installer
Author: Mohan Dere
Version: 1.0
Description : This script install new wordpress setup, create database with tables with content & run search replace database for new urls.
Last Update: 13 Mar 15
*/
@mohandere
mohandere / get-isotope-items.php
Last active Aug 6, 2019
jQuery isotope plugin for wordpress posts filtering by category with pagination.
View get-isotope-items.php
<?php
function get_isotope_item( $query_args = array() ){
$defaults = array(
'post_type' => 'post',
'posts_per_page' => -1,
'post_status' => 'publish',
);
@mohandere
mohandere / child.js
Last active May 16, 2019
Iframe height issue - make iframe height dynamic based on content inside
View child.js
(function(){
'use-strict';
/**
* Iframe to Parent window communication
* sample iframe- <iframe id="guestFrame" name="guestFrame" src="http://other-domain.com/">
* </iframe>
* Uses https://ternarylabs.github.io/porthole/
* Uses https://marcj.github.io/css-element-queries/
@mohandere
mohandere / app.js
Last active Aug 23, 2016
i18n with polyglot.js and rendr.js
View app.js
var patches = require('./lib/patches')
, BaseApp = require('rendr/shared/app')
, handlebarsHelpers = require('./lib/handlebarsHelpers')
, Polyglot = require('node-polyglot')
, _ = require('underscore');
/**
* setup constants/globals
*/
@mohandere
mohandere / templateManager.js
Created Oct 18, 2016
Template Manager plugin for Loading HBS template files:
View templateManager.js
/*
templateManager - Async Handlebars template loader/cacher.
@author Mohan Dere
@version 1.0
@requires jQuery || zepto, underscore, Handlebars.js
*/
(function() {
@mohandere
mohandere / app.js
Last active May 19, 2017
React-todo
View app.js
import React, { Component } from 'react';
import { BrowserRouter as Router, Route, Link } from 'react-router-dom';
import { Grid, Row, Col, PageHeader } from 'react-bootstrap';
import './App.css';
import Home from './components/Home';
import About from './components/About';
class App extends Component {
@mohandere
mohandere / FilesLoader-Usage.js
Created Jun 21, 2017
Asynchronous files loading with jquery deferred with callback
View FilesLoader-Usage.js
//Usage
var tplsToLoad = [
'tpl/menu-section',
'tpl/header',
'tpl/footer'
];
window.FilesLoader.load(tplsToLoad,
function () {
@mohandere
mohandere / App.js
Last active Nov 21, 2017
React js Responsive Gallery with Masonry Layout and Lightbox
View App.js
import React, {
Component
} from 'react';
//Import responsive gallery component
import ResponseiveGallery from './components/ResponsiveGallery';
// Define array of images with thumbnails
const DEFAULT_IMAGES = [{
src: '/images/gallery-1.jpg',
thumbnail: '/images/gallery-1.jpg',
You can’t perform that action at this time.