Skip to content

Instantly share code, notes, and snippets.

View gfargo's full-sized avatar
🥫
Revolutionizing Food Regulation with Okayd

Griffen Fargo gfargo

🥫
Revolutionizing Food Regulation with Okayd
View GitHub Profile
@gfargo
gfargo / Gruntfile.js
Last active September 23, 2015 15:42
Easy way to seperate out Grunt stuff to avoid massive gruntfiles
/*****************************************************
Grunt'd
This 'plop-in' plugin was created to expedite the
process of adding the required files for front-end
development.
This includes template scss files and `main.js`
@gfargo
gfargo / CustomMapWidget.php
Last active August 29, 2015 14:26
Extend 2amigos Leaflet Map Class - Allowing for Global access to Map variable
<?php
namespace app\components;
use dosamigos\leaflet\LeafLet;
use dosamigos\leaflet\widgets\Map;
use dosamigos\leaflet\LeafLetAsset;
use yii\base\InvalidConfigException;
use yii\base\Widget;
use yii\helpers\ArrayHelper;
use yii\helpers\Html;
@gfargo
gfargo / client-app.js
Last active August 29, 2015 14:22 — forked from jackiig/client-app.js
Template.CommentAdd.events({
'submit form': function(e, tmpl) {
e.preventDefault();
formEl = tmpl.find('form');
comment = tmpl.find('[name=comment]').value;
if (comment.trim().length == 0) { return false; };
Comments.insert({
login: Meteor.user().profile.login,
timestamp: new Date,
room: Session.get('activeRoom'),
@gfargo
gfargo / array-explode.php
Created March 23, 2015 15:23
Easy Array Explode | Map Maker WP Plugin
<?php
/*
Do Shortcode
http://codex.wordpress.org/Function_Reference/do_shortcode
StackOverflow - Better Way to Explode String
http://stackoverflow.com/questions/7355301/a-better-way-to-explode-twice-in-php
*/
@gfargo
gfargo / WP - Contextual Help Dropdown.php
Created January 21, 2015 18:05
Easy function to add help tabs to WP Admin Pages
add_filter( 'contextual_help', 'wptuts_contextual_help', 10, 3 );
function wptuts_contextual_help( $contextual_help, $screen_id, $screen ) {
// Only add to certain screen(s). The add_help_tab function for screen was introduced in WordPress 3.3.
if ( $screen_id == 'market-trends' || ! method_exists( $screen, 'add_help_tab' ) )
return $contextual_help;
$screen->add_help_tab( array(
'id' => 'wptuts-overview-tab',
@gfargo
gfargo / Basic Form - Name.Business.Email.Number.Message
Last active August 29, 2015 14:05
CF7 - Example Forms [Bootstrap]
<div class="input-group col-sm-6">
[text* cf-name class:form-control placeholder "Name"]
<span class="input-group-addon"><i class="fa fa-user"></i></span>
</div>
<div class="input-group col-sm-6">
[text* cf-business class:form-control placeholder "Business Name"]
<span class="input-group-addon"><i class="fa fa-building"></i></span>
</div>
@gfargo
gfargo / WP Contact Form 7 - MailChimp
Last active August 29, 2015 14:04
MailChimp API Integrations
<?php
/************************************************
Mail Chimp Integration with Wordpress Contact Form 7
************************************************/
function wpcf7_send_to_mailchimp($cfdata) {