Skip to content

Instantly share code, notes, and snippets.

View erjjones's full-sized avatar

Eric Jones erjjones

  • Indianapolis, Indiana
View GitHub Profile
@erjjones
erjjones / Custom.js
Created December 21, 2011 20:02
Custom.js
jQuery(function () {
var paper = Raphael("graph", 940, 81),
timeline;
timeline = new Timeline(paper, [
{date:"06/25/2004", version:"0.5"},
{date:"12/13/2005", version:"1.0.0"},
{date:"12/07/2007", version:"2.0.0"},
{date:"6/10/2010", version:"3.0 ?"}
@erjjones
erjjones / NodeJsProxy
Created January 25, 2012 21:58
Node.js Proxy
var http = require('http');
http.createServer(function(request, response) {
var proxy = http.createClient(80, request.headers['host'])
var proxy_request = proxy.request(request.method, request.url, request.headers);
proxy_request.addListener('response', function (proxy_response) {
proxy_response.addListener('data', function(chunk) {
response.write(chunk, 'binary');
});
proxy_response.addListener('end', function() {
@erjjones
erjjones / jsonp-usage.js
Created March 7, 2012 21:13 — forked from sindresorhus/jsonp-usage.js
JSONP function - Easily fetch remote JSONP files
// Example usage: Fetch it's own code from GitHub
JSONP( 'https://api.github.com/users/erjjones?callback=?', function( response ) {
var data = response.data;
console.log(data.followers);
});
@erjjones
erjjones / GetGitHubInfoBadExample.js
Created March 7, 2012 21:36
Bad Example: Get Git Hub Account Information (Ajax)
jQuery(document).ready(function() {
$('#gf').text('GitHub Followers');
$('#gfr').text('GitHub Repos');
$.get('https://api.github.com/users/erjjones', function(res) {
var obj = jQuery.parseJSON(res);
if(typeof obj.followers != 'undefined')
{
$('#gf').text(obj.followers + ' GitHub Followers');
@erjjones
erjjones / TwitterLink.html
Created March 7, 2012 22:24
Twitter User Link
@erjjones
erjjones / GooglePlusUserLink.html
Created March 7, 2012 22:28
Google Plus User Link
@erjjones
erjjones / JekyllRedditButton.html
Created March 7, 2012 22:44
Jekyll Reddit Button
<script type="text/javascript" src="http://www.reddit.com/buttonlite.js?i=2&styled=off&url=http://erjjones.github.com{{ page.url }}&newwindow=1"></script>
@erjjones
erjjones / Disqus.html
Created March 8, 2012 02:02
Disqus Code Block
<!-- This is the actual comments section -->
<div id="disqus_thread"></div>
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
var disqus_shortname = 'erjjones'; // required: replace example with your forum shortname
var disqus_identifier = '{{ page.url }}';
var disqus_url = 'http://erjjones.github.com{{ page.url }}';
/* * * DON'T EDIT BELOW THIS LINE * * */
(function() {
@erjjones
erjjones / JekyllListAllPosts.html
Created March 8, 2012 03:22
Jekyll List All Posts
{% for post in site.posts %}
<h3><a href="{{ post.url }}">{{ post.title }}</a></h3>
<p><small><strong>{{ post.date | date: "%B %e, %Y" }}</strong> . {{ post.category }} . <a href="http://erjjones.github.com{{ post.url }}#disqus_thread"></a></small></p>
{% endfor %}
@erjjones
erjjones / JekyllPagination.html
Created March 8, 2012 03:33
Jekyll Pagination
<div class="span9 column">
<p class="pull-right">{% if page.previous.url %} <a href="{{page.previous.url}}" title="Previous Post: {{page.previous.title}}"><i class="icon-chevron-left"></i></a> {% endif %} {% if page.next.url %} <a href="{{page.next.url}}" title="Next Post: {{page.next.title}}"><i class="icon-chevron-right"></i></a> {% endif %} </p>
</div>