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
//! Useful wrappers around [common::hecs::World] | |
//! | |
use std::{any::TypeId, collections::HashMap, marker::PhantomData}; | |
use common::{ | |
anyhow, | |
hecs::{self, EntityBuilder, EntityRef, World}, | |
serde::{self, de::DeserializeOwned, Deserialize, Serialize}, | |
serde_json, | |
}; |
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
use hecs::{Component, ComponentError, ComponentRef, DynamicBundle, QueryBorrow, World}; | |
use std::{marker::PhantomData, ops::Deref, ptr::NonNull}; | |
/// Wrapper around [World] to conceal evil-doing. | |
#[derive(Default)] | |
pub struct ECS { | |
world: World, | |
} | |
impl ECS { |
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
{"v":"5.4.4","fr":30,"ip":0,"op":281,"w":1080,"h":1080,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 6","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":21,"s":[100],"e":[100]},{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":67,"s":[100],"e":[0]},{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.167],"y":[0]},"t":79,"s":[0],"e":[0]},{"t":81}],"ix":11,"x":"var $bm_rt;\n$bm_rt = loopOut('cycle', 0);"},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[460,561,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"d":1,"ty":"el","s":{"a":1,"k":[{"i":{"x":[0.667,0.667],"y":[1,1]},"o":{"x":[0.333,0.333],"y":[0,0]},"t":21,"s":[0,0],"e":[0,0]},{"i":{"x":[0.667,0.667],"y":[1,1]},"o":{"x":[0.333,0.333],"y":[0,0]},"t":51,"s":[0,0],"e":[20,20]},{"i":{"x":[0.667,0.667],"y":[1,1]},"o":{"x":[0.333,0.333],"y":[0,0]},"t":67,"s":[20,20],"e":[0,0]},{"t":81}],"ix":2,"x":"var $bm_rt;\n$bm_rt = loopOut('cycle', 0);"},"p": |
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
it('maps dispatch to props correctly', () => { | |
const DISPATCH_SPY = sinon.spy(); | |
// | |
const props = mapDispatchToProps(DISPATCH_SPY); | |
}); |
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
// Continued from the gist above.. | |
it('maps state to props correctly', () => { | |
const TEST_TODOS = [ | |
{ id: 0, text: 'Learn Redux' }, | |
{ id: 1, text: 'Learn TDD' }, | |
]; | |
const TEST_STATE = { todos: TEST_TODOS }; | |
// Here's how Redux's connect method will define the props for your component. |
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 from 'react'; | |
import { expect } from 'chai'; | |
import { shallow } from 'enzyme'; | |
import sinon from 'sinon'; | |
describe('<Todos />', () => { | |
it('renders the <TodosComponent /> correctly', () => { | |
const TEST_ONPRESS = sinon.spy(); | |
const TEST_TODOS = [ | |
{ id: 0, text: 'Learn Redux' }, |
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 from 'react'; | |
import TouchableOpacity from 'react-native'; | |
import { connect } from 'react-redux'; | |
export const mapStateToProps = (state) => { | |
todos: state.todos, | |
}; | |
export const mapDispatchToProps = (dispatch) => { | |
toggleTodo: (id) => dispatch({type: 'TOGGLE_TODO', id }), |
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
477 l | |
444 git | |
424 cd | |
402 vim | |
106 rails | |
58 rm | |
53 rake | |
46 fg | |
43 rc | |
42 java |
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
kane@Kanes-MacBook-Pro ⮀ ~ ⮀ ls -lah .vim/bundle | |
total 0 | |
drwxrwxrwx 11 kane staff 374B 7 May 09:57 . | |
drwxr-xr-x@ 8 kane staff 272B 20 Jun 16:11 .. | |
drwxrwxrwx 8 kane staff 272B 5 May 00:30 Conque-Shell | |
drwxrwxrwx 8 kane staff 272B 5 May 00:30 ctrlp.vim | |
drwxrwxrwx 10 kane staff 340B 5 May 00:31 syntastic | |
drwxrwxrwx 8 kane staff 272B 5 May 00:31 vim-colors-solarized | |
drwxrwxrwx 7 kane staff 238B 5 May 00:31 vim-fugitive | |
drwxrwxrwx 10 kane staff 340B 5 May 00:31 vim-less |
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
call pathogen#infect() | |
:set shiftwidth=2 | |
:set tabstop=2 | |
:set expandtab | |
:set smarttab | |
:set number | |
filetype plugin on | |
filetype plugin indent on |
NewerOlder