Skip to content

Instantly share code, notes, and snippets.


Mohan Dere mohandere

View GitHub Profile
eethann / _.objMapFunctions.js
Created Aug 23, 2012
Underscore mixin with common iterator functions adapted to work with objects and maintain key/val pairs.
View _.objMapFunctions.js
// ### _.objMap
// for objects, keeps key/value associations
objMap: function (input, mapper, context) {
return _.reduce(input, function (obj, v, k) {
obj[k] =, v, k, input);
return obj;
}, {}, context);
// ### _.objFilter
der-On / rivets_formatters.js
Created Dec 19, 2014
Rivets.js general purpose formatters
View rivets_formatters.js
rivets.formatters['!'] = function(value)
return !value;
rivets.formatters.eq = function(value, args)
return value === args;
rivets.formatters.neq = function(value, args)
getify / gist:7ae82fdc2e86bf66bcba
Last active Sep 4, 2020
List of ES6 books either out or in progress...
View gist:7ae82fdc2e86bf66bcba
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
function get_isotope_item( $query_args = array() ){
$defaults = array(
'post_type' => 'post',
'posts_per_page' => -1,
'post_status' => 'publish',
craigtaub / React-Hooks.js
Last active Feb 12, 2021
Nested React Hooks
View React-Hooks.js
// Engine
const React = {
index: 0,
state: [],
useEffect: (callback, dependencies) => {
const cachedIndex = React.index;
const hasChanged = dependencies !== React.state[cachedIndex];
if (dependencies === undefined || hasChanged) {
View little-vdom.js
export const h=(t,p,...c)=>({t,p,c,k:p&&p.key})
export const render=(e,d,t=d.t||(d.t={}),p,r,c,m,y)=>
// arrays,p)=>render(e,d,t.o&&t.o[p])):
// components{children:e.c},e.p),e.s=t.s||{},t=>
// create notes
m=t.d||(e.t?document.createElement(e.t):new Text(e.p)),
// diff props
charleslouis / custom-search-acf-wordpress.php
Last active Feb 24, 2021
PHP - Wordpress - Search - wordpress custom search function that encompasses ACF/advanced custom fields and taxonomies and split expression before request
View custom-search-acf-wordpress.php
* [list_searcheable_acf list all the custom fields we want to include in our search query]
* @return [array] [list of custom fields]
function list_searcheable_acf(){
$list_searcheable_acf = array("title", "sub_title", "excerpt_short", "excerpt_long", "xyz", "myACF");
return $list_searcheable_acf;
wojteklu /
Last active Mar 5, 2021
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.

General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

PurpleBooth /
Last active Mar 5, 2021
A template to make good

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.


staltz /
Last active Mar 5, 2021
The introduction to Reactive Programming you've been missing