Skip to content

Instantly share code, notes, and snippets.

Mandi Wise mandiwise

Block or report user

Report or block mandiwise

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
mandiwise / Update remote repo
Last active Sep 21, 2019
Transfer repo from Bitbucket to Github
View Update remote repo
// Reference:
// See also:
$ cd $HOME/Code/repo-directory
$ git remote rename origin bitbucket
$ git remote add origin
$ git push origin master
$ git remote rm bitbucket
mandiwise / Count lines in Git repo
Last active Sep 20, 2019
A command to calculate lines of code in all tracked files in a Git repo
View Count lines in Git repo
// Reference:
$ git ls-files | xargs wc -l
mandiwise / Sync gh-pages + master branches
Last active Sep 13, 2019
Keep gh-pages up to date with a master branch
View Sync gh-pages + master branches
// Reference:
$ git add .
$ git status // to see what changes are going to be commited
$ git commit -m 'Some descriptive commit message'
$ git push origin master
$ git checkout gh-pages // go to the gh-pages branch
$ git rebase master // bring gh-pages up to date with master
$ git push origin gh-pages // commit the changes
mandiwise / seedData.js
Last active Aug 7, 2019
Generate seed data for Auth0 and MongoDB.
View seedData.js
const faker = require("faker");
const gravatarUrl = require("gravatar-url");
const mongoose = require("mongoose");
const auth0 = require("../config/auth0");
const initMongoose = require("../config/mongoose");
const Post = require("../models/Post");
const Profile = require("../models/Profile");
const Reply = require("../models/Reply");
mandiwise / data.js
Last active Apr 17, 2019
Some sample movie data
View data.js
const data = {
people: [
id: 1,
name: "Mark Hamill",
birthday: "September 25, 1951",
placeOfBirth: "Oakland, California, USA",
"Mark Hamill is best known for his portrayal of Luke Skywalker in the original Star Wars trilogy.",
filmography: [1]
mandiwise / Stop tracking directory in Git repo
Last active Feb 11, 2019
A command to stop tracking and entire directory in a Git repo
View Stop tracking directory in Git repo
// Reference:
$ git rm --cached -r <dir>
mandiwise / Limit Gravity Forms Upload Size
Last active Jan 29, 2019
Set a maximum upload size for a Gravity Forms image field
View Limit Gravity Forms Upload Size
function limit_file_upload_size( $validation_result ) {
$form = $validation_result['form'];
foreach( $form['fields'] as &$field ){
// NOTE: Add a custom CSS class to your image upload field and grab onto it here...
if( strpos( $field['cssClass'], 'choose-file' ) === false )
mandiwise / Dynamically Populate Gravity Forms Dropdown with CPT
Last active Dec 26, 2018
Using gform_pre_render_[form ID] for Auto-population
View Dynamically Populate Gravity Forms Dropdown with CPT
function populate_concept_nominees( $form ){
foreach ( $form['fields'] as &$field ){
// Set a custom CSS class for your field and grab onto it here
if ( $field['type'] != 'select' || strpos( $field['cssClass'], 'populate-concept' ) === false )
// Query parameters for get_posts
mandiwise / dataFormatHelpers.js
Last active May 22, 2018
Function to help format data fetched from the R10 Graphcool API for a React Native SectionList.
View dataFormatHelpers.js
// Helper to format GraphQL data into section list data
export const formatSessionData = sessions => {
return sessions
.reduce((acc, curr) => {
const timeExists = acc.find(section => section.title === curr.startTime);
: acc.push({ title: curr.startTime, data: [curr] });
return acc;
}, [])
mandiwise / functions.php
Last active Mar 25, 2018
Create, display and save an URL field in a WP custom metabox
View functions.php
* Add the metabox.
function my_url_add_metabox() {
'my_url_section', // The HTML id attribute for the metabox section
'My URL Metabox Title', // The title of your metabox section
You can’t perform that action at this time.