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
{ | |
"Right Option Key Sends" : 0, | |
"Tags" : [ | |
], | |
"Ansi 12 Color" : { | |
"Red Component" : 0.1268280595541, | |
"Color Space" : "Calibrated", | |
"Blue Component" : 0.998526930809021, | |
"Alpha Component" : 1, |
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 { Middleware } from 'redux'; | |
export interface IActionLifecycle { | |
resolveType: string; | |
rejectType: string; | |
} | |
/** | |
* Middleware which allows to chain async actions as Promises. | |
* @see https://github.com/redux-observable/redux-observable/issues/90 |
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
function copyStyles(sourceDoc, targetDoc) { | |
Array.from(sourceDoc.styleSheets).forEach(styleSheet => { | |
if (styleSheet.cssRules) { // for <style> elements | |
const newStyleEl = sourceDoc.createElement('style'); | |
Array.from(styleSheet.cssRules).forEach(cssRule => { | |
// write the text of each rule into the body of the style element | |
newStyleEl.appendChild(sourceDoc.createTextNode(cssRule.cssText)); | |
}); |
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
export function animateScrollTop(element: HTMLElement, value: number, timing: number) { | |
let start: number = null; | |
let animationToken: number; | |
const valueSign = value >= 0 ? 1 : -1; | |
const currentScroll = element.scrollTop; | |
const step = (timestamp: number) => { | |
if (!start) { | |
start = timestamp; | |
} |
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
/** | |
* Determine the intersection point of two line segments, but considering also | |
* colinear segments as intersection | |
* @see {@link http://paulbourke.net/geometry/pointlineplane/} | |
*/ | |
function intersect( | |
x1, y1, x2, y2, | |
x3, y3, x4, y4 | |
) { |
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
/** | |
* Determine the intersection of a segment, having ad edge in the center of circle, | |
* with the circle itself | |
*/ | |
function intersect( | |
xc: number, | |
yc: number, | |
radius: number, | |
x1: number, | |
y1: number |
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
/** | |
* TS porting of https://stackoverflow.com/questions/20453545/how-to-find-the-nearest-point-in-the-perimeter-of-a-rectangle-to-a-given-point | |
*/ | |
function clamp(x: number, lower: number, upper: number): number { | |
return Math.max(lower, Math.min(upper, x)); | |
} | |
export function getNearestPointInPerimeter( | |
l: number, |
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 { IAction } from '../types/redux.types'; | |
import { actionTypes as errorTypes, showError } from './errors.actions'; | |
interface IPayloadCreators { | |
request(...args: any[]): any; | |
success(...args: any[]): any; | |
failure?(errorMsg: string): any; | |
} | |
interface IActionCreator { |
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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
OlderNewer