Skip to content

Instantly share code, notes, and snippets.

View michealbenedict's full-sized avatar

Micheal michealbenedict

View GitHub Profile
@michealbenedict
michealbenedict / d3.sankey.js
Created December 2, 2015 03:26 — forked from emeeks/d3.sankey.js
Sankey Particles IV
d3.sankey = function() {
var sankey = {},
nodeWidth = 24,
nodePadding = 8,
size = [1, 1],
nodes = [],
links = [];
sankey.nodeWidth = function(_) {
if (!arguments.length) return nodeWidth;
@michealbenedict
michealbenedict / LICENSE.txt
Created August 15, 2012 06:23 — forked from sdepold/LICENSE.txt
140byt.es -- addObserverMethods
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Sascha Depold http://depold.com
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
/*
* backbone.scene.js v0.1
* Copyright 2012, Jason Kadrmas (@itooamaneatguy)
*/
(function(Backbone, _, $) {
"use strict";
Backbone.Scene = Backbone.View.extend({});
git remote add upstream [Clone Url]
git fetch upstream
git checkout master
## At this point, you have two options:
git merge upstream/master # Merge yours and theirs
git push origin master # Push back to your fork
git reset --hard upstream/master # Make yours look *exactly* like theirs, lose your changes;
@michealbenedict
michealbenedict / hogan.js
Created March 28, 2012 19:16
Hogan adapter with layout & partial support for express 3
'use strict';
var fs = require('fs'),
path = require('path'),
hogan = require('hogan.js'),
templateCache = {},
partials = {},
layout;
function normalisePath(name, extension){
var currentExtension = path.extname(name);
/* =============================================================
* bootstrap-typeahead-backbone.js v2.0.0
* http://twitter.github.com/bootstrap/javascript.html#typeahead
* https://github.com/twitter/bootstrap/blob/master/js/bootstrap-typeahead.js
* Modified by Marius Andreiana to work with Backbone Collection, Model, View
* - custom results formatting
* - custom behavior on selected item (Model with complex information)
* =============================================================
* Copyright 2012 Twitter, Inc.
*
@michealbenedict
michealbenedict / README.markdown
Created March 18, 2012 18:11
Bootstrap's Typeahead plugin extended (allowing for AJAX functionality) among other things

This is a fork of Bootstrap Typeahead that adds minimal but powerful extensions.

For example, process typeahead list asynchronously and return objects

  # This example does an AJAX lookup and is in CoffeeScript
  $('.typeahead').typeahead(
    # source can be a function
    source: (typeahead, query) ->
 # this function receives the typeahead object and the query string
@michealbenedict
michealbenedict / comma-first-var.js
Created March 14, 2012 15:19 — forked from isaacs/comma-first-var.js
A better coding convention for lists and object literals in JavaScript
// See comments below.
// This code sample and justification brought to you by
// Isaac Z. Schlueter, aka isaacs
// standard style
var a = "ape",
b = "bat",
c = "cat",
d = "dog",
@michealbenedict
michealbenedict / securing_rails_updates.md
Created March 5, 2012 15:18 — forked from peternixey/securing_rails_updates.md
How Homakov hacked GitHub and how to protect your application

##How Homakov hacked GitHub and the line of code that could have prevented it


Please note this is not posted by the GitHub team or in any way associated with them team. It's simply hosted as a Gist because the markdown formatting is excellent and far clearer than anything I could manage on my personal Tumblr.


@homakov’s explot on GitHub was simple and straightforward. Calling it an attack makes it sound malicious whereas the truth was that GitHub bolted its front door but left the hinges on quick release. Homakov released the hinges, walked in and shouted to anyone who would listen that they had a problem.

@michealbenedict
michealbenedict / application.rb
Created February 2, 2012 19:54 — forked from mcmire/application.rb
Integrating the Logging framework into your Rails 3 app
#-----------------------------------------------------------------------------------------------
# config/application.rb
#-----------------------------------------------------------------------------------------------
require File.expand_path('../boot', __FILE__)
require 'rails/all'
Bundler.require(:default, Rails.env) if defined?(Bundler)
# Bring in the Railtie that will set Rails' various logger variables to
# instances of Logging::Logger instead of Rails' built-in ActiveSupport::BufferedLogger.