Skip to content

Instantly share code, notes, and snippets.


Nick Taylor nickytonline

Block or report user

Report or block nickytonline

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
nickytonline /
Created Oct 19, 2019
DEV Moderation Canned Responses
nickytonline / mini-expect.js
Last active Jul 20, 2019
Recreated a portion of the expect library
View mini-expect.js
function expect(actual) {
function prettyJSON(objectToSerialize) {
return JSON.stringify(objectToSerialize, null, '\t')
return {
toBe(expected) {
if (actual === expected) {
console.log('✅ Pass')
} else {
nickytonline / object-entries-polyfills.js
Last active Jul 15, 2019
Having fun recreating some lodash functionality and polyfills
View object-entries-polyfills.js
// Just having fun creating some polyfills.
* A polyfill for Object.prototype.entries.
* @returns {[string, any][]} An array of tuples where each tuple is a key/value pair.
Object.prototype.entries = Object.prototype.entries || function() {
const obj = this;
nickytonline / createElement.js
Last active Jul 11, 2019
A Handy DOM element creation function.
View createElement.js
// Inspired from Sam Thorogood's article,
function createElement(nodeName, props) {
const { style = {}, ...propsNoStyle } = props;
const element = Object.assign(document.createElement(nodeName), propsNoStyle);
Object.entries(style).forEach(([key, value]) => {[key] = value; });
return element;
nickytonline / paste.js
Last active Jan 27, 2020
Simulate a paste event in Cypress
View paste.js
* Simulates a paste event.
* @param pasteOptions Set of options for a simulated paste event.
* @param pasteOptions.destinationSelector Selector representing the DOM element that the paste event should be dispatched to.
* @param pasteOptions.pastePayload Simulated data that is on the clipboard.
* @param pasteOptions.pasteFormat The format of the simulated paste payload. Default value is 'text'.
function paste({ destinationSelector, pastePayload, pasteType = 'text' }) {
nickytonline / webpack.config.js
Last active Dec 2, 2019
@babel/preset-env not transpiling to ES5
View webpack.config.js
module.exports = {
entry: {
acme_co_es5: [
resolve: {
extensions: [".js", ".jsx"]
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 Mar 14, 2020
Mac Setup Scripts
# More Mac setup at
# Log file
timestamp=$(date +%s)
# if true is passed in, things will reinstall
nickytonline /
Last active Dec 26, 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

You can’t perform that action at this time.