One way of many...
This is one way which keeps the history looking like you'd expect.
Command is equivalent to git checkout MINE; git merge -s theirs HERS
.
license: gpl-3.0 | |
redirect: https://beta.observablehq.com/@mbostock/d3-pie-chart |
require 'md5' | |
class Chargify::HooksController < ApplicationController | |
protect_from_forgery :except => :dispatch | |
before_filter :verify, :only => :dispatch | |
EVENTS = %w[ test signup_success signup_failure renewal_success renewal_failure payment_success payment_failure billing_date_change subscription_state_change subscription_product_change ].freeze | |
def dispatch | |
event = params[:event] |
// Represents an edge from source to sink with capacity | |
var Edge = function(source, sink, capacity) { | |
this.source = source; | |
this.sink = sink; | |
this.capacity = capacity; | |
}; | |
// Main class to manage the network | |
var Graph = function() { | |
this.edges = {}; |
http://jsfiddle.net/GuQaV/show/ |
var Complex = function(real, imag) { | |
if (!(this instanceof Complex)) { | |
return new Complex (real, imag); | |
} | |
if (typeof real === "string" && imag == null) { | |
return Complex.parse (real); | |
} | |
this.real = Number(real) || 0; |
// pre-render d3 charts at server side | |
var d3 = require('d3') | |
, jsdom = require('jsdom') | |
, fs = require('fs') | |
, htmlStub = '<html><head></head><body><div id="dataviz-container"></div><script src="js/d3.v3.min.js"></script></body></html>' | |
jsdom.env({ | |
features : { QuerySelector : true } | |
, html : htmlStub | |
, done : function(errors, window) { |
class Api::RegistrationsController < Api::BaseController | |
respond_to :json | |
def create | |
user = User.new(params[:user]) | |
if user.save | |
render :json=> user.as_json(:auth_token=>user.authentication_token, :email=>user.email), :status=>201 | |
return | |
else |