Skip to content

Instantly share code, notes, and snippets.

View hellobrian's full-sized avatar
🏠
Working from home

Brian Han hellobrian

🏠
Working from home
View GitHub Profile
@hellobrian
hellobrian / .eslintrc.js
Created August 30, 2020 18:46
Next.js files for TypeScript
module.exports = {
root: true, // Make sure eslint picks up the config at the root of the directory
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2020, // Use the latest ecmascript standard
sourceType: 'module', // Allows using import/export statements
ecmaFeatures: {
jsx: true // Enable JSX since we're using React
}
},
// https://medium.com/@mhagemann/the-ultimate-way-to-slugify-a-url-string-in-javascript-b8e4a0d849e1
function slugify(string) {
const a = 'àáäâãåèéëêìíïîòóöôùúüûñçßÿœæŕśńṕẃǵǹḿǘẍźḧ·/_,:;';
const b = 'aaaaaaeeeeiiiioooouuuuncsyoarsnpwgnmuxzh------';
const p = new RegExp(a.split('').join('|'), 'g');
return string
.toString()
.toLowerCase()
@hellobrian
hellobrian / machine.js
Created December 19, 2019 06:50
Generated by XState Viz: https://xstate.js.org/viz
const repCounterMachine = Machine(
{
id: "repCounter",
initial: "counting",
context: {
goal: 10,
count: 10,
doneMessage: null
},
states: {
@hellobrian
hellobrian / machine.js
Created November 20, 2019 22:10
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@hellobrian
hellobrian / example.css
Created January 2, 2019 21:24
Prettier: Badly Formatted Code for Demo
html {
box-sizing: border-box;
font-size: 16px ;
}
*, *:before, *:after {
box-sizing: inherit ;
}
.banana > span:after {
@hellobrian
hellobrian / alex-and-brian-stuff.markdown
Created November 26, 2018 03:57
Alex and Brian Stuff
@hellobrian
hellobrian / alex-and-brian-stuff.markdown
Created November 26, 2018 03:19
Alex and Brian Stuff
@hellobrian
hellobrian / README.md
Last active February 26, 2018 17:51
Tokyo for Flemings by Brian

Tokyo for Flemings by Brian

Shinjuku Station

Ramen Nagi (must)

  • In Golden Gai, which has a bunch of small bars.
  • Mixes fish and pork based borths, huge portions
  • How to order: walk-in, go upstairs, get ticket from vending machine. If seats are full, go back outside and wait in the alley.
@hellobrian
hellobrian / index.js
Last active January 9, 2019 13:22
HMR create-react-app
/*
* index.js
*/
import React from 'react';
import ReactDOM from 'react-dom';
import App from 'App';
import { Provider } from 'react-redux';
import configureStore from 'state/store'; // see store.js in the gist below
import { BrowserRouter } from 'react-router-dom';
@hellobrian
hellobrian / .gitconfig
Last active January 19, 2018 16:31
dotfiles
[user]
email = brian.han@accenture.com
name = Brian Han
# Each git user will have their own .gitconfig,
# The only difference between each .gitconfig file is the [user] email and name
# If working on a project in ~/dev, this will tell git to use the .gitconfig file specified by the path variable.
[includeIf "gitdir:~/dev/"]
path = ~/dev/.gitconfig