Skip to content

Instantly share code, notes, and snippets.

@bryanrsmith
bryanrsmith / userstyle.css
Last active Nov 8, 2018 — forked from jessedobbelaere/userstyle.css
Flowdock Classic (<May 2017) theme
View userstyle.css
/**
* On 2017-05-30, Flowdock did some UI changes. This is an attempt to ease the pain.
* For the desktop app: Save this file as userstyle.css and put it inside ~/Library/Application Support/Flowdock/, then hit CMD+R to reload Flowdock.
* For flowdock.com: Install the stylebot extension and copy this CSS into the config for flowdock.com.
*
* Forked from:
* https://gist.github.com/jessedobbelaere/95c02699b2e0acd35762d204797b74f9
* @author Jesse Dobbelaere (@JesseDobbelaere)
*/
@bryanrsmith
bryanrsmith / _error.js
Last active Jun 25, 2021
Next.js custom error handler that doesn't display for errors encountered on initial client render
View _error.js
import React, { PropTypes } from 'react';
import Head from 'next/head';
import Router from 'next/router';
// Script errors occuring during initial client render can cause the server-rendered
// content to be hidden by an error page. Track router events to determine if the
// error being handled happened during initial render, and throw within
// getInitialProps to allow the server-rendered content to remain visible.
const isClient = typeof window !== 'undefined';
let isInitialClientRender = isClient;
@bryanrsmith
bryanrsmith / app.html
Created Jan 13, 2017 — forked from jdanyow/app.html
Aurelia Gist
View app.html
<template>
<h1>${message}</h1>
</template>
@bryanrsmith
bryanrsmith / .eslintrc
Last active Jun 17, 2018
eslint config
View .eslintrc
{
"parser": "babel-eslint",
"env": {
"browser": true
},
"ecmaFeatures": {
"arrowFunctions": true,
"blockBindings": true,
"classes": true,
"defaultParams": true,
@bryanrsmith
bryanrsmith / README.md
Last active Apr 8, 2019
aurelia-fetch-client documentation
View README.md

aurelia-fetch-client

An HTTP client based on the Fetch API. The project aims to embrace and expose the new Fetch API, while providing features important in web applications: default configuration of request parameters, interceptors, and centralized request tracking.

Bring Your Own Polyfill

This library relies on the Fetch API, which is not yet supported by all popular browsers. This library does not include a polyfill for Fetch. If you need to support browsers that haven't implemented Fetch, you will need to install a polyfill like GitHub's Fetch polyfill

@bryanrsmith
bryanrsmith / fetch-client.js
Last active Apr 12, 2020
A thin wrapper library around the fetch API to provide application-wide HTTP client configuration
View fetch-client.js
export class HttpClient {
constructor(defaults) {
this.defaults = defaults;
this.interceptors = [];
this.activeRequestCount = 0;
this.isRequesting = false;
}
addInterceptor(interceptor) {
this.interceptors.push(interceptor);