Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Mohan Dere mohandere

🎯
Focusing
View GitHub Profile
@mohandere
mohandere / wp-auto-installer.js
Last active Nov 3, 2020
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 Oct 20, 2020
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 / yoast-seo-sitemap.php
Last active Aug 20, 2020
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 / 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 / config-overrides.js
Created May 30, 2018
config-overrides.js - Obfuscate CSS class names in Create React App without eject
View config-overrides.js
// File - src/config-overrides.js
// react-app-rewired: Override create-react-app webpack configs without ejecting
const path = require("path");
const { compose, getLoader, injectBabelPlugin } = require("react-app-rewired");
function rewire(config, env) {
const cssRules = getLoader(
@mohandere
mohandere / child.js
Last active Jun 9, 2020
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 / 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 / settings.json
Created Aug 20, 2019
Sublime 3 user settings
View settings.json
{
"always_show_minimap_viewport": true,
"bold_folder_labels": true,
"caret_extra_bottom": 1,
"caret_extra_top": 1,
"caret_extra_width": 1,
"caret_style": "blink",
"color_scheme": "Packages/Colorsublime - Themes/LAZY.tmTheme",
"create_window_at_startup": false,
"fade_fold_buttons": false,
@mohandere
mohandere / settings.json
Created Aug 20, 2019
VS code editor 2019 settings mac os
View settings.json
// Place your settings in this file to overwrite the default settings
{
"editor.wordWrap": "on",
"editor.tabSize": 2,
"editor.mouseWheelZoom": false,
"guides.enabled": false,
"terminal.integrated.fontSize": 17,
"editor.fontSize": 20,
"window.zoomLevel": 0,
"sublimeTextKeymap.promptV3Features": true,
View hoc-caveat-02-fix.js
import hoistNonReactStatic from 'hoist-non-react-statics';
const withSearch = (WrappedComponent) => {
class WithSearch extends React.Component {/*...*/}
hoistNonReactStatic(EithSearch, WrappedComponent);
return WithSearch;
}
// Define a static method
ProductsList.staticMethod = function() {/*...*/}
You can’t perform that action at this time.