Skip to content

Instantly share code, notes, and snippets.

@mandava
mandava / get_forms_list.php
Last active January 4, 2017 16:19
Get Forms List for Ninja Forms, Gravity Forms and Contact Form 7 WordPress Plugins
<?php
/** Ninja Forms */
function delight_ninja_forms() {
if ( function_exists('ninja_forms_get_all_forms') ) {
$nfs = ninja_forms_get_all_forms();
}
$nforms = array( '' => __('Select a Form', 'TEXT-DOMAIN') );
if( !empty( $nfs ) ) {
foreach($nfs as $form){
@mandava
mandava / social_share_count.php
Created August 27, 2015 01:57
Social Share Buttons with Count for WordPress
<?php
/**
* Social Share Buttons with Count for WordPress
*/
/**
* Performs HTTP request and returns response body with conditionally decoding json.
*
@mandava
mandava / 0_reuse_code.js
Created July 2, 2016 21:56
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@mandava
mandava / grid.js
Last active February 21, 2021 18:53
Thumbnail Grid Expanding Preview WordPress jQuery Fix
/*
* debouncedresize: special jQuery event that happens once after a window resize
*
* latest version and complete README available on Github:
* https://github.com/louisremi/jquery-smartresize/blob/master/jquery.debouncedresize.js
*
* Copyright 2011 @louis_remi
* Licensed under the MIT license.
*/
var $ = jQuery;
@mandava
mandava / customizer-links.php
Created June 23, 2017 03:01 — forked from slushman/customizer-links.php
How to link into the WordPress Customizer
@mandava
mandava / resize_local_machine.sh
Created November 27, 2017 03:05 — forked from claygriffiths/resize_local_machine.sh
Resize Local by Flywheel VirtualBox image
# Steps we will take:
# 1. Change Local (Docker Machine) image type (this will take a bit)
# 2. Resize image
# 3. Resize partion
#
# Also see: https://docs.docker.com/articles/b2d_volume_resize/
# IMPORTANT: Make sure Local is not running!
VM_NAME="local-by-flywheel"
NEW_DISK_SIZE=50000

Effective Engineer - Notes

What's an Effective Engineer?

  • They are the people who get things done. Effective Engineers produce results.

Adopt the Right Mindsets

@mandava
mandava / nvm.sh
Created June 4, 2018 14:49
Manage Node.js versions using NVM
# List all installed versions.
nmv ls
# Install a specific version.
nvm install 9.6.0
# Use a specific version.
nvm use 9.6.0
# Set the Default Version.
@mandava
mandava / git_submodules.md
Created June 18, 2018 20:12 — forked from gitaarik/git_submodules.md
Git Submodules basic explanation

Git Submodules basic explanation

Why submodules?

In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of advantages of using submodules:

  • You can separate the code into different repositories.
@mandava
mandava / idea.vmoptions
Created July 26, 2018 14:48
IntelliJ Idea Custom VM Options
-Xmx2048m
-Xms1024m
-XX:NewRatio=1
-XX:ReservedCodeCacheSize=240m
-XX:+UseCompressedOops
-Dfile.encoding=UTF-8
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=50
-ea
-Dsun.io.useCanonCaches=false