Skip to content

Instantly share code, notes, and snippets.

View alisonailea's full-sized avatar

Ali Stump alisonailea

View GitHub Profile
@alisonailea
alisonailea / fav-extensions
Created December 3, 2019 19:02
Favorite VSCode Extensions
EditorConfig for VSCode
ESLint
GitLens
InlineHtml
IntelliSnese for CSS Classnames in HTML
JSON
JSON Pretty Printer
Live Share
Markdownlint
npm intellisense
@alisonailea
alisonailea / launch.json
Last active February 5, 2020 18:09
VSCode Debugger - Ava Tests
{
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Debug AVA test file",
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/ava",
"runtimeArgs": [
"debug",
"--config",
@alisonailea
alisonailea / launch.json
Created November 27, 2019 19:20
VSCode Debugger - Launch NPM Script
{
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch via NPM",
"runtimeExecutable": "npm",
"cwd": "${workspaceFolder}",
"console": "integratedTerminal",
"runtimeArgs": [
@alisonailea
alisonailea / launch.json
Last active March 18, 2020 18:52
VSCode Debugger - Gulp
{
"configurations": [
{
"name": "Gulp Debugger",
"type": "node",
"request": "launch",
"program": "${workspaceRoot}/node_modules/gulp/bin/gulp.js",
"stopOnEntry": false,
"args": ["-f", "${workspaceFolder}/${file}"],
"cwd": "${workspaceRoot}",
@alisonailea
alisonailea / launch.json
Last active November 27, 2019 19:04
VSCode Debugger - Jest Current File
{
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Jest Current File",
"program": "${workspaceFolder}/node_modules/.bin/jest",
"args": [
"${workspaceFolder}/**/*.test.js",
"${fileBasenameNoExtension}",
@alisonailea
alisonailea / launch.json
Created November 27, 2019 19:00
VSCode Debugger - Jest All
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Jest All",
"program": "${workspaceFolder}/node_modules/.bin/jest",
"args": [],
"console": "integratedTerminal",
@alisonailea
alisonailea / checkPublishedPackage.js
Last active March 24, 2019 02:30
Check publish output of a package in the monorepo
// add "check": "node ./scripts/checkPublishedPackage" to the "scripts" in your package.json
const { exec } = require('child_process');
const chalk = require('chalk');
const packageName = process.argv[2];
if (!packageName) {
console.error(chalk.red.bold('You must provide a valid package name'));
console.log(chalk.grey('Example:'), '`npm run check core-package`');
}
@alisonailea
alisonailea / logger.js
Created March 23, 2019 22:58
Logger with Winston
const { createLogger, format, transports } = require('winston');
const { colorize, combine, simple } = format;
const types = {
console: new transports.Console({
level: 'debug',
format: combine(
colorize({ colors: { debug: 'yellow', error: 'red', info: 'blue' } }),
simple()
@alisonailea
alisonailea / gist:ddb3778df7a935cc1fd0c5bacbb6d902
Created April 27, 2018 22:56
CodeChallenge: Reversed Strings
/*
* Due to an API bug we are getting reversed text
* Write a function that takes an array of reversed strings and returns an array of unreversed strings.
*/
const reversedStrings = ["selciheV cirtcelE muimerP", "ssenisuB ro emoH ruoy rewoP ylbaniatsuS"];
function fixReversedStrings(strings) {
const newArray=[];
@alisonailea
alisonailea / removeLargest.js
Last active April 27, 2018 22:56
CodeChallenge: Return a copy of the provided array with the the largest item removed.
// Return a copy of the provided array with the the largest item removed.
// I think this is the most performant way to do this.
const removeLargest = (items) => {
const newArray = [...items];
newArray.sort((a, b) => a-b)
newArray.pop();
return newArray;
}