Skip to content

Instantly share code, notes, and snippets.

Nick Taylor nickytonline

View GitHub Profile
nickytonline / snippets.js
Created Sep 16, 2018
Chrome Extension Snippets
View snippets.js
function getActiveTab() {
return new Promise((resolve, reject) => {
chrome.tabs.query({ active: true, currentWindow: true }, function (tabs) {
const activeTab = tabs.find(t =>;
nickytonline / preview-head.html
Created Jul 11, 2018
Grid Points Background for Storybook
View preview-head.html
body {
background-image: linear-gradient(transparent 0px, transparent 1px, rgb(255, 255, 255) 1px, rgb(255, 255, 255) 20px), linear-gradient(to right, rgb(54, 69, 79) 0px, rgb(54, 69, 79) 1px, rgb(255, 255, 255) 1px, rgb(255, 255, 255) 20px);
background-position: 1.1875rem;
background-size: 1.25rem 1.25rem;
background-attachment: fixed;
nickytonline /
Last active Apr 10, 2019
Mac Setup Scripts
# More Mac setup at
# Log file
timestamp=$(date +%s)
# if true is passed in, things will reinstall
nickytonline /
Last active Feb 10, 2019
Customizing VS Code for Two Fonts.

Customizing VS Code

I followed the instructions in this blog post Multiple Fonts: Alternative to Operator Mono in VSCode, but did not see any changes made to VS Code. After digging a bit, I discovered that all the CSS class names had changed. They’re now e.g. .mtk13, .mtk16 { … }.


  • Ensure it’s a file URL e.g. { "vscode_custom_css.imports": [ "file:///Users/Brian/Desktop/vscode-style.css" ] }
  • If you move the location of your file and update your user settings with the new location, you will need to disable and enable custom CSS cmd+shift+p.
  • Also, anytime you change the style in your custom CSS file, you need to disable, then re-enable the extension.

For reference

View for-chris.ts
interface Association<TKey, TValue> {
key: TKey;
info: TValue;
interface StringKeyInfo {
keyIndexes: Array<Association<string, number>>;
keyIsSet: Array<Association<string, boolean>>;
nickytonline / async-await-promise-all.js
Last active Aug 12, 2018
async/await with Promise.all
View async-await-promise-all.js
// In response to
function doubleAfter2Seconds(x) {
return new Promise(resolve => {
resolve(x * 2);
}, 2000);
async function addAsync(x) {
const { a, b, c } = await Promise.all([
View hoc-cdc-tests.js
import test from 'ava';
import React from 'react';
import { shallow } from 'enzyme';
import CaptureError from '../CaptureError';
const render = ({
environment = 'development',
}) => {
nickytonline / hoc-cdc.jsx
Created Oct 29, 2017
HOC with componentDidCatch
View hoc-cdc.jsx
import React, { Component } from 'react';
import Sentry from '../services/sentry';
import DevError from '../components/DevError';
const DEV_ENV = 'development';
const CaptureError = ({
environment = process.env.NODE_ENV,
nickytonline /
Last active Mar 21, 2019
Tools/Programs for devs on MacOS
  • Homebrew, run /usr/bin/ruby -e "$(curl -fsSL" from the command line to install it.
  • Homebrew Cask, run brew tap caskroom/cask from the command line to install it.
  • Alfred, buy the powerpack to get the full use of it.
  • Spectacle
  • Fish shell
  • VLC
  • Unarchiver
  • f.lux
  • n, run brew install n from the command line to install it.
  • Fisherman, run curl -Lo ~/.config/fish/functions/ --create-dirs from the command line to install it.
nickytonline / async-awaitable-dom-event-handler.js
Last active Sep 7, 2017
async/await"able DOM event handlers
View async-awaitable-dom-event-handler.js
// async/await"able" DOM event handlers
async function getMeSomeData() {
// ...
return data
document.addEventListener('DOMContentLoaded', async () => {
const someContainer = document.getElementById('someContainer');
You can’t perform that action at this time.