Skip to content

Instantly share code, notes, and snippets.

View dralletje's full-sized avatar
🛰️
😱🦁🤨

Michiel Dral dralletje

🛰️
😱🦁🤨
View GitHub Profile
@dralletje
dralletje / 1 Hey.md
Last active October 22, 2017 17:04
Changelog voor app - inclusief wat te testen

App update nummer 1.4 (1.25) staat nu op testflight.

Hij is verbonden met het http://test-portal.ubutler.nl.

Dat portal heeft ook een voorbeeld van hoe je bericht er uit gaat zien, met formatting en alles.

Alles zou nu moeten werken. Er zijn nog wat dingen die natuurlijk beter zouden kunnen, maar voor zover ik kon vinden geen bugs.

@dralletje
dralletje / MetaComponents.jsx
Created June 21, 2017 23:36
Meta components, agnostic of literally everything
// @flow
import React from 'react';
import shallowEqual from 'shallowequal';
// Still not sure what I should call this
export class EmptyC extends React.Component {
render() {
return null;
}
@dralletje
dralletje / ReduxReact.jsx
Created June 20, 2017 23:38
The all new Redux React
import React from 'react';
import { connect } from 'react-redux';
export class Lifecycle extends React.Component {
props: {
componentDidMount?: () => mixed,
};
componentDidMount() {
if (this.props.componentDidMount) {
this.props.componentDidMount();
@dralletje
dralletje / Page.jsx
Created June 10, 2017 16:31
My "simple" react router
// @flow
import React from 'react';
import { View, Animated, Dimensions } from 'react-native';
import { startAnimationAsync, requestAnimationFrameAsync } from './utils';
import type { AnimationInput } from './transitions';
import TransitionDelayer from './TransitionDelayer';
type EndResult = { finished: boolean };
/*
Simple component that will not render anything.
On mount it will bind to a document event, and it will clean up on unmount
<DocumentEvent
name="scroll"
handler={updateScrollPosition}
/>
@flow
*/
@dralletje
dralletje / App.js
Created September 20, 2016 18:38
Little more separate but maybe more usable.css.js
import React, { Component } from 'react';
import logo from './logo.svg';
import createStyleSheet from './createStyleSheet';
let AppLogoSpin = {
from: { transform: `rotate(0deg)` },
to: { transform: `rotate(360deg)` },
};
@dralletje
dralletje / Image.js
Last active October 17, 2016 12:32
Image (or anything) preloader for react native router
import React from 'react';
import { Image as NativeImage } from 'react-native';
/*
Awful but necessary (I think) hack to wait for an image to load.
It looks in the context for "requestTransitionDelay", calls that
(so the parent can keep track of images rendered) and then calls the returned function
when it has laoded (so the parent knows that it is loaded)
*/
@dralletje
dralletje / GlobModule.js
Last active March 21, 2017 13:54
Allow `glob!....` modules in react native with bundled node-haste
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
'use strict';
// Is it possible to define a type like
type DeepObject = <Leaf>{ [key: string]: Leaf | DeepObject<Leaf> };
// ^^^ I imagine this could be a way to pass the needed type further
// So I could make a function like
const deepMap = <Leaf, NextLeaf>(deepObject: DeepObject<Leaf>, fn: (value: Leaf) => NextLeaf): DeepObject<NextLeaf> => {
// stuff
});
Version 1
droidSpawnRateMultiplierTeamZero 1
droidSpawnRateMultiplierTeamOne 1
droidSpawnRateMultiplierTeamNeutral 1
droidGroupSizeMultiplierTeamZero 1
droidGroupSizeMultiplierTeamOne 1
droidGroupSizeMultiplierTeamNeutral 1
addBotsUpToTeamZero 0
addBotsUpToTeamOne 0
aiDifficultyStep 3