This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe('Component', () => { | |
let wrapper; | |
beforeEach(() => { | |
wrapper = build(Component); | |
wrapper.set({ | |
data: 'value', | |
}); | |
}); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* @flow */ | |
import typify from "typify" | |
class Ok<A> { | |
value: A | |
constructor(value: A) { | |
this.value = value | |
} | |
} |
This is a proposal for a lightning talk at the Reactive 2016 conference. If you like this, star the Gist.
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function (a, b) { | |
return a + b; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.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 { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var x = 2 | |
with ({x:3}) { | |
console.log(x) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Robot = function(robot){ | |
robot.turnLeft(robot.angle % 90); | |
robot.turnGunRight(90); | |
robot.clone(); | |
this.direction = 1; | |
}; | |
Robot.prototype.onIdle = function(ev) { | |
var robot = ev.robot; | |
robot.ahead(1); | |
if (robot.parentId) { |
NewerOlder