Skip to content

Instantly share code, notes, and snippets.

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

Michiel Dral dralletje

🛰️
😱🦁🤨
View GitHub Profile
'use strict';
import React from 'react'
import Events from '../utils/events'
const Sizes = {
SMALL: 1,
MEDIUM: 2,
LARGE: 3
};
import React from 'react'
class NavBar extends React.Component {
render() {
return <div class="bootstrap-navbar" {...this.props} />
}
}
import React from 'react'
export default const NavBar = props => <div class="bootstrap-navbar" {...props} />
export default const NavBar = props => {
return <div class="bootstrap-navbar" {...props} />
}
export default const NavBar = ({children, ...props}) => {
return (
@dralletje
dralletje / README.md
Last active November 30, 2015 16:05 — forked from JoelBesada/README.md
Backtick Example Command

Alert the amount of characters in the current selection

import fetch from 'node-fetch'
import {zipObject} from 'lodash'
const send = (method, ...args) => subject => subject[method](...args)
const get = prop => object => object[prop]
const log = message => subject => {
console.log(message, subject)
return subject
}
Version 1
droidSpawnRateMultiplierTeamZero 0
droidSpawnRateMultiplierTeamOne 0
droidSpawnRateMultiplierTeamNeutral 1
droidGroupSizeMultiplierTeamZero 0
droidGroupSizeMultiplierTeamOne 0
droidGroupSizeMultiplierTeamNeutral 1
addBotsUpToTeamZero 0
addBotsUpToTeamOne 0
aiDifficultyStep 3
Version 1
droidSpawnRateMultiplierTeamZero 1
droidSpawnRateMultiplierTeamOne 1
droidSpawnRateMultiplierTeamNeutral 1
droidGroupSizeMultiplierTeamZero 1
droidGroupSizeMultiplierTeamOne 1
droidGroupSizeMultiplierTeamNeutral 1
addBotsUpToTeamZero 0
addBotsUpToTeamOne 0
aiDifficultyStep 3
// 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
});
@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';
@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)
*/