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 / gist:1099975
Created July 22, 2011 17:54
Transcender / Ascender - additional sidebar widget HTML
<h4>First box</h4>
<p>Text HTML inside of the first widget box</p>
</div><div class="sidebox widget">
<h4>Second box</h4>
<p>Check out <a href="http://stylehatch.co">Style Hatch</a></p>
</div><div class="sidebox widget">
<h4>Third box</h4>
<p>Text HTML inside of the third widget box</p>
@jonathanmoore
jonathanmoore / disqus-comment-count
Created November 18, 2011 17:08
Updated Disqus comment count
{block:IfDisqusUsername}
<script type="text/javascript">
var disqus_shortname = '{text:Disqus Username}';
(function () {
var s = document.createElement('script'); s.async = true;
s.type = 'text/javascript';
s.src = 'http://' + disqus_shortname + '.disqus.com/count.js';
(document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
}());
</script>
<section class="ad">
<object height="260" width="100%"><param name="wmode" value="transparent"><param name="movie" value="http://widget.gigatools.com/GigaToolsWidget.swf?user=benjiboko&font=default&ca=0&cb=33ff00&cc=ffffff"></param>; <param name="allowscriptaccess" value="always"></param> <embed allowscriptaccess="always" wmode="transparent" height="260" src="http://widget.gigatools.com/GigaToolsWidget.swf?user=benjiboko&font=default&ca=0&cb=33ff00&cc=ffffff"; type="application/x-shockwave-flash" width="100%"></embed></object>
</section>
@jonathanmoore
jonathanmoore / gist:1473089
Created December 13, 2011 17:45
Tumblr <embed> striping
<!-- Embed code for Mixcloud -->
<object width="480" height="480">
<param name="movie" value="http://www.mixcloud.com/media/swf/player/mixcloudLoader.swf?feed=http%3A%2F%2Fwww.mixcloud.com%2Fvlekrecords%2Fssaliva-lrzpm%2F&embed_uuid=ae879085-19b7-4e66-86b0-9e2e50835c9d&stylecolor=&embed_type=widget_standard"></param>
<param name="allowFullScreen" value="true"></param>
<param name="wmode" value="opaque"></param>
<param name="allowscriptaccess" value="always"></param>
<embed src="http://www.mixcloud.com/media/swf/player/mixcloudLoader.swf?feed=http%3A%2F%2Fwww.mixcloud.com%2Fvlekrecords%2Fssaliva-lrzpm%2F&embed_uuid=ae879085-19b7-4e66-86b0-9e2e50835c9d&stylecolor=&embed_type=widget_standard" type="application/x-shockwave-flash" wmode="opaque" allowscriptaccess="always" allowfullscreen="true" width="480" height="480"></embed>
</object>
<!-- Embed code after Tumblr strips the <embed> tag -->
@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');
@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 / 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 / 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 / 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

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