Skip to content

Instantly share code, notes, and snippets.

const log = (scope, item) => () => console.log(`${item} of ${scope}`);
const dummy = () => {};
describe('Outer scope', function() {
before(log(this.title, 'before'));
beforeEach(log(this.title, 'beforeEach'));
afterEach(log(this.title, 'afterEach'));
@Sinewyk
Sinewyk / connectToI18n.js
Created March 21, 2016 10:01
from mixin to HoC for i18n
const path = require('path');
const printOptions = {
quote: 'single',
trailingComma: true,
};
const I18N_MIXIN = 'i18nMixin';
const I18N_MIXIN_FILE = 'mixins/i18n';
const CONNECT_TO_I18N = 'connectToI18n';
@Sinewyk
Sinewyk / removeArrowFunctionFromMochaTests.js
Last active April 28, 2016 20:49
remove arrow function from mocha tests
const _ = require('underscore');
const printOptions = {
quote: 'single',
trailingComma: true,
};
const mochaFunctions = [
'describe',
'it',
@Sinewyk
Sinewyk / transformShouldToExpect.js
Created March 15, 2016 16:48
should to expect transform
const printOptions = {
quote: 'single',
trailingComma: true,
};
const SHOULD = 'should';
module.exports = function transform(file, api) {
const source = file.source;
@Sinewyk
Sinewyk / introrx.md
Created January 24, 2016 17:45 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
var React = require('react');
var Grandparent = React.createClass({
childContextTypes: {
foo: React.PropTypes.string.isRequired
},
getChildContext: function() {
return {
foo: this.props.foo
@Sinewyk
Sinewyk / example.js
Created June 20, 2015 11:34
No more classes only proxy to functional stuff
/**
* Functional is always better. Keep it simple, just proxy them to classes if you need
* Classes sucks. Try to avoid them.
* Always give a way to use something "class specific" to others
* => don't make it class specific in the first place
* /
function Foo(x) {
this.x = x;
}