Skip to content

Instantly share code, notes, and snippets.

:shipit:
Gettin' shit done

Kane Rogers kanerogers

:shipit:
Gettin' shit done
Block or report user

Report or block kanerogers

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View mapDispatchToProps
it('maps dispatch to props correctly', () => {
const DISPATCH_SPY = sinon.spy();
//
const props = mapDispatchToProps(DISPATCH_SPY);
});
View mapStateToProps
// 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.
View gist:a3e22a01b2844cf1034cf47d073e889e
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' },
View Test mapToStateToProps
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 }),
@kanerogers
kanerogers / gist:5855744
Created Jun 25, 2013
history | awk '{a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | head
View gist:5855744
477 l
444 git
424 cd
402 vim
106 rails
58 rm
53 rake
46 fg
43 rc
42 java
View Vim Plugins
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
View vimrc
call pathogen#infect()
:set shiftwidth=2
:set tabstop=2
:set expandtab
:set smarttab
:set number
filetype plugin on
filetype plugin indent on
View SimpleCalc.java
public class GenericSimpleCalcFactoryFactory {
class SimpleCalcFactory {
class SimpleCalc {
double number = Integer.parseInt(args[0]);
if (number < 0){
System.out.println(Math.pow(number, 2) + (number/2));
return;
}
@kanerogers
kanerogers / fibbonaci.io
Created Oct 25, 2012
Fibbonaci sequence finder in Io
View fibbonaci.io
main := Object clone
main fb := method(num,
i := 1
last := 0
fib := 0
current := 0
i println
while(fib != num,
fib = fib + 1
You can’t perform that action at this time.