Skip to content

Instantly share code, notes, and snippets.

View jcemer's full-sized avatar
🐢
.

Jean Carlo Emer jcemer

🐢
.
View GitHub Profile
@jcemer
jcemer / gist:5400404
Last active December 16, 2015 07:39
Count repeated words.
# it parses "a a a a b b b c c" to {"a"=>4, "b"=>3, "c"=>2}
# FROM
def self.estatisticas_do_texto(texto)
palavras = []
texto.split(' ').each do |word|
w = word.downcase.gsub(/\.|\,|\?|\!|\(|\)|\'/,'')
palavras << w
end
palavras.sort!
@jcemer
jcemer / code.scss
Last active December 26, 2015 09:29
.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
jcemer / add.js
Created July 8, 2014 19:09
Browserify sample
module.exports = function (a, b) {
return a + b;
};
var vm = require('vm')
var sandbox = {externalArray: [], externalArryConstructor: Array}
vm.createContext(sandbox)
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))

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 Globo.com to manage a metrics layer for http://globoplay.globo.com. 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.

/* @flow */
import typify from "typify"
class Ok<A> {
value: A
constructor(value: A) {
this.value = value
}
}
@jcemer
jcemer / angular-test-helper-usage.ts
Last active April 2, 2018 02:09
Let's make your life better testing Angular like writing jQuery code. It's inspired by https://github.com/airbnb/enzyme.
describe('Component', () => {
let wrapper;
beforeEach(() => {
wrapper = build(Component);
wrapper.set({
data: 'value',
});
});