Skip to content

Instantly share code, notes, and snippets.

View esbanarango's full-sized avatar

Esteban esbanarango

View GitHub Profile
import Component from '@glimmer/component';
export default class extends Component {
get aValueInfo() {
return `The value value is ${this.args.aValue}`;
get anObjectInfo() {
return this.args.anEngineer.handle;
Assertion Failed: You accessed `this.field` from a function passed to the `fn` helper, but the function itself was not bound to a valid `this` context. Consider updating to usage of `@action`.
esbanarango / controllers.application.js
Last active February 12, 2020 04:20 — forked from sduquej/controllers.application.js
Editing array of strings
import Ember from 'ember';
import { set } from '@ember/object';
export default Ember.Controller.extend({
primitiveFruits: ['banana' ,'apple'],
wrappedFruits: [{name: 'banana'}, {name: 'apple'}],
printPrimitiveFruits() {
esbanarango /
Created October 22, 2017 00:08 — forked from deanmarano/
Tested Jekyll

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
esbanarango / controllers.application.js
Last active July 2, 2017 14:51
Power Select issue #929
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();
#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:

var promise = new Promise(function(resolve) { => {
}), 5000);
return promise.then(() => {
return 'I was sleeping';
esbanarango / application.controller.js
Last active September 14, 2015 20:54
Adapter methods
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))