Skip to content

Instantly share code, notes, and snippets.


Jean Carlo Emer jcemer

View GitHub Profile
jcemer / angular-test-helper-usage.ts
Last active Apr 2, 2018
Let's make your life better testing Angular like writing jQuery code. It's inspired by
View angular-test-helper-usage.ts
describe('Component', () => {
let wrapper;
beforeEach(() => {
wrapper = build(Component);
data: 'value',
View runtime-type-validation.js
/* @flow */
import typify from "typify"
class Ok<A> {
value: A
constructor(value: A) {
this.value = value
View Reactive Conf - Thinking metrics on React

This is a proposal for a lightning talk at the Reactive 2016 conference. If you like this, star the Gist.

Thinking metrics on React applications

In regular websites, it is common to send multiple events to track user clicks. Single Page Applications change the way you look at metrics. This is a talk about a simple pattern we created at to manage a metrics layer for The talk will cover how to track user flow using Google Analytics and other services. We solved the challenge of tying metrics and components, keeping information across pages and having global data. Also some React, React Router and React Side Effects concepts like context, higher order components, history state will be covered.

View Playing with node vm.js
var vm = require('vm')
var sandbox = {externalArray: [], externalArryConstructor: Array}
console.log(vm.runInContext('externalArryConstructor == Array', sandbox))
console.log(vm.runInContext('externalArray.constructor == Array', sandbox))
console.log(sandbox.externalArray.constructor == Array)
console.log(vm.runInContext('externalArray.__proto__ == [].__proto__', sandbox))
jcemer / add.js
Created Jul 8, 2014
Browserify sample
View add.js
module.exports = function (a, b) {
return a + b;
View code.scss
.section-title {
font-size: rem(28px);
color: $blue;
@include inverse-bottom-line(80%);
.collaborate-item:last-child {
@include left-line(90%);
padding-left: 10%;

.address-map {
jcemer / gist:5400404
Last active Dec 16, 2015
Count repeated words.
View gist:5400404
# it parses "a a a a b b b c c" to {"a"=>4, "b"=>3, "c"=>2}
def self.estatisticas_do_texto(texto)
palavras = []
texto.split(' ').each do |word|
w = word.downcase.gsub(/\.|\,|\?|\!|\(|\)|\'/,'')
palavras << w
jcemer / gist:4324878
Created Dec 18, 2012
No country for old men
View gist:4324878
var x = 2
with ({x:3}) {
jcemer / robot.js
Created Dec 4, 2012 — forked from cezarsa/robot.js
Simple Wall Robot
View robot.js
var Robot = function(robot){
robot.turnLeft(robot.angle % 90);
this.direction = 1;
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
if (robot.parentId) {