Skip to content

Instantly share code, notes, and snippets.

View jbinto's full-sized avatar

Jesse Buchanan jbinto

View GitHub Profile
@jbinto
jbinto / Foo.js
Created December 20, 2016 21:19
react-apollo stale variables when mixing pollInterval and skip
import React from 'react';
import gql from 'graphql-tag'
import { graphql } from 'react-apollo'
export const QUERY = gql`
query($fooID: Int!) { foo(id: $fooID) { id } }
`
const withFoo = graphql(QUERY, {
skip: ownProps => ownProps.active !== true,
@jbinto
jbinto / circle.yml
Created December 13, 2016 01:25 — forked from benjie/circle.yml
Getting PLv8 to run on Postgresql 9.5 on CircleCI (Ubuntu 14.04)
dependencies:
pre:
- sudo apt-get update
- sudo pip install pgxnclient
- sudo apt-get install libpq-dev libv8-dev postgresql-server-dev-9.5
- sudo pgxn install 'plv8=1.4.4'
# Just to be 100% certian you are using 9.5, and save a bit of memory.
- sudo service postgresql stop 9.4
- sudo service postgresql restart 9.5
@jbinto
jbinto / segfault_libgraphqlparser.md
Created July 27, 2016 18:15
segfault libgraphqlparser

https://github.com/Shopify/graphql-parser

Inside visit_variable_definition_name, pry breakpoint, ls node:

GraphQL::Parser::VariableDefinition#methods: default_value  type  variable

node.type or node.default_value will segfault the parser.

> reactjs-boilerplate@2.4.0 pretest /Users/jbinto/dev/react-boilerplate
> npm run lint
> reactjs-boilerplate@2.4.0 lint /Users/jbinto/dev/react-boilerplate
> npm run lint:js & npm run lint:css
> reactjs-boilerplate@2.4.0 lint:css /Users/jbinto/dev/react-boilerplate
@jbinto
jbinto / getTitleNative.js
Created January 13, 2016 07:32
Get title from remote HTML URL - without jQuery
// Only using native browser features (no jQuery).
// Uses `fetch`, `DOMParser` and `querySelectorAll`.
const getTitle = (url) => {
return fetch(`https://crossorigin.me/${url}`)
.then((response) => response.text())
.then((html) => {
const doc = new DOMParser().parseFromString(html, "text/html");
const title = doc.querySelectorAll('title')[0];
return title.innerText;
@jbinto
jbinto / getTitle.js
Created January 13, 2016 07:04
Get title of remote (HTML) URL via jQuery
const getTitle = (url, callback) => {
$.get(`https://crossorigin.me/${url}`, (data) => {
const html = $.parseHTML(data);
const bogus = $('<bogus>').append(html);
const title = bogus.find('title').text();
callback(title);
});
};
var urls = [
@jbinto
jbinto / istanbul-report.diff
Created January 9, 2016 01:59
Diff: istanbul initial report vs re-run report
--- coverage/lcov.info 2016-01-08 20:51:59.000000000 -0500
+++ coverage/rerun/lcov.info 2016-01-08 20:44:13.000000000 -0500
@@ -1,26 +1,29 @@
TN:
-SF:src/constants.js
+SF:/Users/jbinto/dev/thirtyone-server/src/constants.js
FNF:0
FNH:0
-DA:1,1
-LF:1
@jbinto
jbinto / index.jsx
Created November 28, 2015 22:15
Egghead tutorial - Getting Started with Redux - JSBin implementation
/* global ReactRedux, Redux, ReactDOM */
// "Getting Started with Redux" (by Dan Abramov)
// https://egghead.io/series/getting-started-with-redux
// This file on JSBin (by Jesse Buchanan):
// http://jsbin.com/wuwezo/74/edit?js,console,output
////////////////////////////////////////////////
//
@jbinto
jbinto / index.html
Created November 27, 2015 21:56 — forked from anonymous/index.html
JS Bin // source http://jsbin.com/wuwezo
<!DOCTYPE html>
<html>
<head>
<script src="https://fb.me/react-0.14.3.min.js"></script>
<script src="https://fb.me/react-dom-0.14.3.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/redux/3.0.4/redux.min.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
@jbinto
jbinto / cloudflare-migration.md
Last active July 27, 2018 10:29
Cloudflare migration

Migrating an SSL site to CloudFlare

Overview

jessebuchanan.ca has run on AWS CloudFront for the past year. Today I renewed the certificate, and while I waited for the manual approval, I wondered whether I could get CloudFlare running in "5 minutes" as advertised.

Signing up

I signed up for an account, and entered the jessebuchanan.ca domain.