Skip to content

Instantly share code, notes, and snippets.

@SherryH
SherryH / search-yaml-packages.js
Last active July 10, 2023 11:56
A script for finding all parents and ancestors of the given package. Used for finding the repos consuming outdated packages to assess risks of migration
const yaml = require('js-yaml');
const fsPromise = require('fs/promises');
const fs = require('fs');
const { AsyncParser } = require('json2csv');
console.log('running script...');
// stream is good for reading a large file. maybe next time
async function openFile(fileName) {
let data;
@SherryH
SherryH / tabs.tsx
Created December 6, 2021 15:15
Tabs Types rabbit hole
import type { FC, ReactComponentElement, ReactNode } from 'react';
import React, { Children } from 'react';
import { Colors, space } from '@smartly/tokens';
import type { FlexBoxProps } from '@smartly/container';
import { Direction, FlexBox } from '@smartly/container';
import styled, { css } from 'styled-components';
import { useKeyboardFocus } from '@smartly/ui-hooks';
import type {
TabsContextType,
HorizontalPosition,

FWIW: I'm not the author of the content presented here (which is an outline from Edmond Lau's book). I've just copy-pasted it from somewhere over the Internet, but I cannot remember what exactly the original source is. I was also not able to find the author's name, so I cannot give him/her the proper credits.


Effective Engineer - Notes

What's an Effective Engineer?

Frontend Masters: AWS for Frontend Engineers

You should have the following completed on your computer before the workshop:

  • Install the AWS CLI.
  • Have Node.js installed on your system. (Recommended: Use nvm.)
    • Install yarn with brew install yarn.
  • Create an AWS account. (This will require a valid credit card.)
  • Create a Travis CI account. (This should be as simple as logging in via GitHub).
@SherryH
SherryH / create-react-template.sh
Created December 26, 2018 05:25
A script for creating react projects from existing templates
#!/bin/sh
# bash ./create-react-template.sh ../test1 test-project "TEST HTML"
# $0= Absolute path to this script, e.g. /home/user/bin/foo.sh
# Absolute path this script is in, thus /home/user/bin
SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"
PROJECT_NAME=$1
TITLE=$2
DEST_DIR=$3
// composing functions using reduce
function increment(input) { return input + 1;}
function decrement(input) { return input - 1; }
function double(input) { return input * 2; }
function halve(input) { return input / 2; }
var initial_value = 1;
var pipeline = [
increment,
const extractSCSS = new ExtractTextPlugin({
filename: 'stylesheets/main.css',
disable: IS_DEV,
allChunks: true
});
const extractCSS = new ExtractTextPlugin({
filename: 'stylesheets/vendor.css',
disable: IS_DEV,
allChunks: true
// Dynamic name generation
const webpack = require('webpack');
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CleanWebpackPlugin = require('clean-webpack-plugin');
module.exports = {
entry: { main: path.join(__dirname, './src/index.js') },
output: {
const path = require('path');
module.exports = {
devtool: 'cheap-module-eval-source-map',
entry: path.join(__dirname, './src/index.js'),
output: {
path: path.join(__dirname, './dist'),
filename: 'main.js'
},
devServer: {
publicPath: './dist/'
@SherryH
SherryH / .eslintrc.json
Created October 12, 2017 20:22
Configuration to integrate eslint with flow for developing React using webpack
{
"extends": ["airbnb", "plugin:flowtype/recommended"],
"parserOptions": {
"ecmaVersion": 7,
"sourceType": "module",
"ecmaFeatures": { "jsx": true, "modules": true }
},
"parser": "babel-eslint",
"env": {
"browser": true,