Skip to content

Instantly share code, notes, and snippets.

View midgethoen's full-sized avatar
🚀

Midge 't Hoen midgethoen

🚀
  • LAB6
  • Vlaardingen
View GitHub Profile

Resume

General

name Midge 't Hoen
date of birth 22-05-1988
e-mail midge@lab6.io
phone +31638931114
address Leliestraat 11, Vlaardingen
@midgethoen
midgethoen / brew
Last active March 2, 2018 10:47
brew
ansible
awscli
direnv
htop
hub
mongodb
node
sqlite
watch
zsh
@midgethoen
midgethoen / README.md
Last active May 30, 2016 12:03
React i18n @ Yippie!

i18n in React(-native)

This doc describes our approach to i18n at Yippie! New developers can use this to get up to speed quicker, maybe we can agree upon some conventions at some point 🐥

Which libs

currently we use react-i18n in most frontends. We choose this repo because it fitted our list of requirements (at the time). Officially this lib does not support react-native but it works great, there's some small things to be considered when using it in react-native, though.

  1. Specify 'main' locale inline with code
  2. Automated message extraction from code (using babel-plugin-react-intl)
@midgethoen
midgethoen / midgesnaivebutton.js
Last active April 1, 2016 13:18
Stylesheets only please :)))
import { styleSheetsOnlyPlease } from './stylesheetsOnlyPlease';
pickTextStyles = R.pick(['color', 'font', 'italicity'])
pickContainerStyles = R.pick(['backgroundColor', 'bla', 'whoop'])
const MidgesNaiveButton = styleSheetsOnlyPlease(
class extends Component {
<TouchableOpacity
style={style.containerStyle}
>
@midgethoen
midgethoen / nock_test.spec.js
Created February 24, 2016 14:11
Figuring ou nock
import chai from 'chai';
chai.should();
import nock from 'nock';
import fetch from 'isomorphic-fetch';
describe('nock', function(){
it('handles request', function(done){
nock('https://yippie.nl')
.get(/\/some\/path/)
.reply(200, {status: 'ok'});
import { evolve } from 'ramda';
function parseDate(dateString){
return new Date(dateString);
}
/**
* @function transformOfferDates
* @desc Parses an offer's date fields
* @param { object } offer - An offer
@midgethoen
midgethoen / ProductScreen.js
Last active December 30, 2015 15:49
Wiring selectors
// imports ...
export const ProductScreen = React.createClass({ /*...*/ })
//return the selected product enitity in a map
const selectProduct = (state) => pick(state.search.products, state.search.selectedProduct)
//return all Vendor and Offer entities
const selectVendorsAndOffers = (state) => pick(['vendors','offers'], state.search)
@midgethoen
midgethoen / test.js
Created December 30, 2015 14:59
Check Ramda immutability
import R from 'ramda';
var deep = { a: { b: { c: 'first' } } };
var abcLens = R.lensPath(['a','b','c']);
var result = R.set(abcLens, 'second', deep);
// result === deep // -> false
// result.a === deep.a // -> false
@midgethoen
midgethoen / bla.js
Last active December 30, 2015 13:55
import { merge } from 'ramda';
// reducer
switch (action.type){
case ACTIVATE_PO:
return activatePo(state, offerId)
function togglePo(state, offerId, active){
return set(