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
import React, { useState } from 'react'; | |
/* | |
It's common to be in a situation where your react component renders a bunch of children, | |
and only one of those children rely on some state your component keeps. You don't want | |
to re-render ALL of your children just because you need to keep some state relevant to | |
only one of them, so the natural refactoring is to localize that state to the one child. | |
But... what if your parent (or one of the other children) is actually responsible for | |
*setting* that state, or maybe you just have a couple of disparate components that use | |
that state, while most of them don't touch it? |
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
File "/venv/local/lib/python2.7/site-packages/structlog/_base.py", line 192, in _proxy_to_logger | |
return getattr(self._logger, method_name)(*args, **kw) | |
File "/venv/local/lib/python2.7/site-packages/structlog/_loggers.py", line 76, in msg | |
until_not_interrupted(self._write, message + "\n") | |
File "/venv/local/lib/python2.7/site-packages/structlog/_utils.py", line 24, in until_not_interrupted | |
return f(*args, **kw) | |
File "/venv/local/lib/python2.7/site-packages/colorama/ansitowin32.py", line 41, in write | |
self.__convertor.write(text) | |
File "/venv/local/lib/python2.7/site-packages/colorama/ansitowin32.py", line 154, in write | |
self.write_and_convert(text) |
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
Mismatch at tests/source\file-lines-6.rs:8: | |
fn bar() {⏎ | |
// test⏎ | |
let i = 12;⏎ | |
+⏎ | |
// test⏎ | |
}⏎ | |
⏎ |
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
ERROR in ./src/typescript/PlayerView.tsx | |
(22,10): error TS2322: Type '{ children: Element[]; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<TabbedView> & Readonly<{ children?: ReactNode; }> ...'. | |
Type '{ children: Element[]; }' is not assignable to type 'Readonly<TabbedViewProps>'. | |
Types of property 'children' are incompatible. | |
Type 'Element[]' is not assignable to type 'ComponentElement<any, Tab>[]'. | |
Type 'Element' is not assignable to type 'ComponentElement<any, Tab>'. | |
Types of property 'type' are incompatible. | |
Type 'string | ComponentClass<any> | StatelessComponent<any>' is not assignable to type 'ComponentClass<any>'. | |
Type 'string' is not assignable to type 'ComponentClass<any>'. |
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
let scene = this.props.currentScene; | |
let sceneButton; | |
if (scene && players[pid].scene !== scene) { | |
sceneButton = <button onClick={() => {this.props.onAddToScene(pid, scene)}}>Add to scene</button>; | |
} else { | |
sceneButton = <button onClick={() => this.props.onRemoveFromScene(pid)}>Remove</button>; | |
} |
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 ElmBug exposing (..) | |
import Json.Decode as JD | |
import Json.Helpers as JH | |
import Dict | |
sumDecoder : String -> List (String, a) -> List (String, JD.Decoder a) -> JD.Decoder a | |
sumDecoder name nullaryList singleFieldList = JD.oneOf | |
[ JH.decodeSumUnaries name |
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
impl<A> Creature<A> { | |
pub fn into_vari(self) -> CreatureVari { | |
if self.can_act() { | |
CreatureVari::Able(Creature::<Able> { | |
name: self.name, | |
pos: self.pos, | |
conditions: self.conditions, | |
abilities: self.abilities, | |
cur_energy: self.cur_energy, | |
cur_health: self.cur_health, |
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
{-# LANGUAGE TupleSections #-} | |
import Control.Monad (when, foldM_, forM) | |
import Data.Functor | |
import Data.List | |
import Data.Ord (comparing) | |
import Development.Shake | |
import Development.Shake.FilePath | |
import qualified System.Directory as Dir | |
import System.Posix.Files (touchFile) |
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
""" | |
A microwrapper for Flask that gives you a pure-functional API. | |
- Request objects are passed to your handlers, instead of relying on the global | |
``flask.request``. | |
- Route handlers can return Effect objects (see https://effect.readthedocs.org/), | |
so you can represent your side-effects as pure values. | |
""" | |
from functools import wraps |
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
<?xml version='1.0' encoding='UTF-8'?><feed xmlns="http://www.w3.org/2005/Atom"><link rel="next" href="https://dfw.loadbalancers.api.rackspacecloud.com/v1.0/756004/loadbalancers/493411/nodes/1007563.atom?page=2" /><title type="text">Node Feed</title><id>756004-loadbalancers-493411-nodes-1007563</id><author><name>Rackspace Cloud</name></author><entry><title type="text">Node Successfully Updated</title><summary type="text">Node successfully updated with address: '10.181.30.33', port: '80', weight: '1', condition: 'DRAINING'</summary><author><name>radix192;q=1.0</name></author><link href="https://dfw.loadbalancers.api.rackspacecloud.com/v1.0/756004/loadbalancers/493411/nodes/1007563" /><id>756004-loadbalancers-493411-nodes-1007563-2015280343480</id><category term="UPDATE" /><updated>2015-10-07T03:43:48.000Z</updated></entry><entry><title type="text">Node Successfully Created</title><summary type="text">Node successfully created with address: '10.181.30.33', port: '80', condition: 'ENABLED', weight: '1'</summary> |
NewerOlder