Skip to content

Instantly share code, notes, and snippets.

Ryan M Taylor ryanmtaylor

  • Boston, MA
Block or report user

Report or block ryanmtaylor

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
@rupertlssmith
rupertlssmith / GameState.elm
Last active Apr 1, 2020
Exploring State Machines with phantom types in Elm
View GameState.elm
module GameState
exposing
( Game(..)
, GameDefinition
, PlayState
, loading
, updateGameDefinition
, updatePlayState
, updateScore
, toReady
@mrcrowl
mrcrowl / basket.ts
Last active Jan 22, 2020
Example of using vuex-type to create strongly-typed vuex store access
View basket.ts
// path: store/basket/basket.ts (module)
import { RootState } from "../../store"
import inventory, { Product } from "../inventory/inventory"
export interface Item { productId: string, quantity: number }
export interface DisplayItem { product: Product, quantity: number }
export interface BasketState { items: Item[], isLoading: boolean }
const initialBasketState: BasketState = { items: [], isLoading: false }
@wonderful-panda
wonderful-panda / builder.ts
Last active Mar 18, 2018
vuex store builder (TypeScript >= 2.1 is required / namespaced module is not supported)
View builder.ts
// MIT License
import * as Vuex from "vuex";
/*
* Infrastructure types
*/
export type KV<K extends string, V> = { [_ in K]: V };
export type Payload<T, V> = { type: T } & V;
/*
@enriched
enriched / jsonSchemaInterface.ts
Last active Jun 21, 2019
TypeScript interface for Json-Schema V4
View jsonSchemaInterface.ts
/**
* MIT License
*
* Copyright (c) 2016 Richard Adams (https://github.com/enriched)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
@gre
gre / easing.js
Last active Apr 8, 2020
Simple Easing Functions in Javascript - see https://github.com/gre/bezier-easing
View easing.js
/*
* Easing Functions - inspired from http://gizma.com/easing/
* only considering the t value for the range [0, 1] => [0, 1]
*/
EasingFunctions = {
// no easing, no acceleration
linear: t => t,
// accelerating from zero velocity
easeInQuad: t => t*t,
// decelerating to zero velocity
You can’t perform that action at this time.