Skip to content

Instantly share code, notes, and snippets.

@jmreidy
jmreidy / machine.js
Created April 29, 2020 15:33
Generated by XState Viz: https://xstate.js.org/viz
const wordMachine = Machine({
id: 'word',
type: 'parallel',
states: {
bold: {
initial: 'off',
states: {
on: {
on: { TOGGLE_BOLD: 'off' }
},
import { Inject, Injectable, OpaqueToken } from 'angular2/core';
import * as Firebase from 'firebase';
import { IConfig } from '../lib/config';
export interface IFirebaseService {
ref: Firebase;
}
export const IFirebaseService = new OpaqueToken('FirebaseService');
import {Action} from '../actions/actionTypes';
import {isMatch} from 'lodash';
interface actionHandler {
(action:Action, state:any):Object;
}
export class ActionMatcher {
tests:Array<(action:Action) => boolean>;
handler:actionHandler;
/* eslint-env node, mocha */
import expect, { createSpy } from 'expect';
import { createStore } from 'redux';
import LoginScreen, { Component as LoginScreenComponent } from '../../src/containers/screens/LoginScreen';
import * as loginActions from '../../src/actions/loginActions';
describe('LoginScreen', () => {
//regular component tests
});
@jmreidy
jmreidy / test_mocha.opts
Last active January 9, 2018 11:49
Unit test React Native with Mocha
--compilers js:./test/support/compiler
--require ./test/support/init
@jmreidy
jmreidy / clj_project-name.server
Last active August 29, 2015 14:14
CLJS setup
(ns project-name.server
(:require [clojure.java.io :as io]
[project-name.dev :refer [is-dev? inject-devmode-html]]
[compojure.core :refer [GET defroutes]]
[compojure.route :refer [resources]]
[compojure.handler :refer [api]]
[net.cgrand.enlive-html :refer [deftemplate]]
[net.cgrand.reload :refer [auto-reload]]
[ring.middleware.reload :as reload]
[environ.core :refer [env]]

Keybase proof

I hereby claim:

  • I am jmreidy on github.
  • I am jmreidy (https://keybase.io/jmreidy) on keybase.
  • I have a public key whose fingerprint is ED1A 1514 8E5B 44E6 1E75 9DA4 8EDF E67C F7C6 1648

To claim this, I am signing this object:

@jmreidy
jmreidy / HistoryStore.js
Created May 23, 2014 22:58
A Flux store built on ImmutableFluxStore
/** @jsx React.DOM */
var director = require('director');
var Dispatcher = require('../Dispatcher');
var HistoryConstants = require('../constants/HistoryConstants');
var ImmutableFluxStore = require('ImmutableFluxStore');
var _initializeRouter = function (store) {
return director.Router({
'/admin/login': function () {
store.set('page', 'LoginPage');
@jmreidy
jmreidy / context.js
Created May 15, 2014 16:14
An example of DI with Node and Angular's "DI" system
var context = require('voltron-di');
context
.indexModule("Controllers", "server/controllers", {
dependencies: ["Core", "Services"],
type: "factory"
})
.indexModule("DAOs", "server/daos", {
dependencies: ["Core"],
type: "service"
})

Keybase proof

I hereby claim:

  • I am jmreidy on github.
  • I am jmreidy (https://keybase.io/jmreidy) on keybase.
  • I have a public key whose fingerprint is CA57 B19B 71A2 49BF 3E53 7D5A 931C A1DE F75C 80A1

To claim this, I am signing this object: