Skip to content

Instantly share code, notes, and snippets.

@jamesperi
jamesperi / init-apollo
Last active April 30, 2019 15:47
init-apollo with apollo-upload-client@10.0.0 in place of HttpLink
import { ApolloClient, InMemoryCache, HttpLink } from 'apollo-boost'
import { createUploadLink } from 'apollo-upload-client'
import fetch from 'isomorphic-unfetch'
let apolloClient = null
function create(initialState) {
// Check out https://github.com/zeit/next.js/pull/4611 if you want to use the AWSAppSyncClient
return new ApolloClient({
connectToDevTools: process.browser,
@jamesperi
jamesperi / parser-for-an-sql-replace-into-string.markdown
Last active March 20, 2019 16:07
parser for an SQL REPLACE INTO string

parser for an SQL REPLACE INTO string

Needed to get keys and values into a pair of arrays for some sanitation of row data.

A Pen by Jim on CodePen.

License.

@jamesperi
jamesperi / javascript-test-2.markdown
Last active March 12, 2019 14:12
Javascript Test #2
@jamesperi
jamesperi / find-users-books.markdown
Last active April 3, 2019 16:04
Create Book Query
import {
concat
, get
, includes
, isArray
, isBoolean
, isPlainObject
, isString
, keys
, map
@jamesperi
jamesperi / snippet.txt
Created August 2, 2013 19:38
HTML: doc template
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8>
<title></title>
</head>
<body>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.0.js">
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8>
<title></title>
</head>
<body>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.0.js">