Skip to content

Instantly share code, notes, and snippets.

Avatar
🐢
hello world

Clint Ayres jurassix

🐢
hello world
View GitHub Profile
@jurassix
jurassix / React Inline Styles with responsive design.markdown
Last active Aug 29, 2015
React Inline Styles with responsive design
View React Inline Styles with responsive design.markdown
View redux-utils.js
export const contains = (list = [], test) => list.indexOf(test) >= 0;
export const removeItemAt = (list = [], index = 0) =>
[
...list.slice(0, index),
...list.slice(index + 1),
];
export const insertItemAt = (list = [], index = 0, item) =>
[
View joinArray.js
export const joinArray = (list = [], separator) =>
list.reduce((joinedList, item, index, {length}) => {
joinedList.push(item);
if (index < (length - 1)) {
joinedList.push(separator);
}
return joinedList;
}, []);
@jurassix
jurassix / abortable.js
Last active Apr 21, 2016 — forked from spudly/abortable.js
Abort your promises!
View abortable.js
const abortable = (func) => (...args) => {
let aborted = false;
const abort = () => { aborted = true; };
const promise = new Promise((resolve, reject) => {
const resolveIfNotAborted = resolution => {
if (aborted) {
reject(Error('promise aborted'));
}
@jurassix
jurassix / React Inline Styles with Media Query.markdown
Last active Nov 5, 2019
React Inline Styles with Media Query
View React Inline Styles with Media Query.markdown
View machine.js
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
You can’t perform that action at this time.