Skip to content

Instantly share code, notes, and snippets.


Esteban Arango Medina esbanarango

Block or report user

Report or block esbanarango

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile

Testing Your Jekyll Site, The Ruby Way

Here at eSpark Learning, we use Jekyll to host our marketing site, Within eSpark Engineering, we love automated testing - most of our codebases require a passing test suite for all changes. As we add more javascript to our Jekyll site, we wanted to add a test framework that would give us real world tests - testing that the HTML was valid was no longer enough.

Acceptance Testing with RSpec, Capybara, and Selenium

To create real world acceptance tests for our site, we used a few technologies we were familiar with:

  • RSpec - Behaviour Driven Development for Ruby
  • Capybara - Test web applications by simulating how a real user would interact with your app
  • Selenium - Selenium automates browsers
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
cities: ['Barcelona', 'London', 'New York', 'Porto'],
destination: 'London',
actions: {
chooseDestination(city) {
this.set('destination', city);
// this.calculateRoute();
View hackonacci.cpp
#include <map>
#include <set>
#include <list>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <bitset>

Keybase proof

I hereby claim:

  • I am esbanarango on github.
  • I am esbanarango ( on keybase.
  • I have a public key whose fingerprint is 8087 A142 D24B 5A06 76B9 9F32 239F 5139 6604 FC41

To claim this, I am signing this object:

View sleep-with-promise.js
var promise = new Promise(function(resolve) { => {
}), 5000);
return promise.then(() => {
return 'I was sleeping';
View application.controller.js
import Ember from 'ember';
import DS from 'ember-data';
export default Ember.Controller.extend({
appName:'Ember Twiddle'
var adapter = new DS.Adapter();
# based on Haversine formula
distance = (lat1, lon1, lat2, lon2) ->
R = 6371
a = 0.5 - Math.cos((lat2 - lat1) * Math.PI / 180) / 2 + Math.cos(lat1 * Math.PI / 180) * Math.cos(lat2 * Math.PI / 180) * (1 - Math.cos((lon2 - lon1) * Math.PI / 180)) / 2
R * 2 * Math.asin(Math.sqrt(a))
View xls_script.rb
require 'roo'
require 'axlsx'
require 'fileutils'
class XlsScript
attr_accessor :file_path
def initialize(file_path)
@file_path = file_path
View colombiaGeoMap.js
function drawVisualization() {
var dataTable = new google.visualization.DataTable();
dataTable.addColumn('number', 'LATITUDE', 'Latitude');
dataTable.addColumn('number', 'LONGITUDE', 'Longitude');
dataTable.addColumn('number', 'Votantes', 'Value'); // Won't use this column, but still must define it.
esbanarango /
Created Dec 29, 2013
ActiveRecord::Calculations can receive SQL functions.

ActiveRecord::Calculations can receive SQL functions.

sum("CAST(total AS float)")
average("CAST(total AS float)")

total dataType is String.

You can’t perform that action at this time.