Skip to content

Instantly share code, notes, and snippets.

View f0urfingeredfish's full-sized avatar

Nick Kircos f0urfingeredfish

View GitHub Profile
import React, { Component } from 'react'
import PropTypes from 'prop-types'
export const templateConcat = (strings, expressions) =>
strings.reduce((prevValue, currentValue, index) => {
const expressionValue = expressions[index]
if (expressionValue) {
return `${prevValue}${currentValue}${expressionValue}`
}
return `${prevValue}${currentValue}`
@f0urfingeredfish
f0urfingeredfish / gist:0d7c9a45a230a0c3ab26
Created September 12, 2014 18:16
pre-commit media concat hook
#!/bin/sh
#
# An example hook script to verify what is about to be committed.
# Called by "git commit" with no arguments. The hook should
# exit with non-zero status after issuing an appropriate message if
# it wants to stop the commit.
#
# To enable this hook, rename this file to "pre-commit".
if git rev-parse --verify HEAD >/dev/null 2>&1
"{"components":[{"order":0,"type":"cover","text":"sadfasdf","artwork":{"name":"Hostage","artist":"PaulMcDougall","url":"/PaulMcDougall/artwork/hostage-2/","tags":["carrot","creature","creatures","guard","guards","hostage","kidnap","paulmcdougall","prisoner","rabbit","rabbits","spears","vegetable","vegetablenap"],"id":"5ea25b4a-9931-4458-80d9-407fd48a5ae5","colors":["#609c00","#a84824","#6c6c6c","#cccccc","#000000","#c0a86c"],"formats":{"portrait":{"url":"http://dev-storybird.s3.amazonaws.com:80/artwork/PaulMcDougall/portrait/hostage-2.jpeg","width":386,"height":522},"full":{"url":"http://dev-storybird.s3.amazonaws.com:80/artwork/PaulMcDougall/full/hostage-2.jpeg","width":835,"height":522},"square":{"url":"http://dev-storybird.s3.amazonaws.com:80/artwork/PaulMcDougall/square/hostage-2.jpeg","width":551,"height":522},"landscape":{"url":"http://dev-storybird.s3.amazonaws.com:80/artwork/PaulMcDougall/landscape/hostage-2.jpeg","width":835,"height":393}},"thumbnail":{"url":"http://dev-storybird.s3.amazonaws.com:80/
{
//(String)UID of the chapter
"id":"g9ks32xhd9",
//(String)UID of the book
"book_slug":"this-is-my-book",
//(String) URL of chapter
"url":"",
//(Object) contains info about the author
"author":{
"url":"http://dev3.storybird.com/members/nick/",
.book {
display: inline-block;
margin: 10px;
}
.book img {
vertical-align: middle;
}
.books {
@f0urfingeredfish
f0urfingeredfish / modernizr.tests.plaintextonly.js
Last active December 18, 2015 12:58
Modernizr.plaintextOnly test for <div contentEditable="plaintext-only">. Currently only works in webkit. see http://stackoverflow.com/questions/10672081/how-to-detect-if-browsr-supports-plaintext-only-value-in-contenteditable-para for more details.
//source
//http://stackoverflow.com/questions/10672081/how-to-detect-if-browser-supports-plaintext-only-value-in-contenteditable-para
Modernizr.addTest('plaintextonly', function(){
var d = document.createElement("div");
try {
d.contentEditable="PLAINtext-onLY";
} catch(e) {
return false;
}
return d.contentEditable=="plaintext-only";