Skip to content

Instantly share code, notes, and snippets.

Jody Heavener jodyheavener

Block or report user

Report or block jodyheavener

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
jodyheavener / env.js
Last active Oct 8, 2017
Various Javascript utilities
View env.js
// Use this to access process env vars in a React setup
export function env(key, fallback) {
return process.env[`REACT_APP_${key}`] || fallback;
jodyheavener / svg_helper.rb
Created Oct 7, 2016
Rails Helper to maintain SVGs and consistently output them in your views.
View svg_helper.rb
# Allows Rails views to output consistent inline SVG code
module SvgHelper
def svg(named, options={})
svg_data = svg_defs[named]
defaults = {
:verion => "1.1",
:role => "img",
:width => svg_data[:width],
jodyheavener /
Created Aug 18, 2015
Use Babel (ES6) with Sails JS

Inspired by this issue, with these instructions you should be able to get Babel transpiling your JS in Sails JS for the client side.

  1. Install Grunt Babel npm install --save grunt-babel
  2. Create a babel.js file under tasks/config and add something like the following:
module.exports = function(grunt) {

    grunt.config.set('babel', {
      dev: {
View bling.js
// bling.js
// fork of
// which is a fork of
window.$ = document.querySelectorAll.bind(document)
Node.prototype.on = window.on = function(name, fn) {
var _this = this;
jodyheavener / Import SVG.sketchplugin
Last active Mar 13, 2018
Import a desired SVG in to a Sketch canvas
View Import SVG.sketchplugin
// Import Ale's fantastic Sketch Sandbox
#import 'sketch-sandbox.js'
// Are we on a page or an artboard?
var page = doc.currentPage();
var canvas = page.currentArtboard() ? page.currentArtboard() : page;
// Define the location of the file you want to import, using file:// protocol
var fileURL = NSURL.URLWithString("file:///Users/johndoe/Downloads/my_cat.svg");
View index.slim
doctype 5
meta charset="utf-8"
meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"
meta name="viewport" content="width=device-width"
title My Dream Cars
link rel="stylesheet" href="styles/site.css"
View gist:d57d2f744b0bcd32eb65
/* Animation and Transform mixins */
@mixin animation($str) {
-webkit-animation: #{$str};
-moz-animation: #{$str};
-ms-animation: #{$str};
animation: #{$str};
-webkit-animation-fill-mode: both;
-moz-animation-fill-mode: both;
View gist:afba9be8f4bea63282ca
@mixin keyframes($animation-name) {
@-webkit-keyframes $animation-name {
@-moz-keyframes $animation-name {
@-ms-keyframes $animation-name {
View gist:1c08d854f0d605f12f42
<div class="contact">
<?php $social_icons = array(
You can’t perform that action at this time.