Skip to content

Instantly share code, notes, and snippets.

View jonathanmoore's full-sized avatar
🚀
Building for Shopify

Jonathan Moore jonathanmoore

🚀
Building for Shopify
View GitHub Profile
@jonathanmoore
jonathanmoore / custom.css
Created April 28, 2014 16:54
Cadence Center Images
/*
Cadence Center Images Added to the Caption/Body of Posts
Paste the following into Customize > Advanced > Custom CSS
*/
article section img {
display: block;
margin: 0 auto;
}

Steps to break one large repo into multiple repos based off of DIRNAME

git filter-branch --prune-empty --subdirectory-filter DIRNAME master

rm -rf .git/refs/original/ && git reflog expire --all &&  git gc --aggressive --prune=now

git clean -fdx

git reflog expire --all --expire-unreachable=0
@jonathanmoore
jonathanmoore / git-combine.md
Created January 28, 2014 21:53
Combining Repos

Steps to Combine Git Repos w/ Perserving History

# Add a remote for and fetch the old repo
git remote add -f theme_name <theme_name repo URL>

# Merge the files from theme_name/master into new/master
git merge theme_name/master

# Move the old_a repo files and folders into a subdirectory so they don't collide with the other repo coming later
<script src="http://platform.tumblr.com/v1/share.js"></script>
<!-- Containers -->
<p id="tumbr_video_share"></p>
<p id="tumbr_text_share"></p>
<!-- Everlapse Vars -->
<script type="text/javascript">
var everlapse_title = 'Walk With Me';

Make it real

Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discussions around concrete examples, not handy-waving abstractions. Don't say you did something, provide a URL that proves it.

Ship it

Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.

Do it with style

@jonathanmoore
jonathanmoore / Switch to Github
Created March 4, 2013 19:38
A useful set of commands to switch over to Github as a new remote.
git remote rm origin
git remote add origin git@github.com:user/repo.git
git push -u origin master
git push --all
git push --tags
@jonathanmoore
jonathanmoore / Gruntfile.js
Last active December 14, 2015 08:49
A sample Grunt file to jshint, uglify, watch (regarde), connect a local server, and live reload the files.
'use strict';
var path = require('path');
var lrSnippet = require('grunt-contrib-livereload/lib/utils').livereloadSnippet;
var folderMount = function folderMount(connect, point) {
return connect.static(path.resolve(point));
};
module.exports = function(grunt) {
@jonathanmoore
jonathanmoore / README.mkd
Created November 8, 2012 07:55 — forked from christophermanning/README.md
Voronoi Diagram with Force Directed Nodes and Delaunay Links

Created by Christopher Manning

Summary

Nodes are linked to nodes in neighboring cells. The cell's color is a function of its area.

Controls

  • Drag the nodes to interact with the diagram.
  • Use the mousewheel to add/remove nodes.
@jonathanmoore
jonathanmoore / gist:2640302
Created May 8, 2012 23:17
Get the share counts from various APIs

Share Counts

I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.

If you want to roll up all of these into a single jQuery plugin check out Sharrre

Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.

Twitter

@jonathanmoore
jonathanmoore / pinterest.js
Created March 26, 2012 23:21 — forked from 65/pinterest.js
pinterest buttons on every image in a blog post using jquery
$().ready(function() {
$('.entry-body img').each(function(){
var $permalink = $(this).parents('.entry').find('.permalink').attr('href');
$(this).wrap('<div class="pinme" style="' + $(this).attr('style') + '" />').after('<a href="http://pinterest.com/pin/create/button/?url=' + $permalink + '&media=' + $(this).attr('src') + '&description=' + $(this).attr('alt') + '" class="pin-it-button" count-layout="vertical">Pin It</a>');
});
$('.pinme').hover(function() {
$(this).children('iframe').css('display','block');
}, function() {
$(this).children('iframe').css('display','none');