Skip to content

Instantly share code, notes, and snippets.

View mohandere's full-sized avatar
🎯
Focusing

Mohan Dere mohandere

🎯
Focusing
View GitHub Profile
@mohandere
mohandere / get-isotope-items.php
Last active March 6, 2024 14:20
jQuery isotope plugin for wordpress posts filtering by category with pagination.
<?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 February 4, 2024 04:58
Wordpress yoast seo plugin, generate custom sitemap for custom URLS
<?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 / wp-auto-installer.js
Last active November 5, 2023 19:10
Wordpress auto installer script PHP
;(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 / App.js
Last active January 28, 2021 09:24
React js Responsive Gallery with Masonry Layout and Lightbox
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',
@mohandere
mohandere / app.js
Created November 21, 2017 05:30
Jquery Panzoom with UI slider and Flexslider
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 10:51
config-overrides.js - Obfuscate CSS class names in Create React App without eject
// 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 June 9, 2020 03:39
Iframe height issue - make iframe height dynamic based on content inside
(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 December 17, 2019 13:22
Infinite Loading with Vue.js
<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 August 20, 2019 15:35
Sublime 3 user settings
{
"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 August 20, 2019 15:12
VS code editor 2019 settings mac os
// 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,