Skip to content

Instantly share code, notes, and snippets.


Anton Katunin antulik

View GitHub Profile


  • Initial evaluation: seems the most mature. Apparently, has bad documentation, and is hard to use without going to its source code.
    • undergoing big rewrite


  • Initial evaluation: its main goal is to offer a simple API to create charts
View one.js
var D3punchcard = function(el, options) {
options || (options = {});
var _chart = {};
var _svg = null;
var _this = this;
_this.el = el =;
var days = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
View gist:bcc5c487a48f10ecea72

Header 1

Header 2

Header 3 ### (Hashes on right are optional)

Header 4

Header 5

Markdown plus h2 with a custom ID ## {#id-goes-here}

Link back to H2

This is a paragraph, which is text surrounded by whitespace. Paragraphs can be on one

View .md


  • AU
  • 2.4% + $0.30
  • 9 currencies
  • US 2.9% + $0.30
  • recurring billing
  • 40 countries, 130 currencies
  • $25 chargeback
View controller_1.rb
def show
render_js do
if result[:error]
messenger_error(message: result[:error][:message])
messenger_success(message: 'Your message was sent successfully')
antulik / one.rb
Created Aug 13, 2015
dragon fly helper
View one.rb
def thumb_url photo, size
case photo
when ImageUploader
if Rails.env.development?
path = photo.path
path = photo.url
when String
path = photo
View transaction.rb
class Reconciliation::Transaction < Reconciliation::Validator
def initialize transaction
@transaction = transaction
def new_error @transaction.history, @transaction
def verify options = {}
antulik /
Created Oct 12, 2012
Integration testing of google analytics/kissmetrics script.

To easily explain, imaging you are developing google analytics or kissmetrics and you need to do integration testing of the javascript file. That's the file which people include on their website. Assume client also needs to push some events like signups to the web analytics tool (like kissmetrics) and javascript syntax would be _ga.push(['register', event, extra_data])

The challenge is that in you tests you can't run it from your application as it will share user session and it wouldn't test same origin policy.

Tools stack: Capybara, Webkit, Rspec, Sinatra

So the solution is to have a separate application which will act as a dummy client. I've chose sinatra as it fits perfectly for that role. One of the cool features that rack has is its ability to mount other rack applications inside it. So in run_dummy_client helper we mount sinatra application to /dummy_client path.

But that's not all. In order for this to work we need to run dummy client from different domain. That could be easily done through

You can’t perform that action at this time.