Moved to https://github.com/kbilsted/Functional-core-imperative-shell/blob/master/README.md
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 android.content.res.Resources; | |
import android.support.v7.widget.RecyclerView; | |
import android.view.View; | |
import org.hamcrest.Description; | |
import org.hamcrest.Matcher; | |
import org.hamcrest.TypeSafeMatcher; | |
/** | |
* Created by bapspatil | |
*/ |
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.exports = function (wallaby) { | |
return { | |
files: [ | |
{pattern: 'src/**/*.js'}, | |
{pattern: 'src/**/*.jsx'}, | |
{pattern: 'src/**/*.spec.js', ignore: true}, | |
{pattern: 'src/**/*.json', instrument: false} | |
], | |
tests: [ |
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 { jsdom } from 'jsdom'; | |
import chai from 'chai'; | |
import chaiEnzyme from 'chai-enzyme'; | |
import { shallow, mount, render } from 'enzyme'; | |
chai.use(chaiEnzyme()); | |
global.should = chai.should(); | |
global.shallow = shallow; |
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 Html exposing (text) | |
import List | |
{- Challenge: flatten an array of arbitrarily nested arrays of integers into a flat array of integers. e.g. [[1,2,[3]],4] -> [1,2,3,4]. | |
(This is a little tricky in Elm because the type system does not allow for lists with different element types. So we have to make a whole new data structure...) | |
-} | |
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
/* | |
Tools: mocha, chai-enzyme, jsdom, airbnb enzyme | |
Using WebStorm test runner and WebStorm to write code. | |
For the prod code, using Flow for type checking | |
These are isolated unit tests (not integration) that test behavior for particular React components | |
A big reason why I like React.js vs Vue, Angular, or other types of frameworks or | |
libraries is the simplicity at which you can test behavior. Also there's no magic going on here in terms of |
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
/* | |
This list will be continually updated with new templates. | |
If you have requests for any, please add a comment using the comment box at the bottom of this page. | |
NOTE: the comments are just to facilitate reading this gist, don't include those in your IntelliJ Live Templates. | |
some comments are just suggested template abbreviations for the live templates once you add them to your IDE | |
OSX templates file location examples: |
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
public class LoadingView extends RelativeLayout { | |
public LoadingView(Context context) { | |
super(context); | |
} | |
public LoadingView(Context context, AttributeSet attrs) { | |
super(context, attrs); | |
} | |
public LoadingView(Context context, AttributeSet attrs, int defStyle) { |
Javascript is a programming language with a peculiar twist. Its event driven model means that nothing blocks and everything runs concurrently. This is not to be confused with the same type of concurrency as running in parallel on multiple cores. Javascript is single threaded so each program runs on a single core yet every line of code executes without waiting for anything to return. This sounds weird but it's true. If you want to have any type of sequential ordering you can use events, callbacks, or as of late promises.
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 { take, put, call, fork, cancel, cancelled } from 'redux-saga/effects' | |
import {EVENT_POLLING_START, EVENT_POLLING_STOP} from "constants/eventPolls"; | |
import {ClientEventType} from "constants/serverEvents"; | |
function* handleEventA(serverEvent) { | |
yield put({type : serverEvent.type, payload : {name : serverEvent.eventAData}}); | |
} |