Test setup with npx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| DELETE ME - Must create a new gist with an initial file | |
| import React, { useState, useEffect } from "react"; | |
| import TextField from "@material-ui/core/TextField"; | |
| import Autocomplete from "@material-ui/lab/Autocomplete"; | |
| import { countriesAndStates } from "./data/countriesAndStates"; | |
| const SelectCountry = () => { | |
| const [country, setCountry] = useState(countriesAndStates[0].name); |
npm i -D concurrently nodemon @babel/cli @babel/preset-react \
@babel/preset-env babel-loader \
@babel/plugin-proposal-class-properties \
webpack webpack-cli webpack-dev-server \
clean-webpack-plugin html-webpack-plugin \
mini-css-extract-plugin interpolate-html-plugin \
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const CleanWebpackPlugin = require('clean-webpack-plugin'); | |
| const HtmlWebpackPlugin = require('html-webpack-plugin'); | |
| const InterpolateHtmlPlugin = require('interpolate-html-plugin'); | |
| const MiniCssExtractPlugin = require('mini-css-extract-plugin'); | |
| const devMode = process.env.NODE_ENV !== 'production' | |
| const path = require('path'); | |
| module.exports = { | |
| entry: ['./src/index.js', './src/styles/scss/styles.scss'], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from math import tan, pi | |
| def shapeArea(n): | |
| """Find area of a polygon for given n | |
| The example provided shows that area for: | |
| n = 1 is 1 , n = 2 is 5, n = 3 is 13, n = 4 is 25. | |
| or visually: | |
| * | |
| * *** | |
| * *** ***** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def adjacentElementsProduct(inputArray): | |
| """Given an array of integers, find and return the max product of 2 adjecent items in array""" | |
| products = tuple(idx * idx_next for idx, idx_next in zip(inputArray, inputArray[1:])) # make tuple for multiplied adjecent array items | |
| max_prod = None | |
| for val in products: # Find highest value in products tuple, then return it | |
| if max_prod == None or val > max_prod: | |
| max_prod = val | |
| return max_prod |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ Stats from csv | |
| top100 columns = 'Track Name', 'Artist', 'Position', 'Streams' | |
| top100 vals = str str int int | |
| """ | |
| import csv | |
| def file_list(filename): | |
| f = open(filename, "r") | |
| lst_f = list(csv.reader(f)) | |
| wo_head_f = lst_f[1:] |