Skip to content

Instantly share code, notes, and snippets.

@joshuacrass
joshuacrass / fish_prompt.fish
Last active July 31, 2023 13:58
Customized fish prompt for a better Git experience
# Display informative Git status in the prompt (e.g., branch name, dirty state, etc.).
set -g __fish_git_prompt_show_informative_status true
# Show color hints in the Git prompt for different Git states (e.g., dirty, staged, conflicted).
set -g __fish_git_prompt_showcolorhints true
# Show verbose information about the upstream status in the Git prompt.
set -g __fish_git_prompt_showupstream verbose
# Colors for various Git states.
@joshuacrass
joshuacrass / react-starter-webpack-dev-config.js
Last active December 12, 2022 18:42
react-starter Webpack development config file
// webpack-dev-config.js
// configuration data related to development only
const path = require("path");
const webpack = require("webpack");
const { merge } = require("webpack-merge");
const paths = require("./paths");
// import common webpack config
node_modules/
build/
@joshuacrass
joshuacrass / eslint-package.json
Last active May 6, 2019 00:48
package.json file for starting with eslint
{
"scripts": {
"lint": "eslint src -c .eslintrc.json --ext js,jsx"
},
"dependencies": {
"react": "^16.5.0",
"react-dom": "^16.5.0"
},
"devDependencies": {
"eslint": "^5.5.0",
@joshuacrass
joshuacrass / eslintrc.json
Last active March 3, 2019 10:31
Example eslintrc with prettier
{
"extends": ["airbnb", "prettier", "prettier/react"],
"plugins": ["react", "prettier"],
"rules": {
"react/jsx-filename-extension": [
1,
{
"extensions": [".js", "jsx"]
}
],
"scripts": {
"build": "yarn clean; webpack --config config/webpack-prod-config.js",
"clean": "rm -rf build/*",
"start:dev": "node config/webpack-dev-server.js",
"start:prod": "yarn build; serve build"
},
@joshuacrass
joshuacrass / webpack-starter-package-2.json
Created September 10, 2018 11:53
webpack-starter sample package.json
{
"name": "react-starter-test-2",
"version": "1.0.0",
"main": "index.jsx",
"license": "MIT",
"scripts": {
"build": "yarn clean; webpack --config config/webpack-prod-config.js",
"clean": "rm -rf build/*",
"start:dev": "node config/webpack-dev-server.js",
"start:prod": "yarn build; serve build"
@joshuacrass
joshuacrass / react-flow-element-type-button.jsx
Created September 18, 2018 14:08
react-flow element type button
// @flow
import React from 'react';
import type { Element } from 'react';
type Props = {
children: string,
};
const Button = (props: Props): Element<'button'> => {
const { children } = props;
@joshuacrass
joshuacrass / react-flow-eslint.json
Created September 18, 2018 08:33
react-flow eslint
{
"extends": ["airbnb", "prettier", "prettier/flowtype", "prettier/react"],
"plugins": ["flowtype", "react", "prettier"],
"parser": "babel-eslint",
"rules": {
"react/jsx-filename-extension": [
1,
{
"extensions": [".js", "jsx"]
}
@joshuacrass
joshuacrass / react-flow-app-button.jsx
Last active September 18, 2018 08:18
react-flow app button example
// @flow
import React from 'react';
import { hot } from 'react-hot-loader';
import Button from 'Components/button';
import style from './app.css';
const App = () => {
// define the button text and give it a type of string
const buttonText: string = 'Click Me';