Skip to content

Instantly share code, notes, and snippets.

View gist:9beacd50a0044f756efe
> 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 / getTitleNative.js
Created Jan 13, 2016
Get title from remote HTML URL - without jQuery
View getTitleNative.js
// Only using native browser features (no jQuery).
// Uses `fetch`, `DOMParser` and `querySelectorAll`.
const getTitle = (url) => {
return fetch(`${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 / getTitle.js
Created Jan 13, 2016
Get title of remote (HTML) URL via jQuery
View getTitle.js
const getTitle = (url, callback) => {
$.get(`${url}`, (data) => {
const html = $.parseHTML(data);
const bogus = $('<bogus>').append(html);
const title = bogus.find('title').text();
var urls = [
jbinto / istanbul-report.diff
Created Jan 9, 2016
Diff: istanbul initial report vs re-run report
View istanbul-report.diff
--- coverage/ 2016-01-08 20:51:59.000000000 -0500
+++ coverage/rerun/ 2016-01-08 20:44:13.000000000 -0500
@@ -1,26 +1,29 @@
jbinto / index.jsx
Created Nov 28, 2015
Egghead tutorial - Getting Started with Redux - JSBin implementation
View index.jsx
/* global ReactRedux, Redux, ReactDOM */
// "Getting Started with Redux" (by Dan Abramov)
// This file on JSBin (by Jesse Buchanan):
View index.html
<!DOCTYPE html>
<script src=""></script>
<script src=""></script>
<script src=""></script>
<meta charset="utf-8">
<title>JS Bin</title>
jbinto /
Last active Jul 27, 2018
Cloudflare migration

Migrating an SSL site to CloudFlare

Overview 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 domain.

jbinto /
Last active Feb 20, 2020
Upgrading SSL certificate on Cloudfront

Upgrading SSL certificate on Cloudfront

Last year I set up with an SSL certificate on Amazon S3 / CloudFront.

Now, it's time to renew the certificate.

The first time was fraught with peril, but I eventually got it working.

This time I will document the steps to renew the cert. Most steps for a new installation would be omitted.

jbinto /
Created May 5, 2015
Dealing with Ruby versions - chruby

Dealing with Ruby versions - chruby

Every time I sit down to code, it seems like a new Ruby version is available.

When I first learned ruby I used rvm on my Mac. In production on linux, I use rbenv, likely due to its Capistrano integration.

When I set up my current machine, I found rvm had fallen out of fashion in favour of something called chruby.

Install new ruby

jbinto /
Last active Aug 29, 2015
ansible, dopy, homebrew, python, pip, PYTHON_PATH madness
# situation:
# * Installed python+pip from homebrew.
# * Installed ansible from homebrew, then un/reinstalled with pip+git (requirements.txt)
# * Ansible cannot see `dopy` module installed via requirements.txt.
# solution:
# see
mkdir -p ~/Library/Python/2.7/lib/python/site-packages
echo '/usr/local/lib/python2.7/site-packages' > ~/Library/Python/2.7/lib/python/site-packages/homebrew.pth