Skip to content

Instantly share code, notes, and snippets.

View eesa1980's full-sized avatar

Lewis James-Odwin eesa1980

  • Cardiff
View GitHub Profile
@eesa1980
eesa1980 / .gitconfig
Last active May 13, 2022 10:11
Github Aliases #git #gitconfig
# This is Git's per-user configuration file.
[user]
name = Lewis James-Odwin
email = [email protected]
[core]
editor = "code -w"
excludesfile = /Users/lewisjamesodwin/.gitignore_global
ignorecase = false
[alias]
addco = "!git add . && git commit -m"
@eesa1980
eesa1980 / module-as-type.md
Last active June 4, 2020 06:50
Using a module as a type #typescript #modules #Interface

Say you have the following module:

const SomeModule = () => {
  const add: number = (a: number, b: number) => a + b;
  const subtract: number = (a: number, b: number) => a - b;
  
  return {
    add,
 subtract
@eesa1980
eesa1980 / npm-version-tags.md
Last active May 13, 2022 10:15
npm version tags #npm

major: npm version major

minor: npm version minor

patch: npm version patch

npm version [<newversion> | major | minor | patch | premajor | preminor | prepatch | prerelease [--preid=<prerelease-id>] | from-git]

'npm [-v | --version]' to print npm version
'npm view <pkg> version' to view a package's published version
'npm ls' to inspect current package/dependency versions
@eesa1980
eesa1980 / fetch-all.sh
Created February 15, 2021 11:30
[Fetch all - git]How to fetch all remote branches in git command line #fetch #all #git #bash
git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done
@eesa1980
eesa1980 / useUrlParams.ts
Last active May 13, 2022 10:12
A hook in react to return url params #React #CustomHook #URLSearchParams
/**
* A hook in react to return url params
*/
export const useUrlParams = () => {
const location = useLocation()
const [search] = useState<URLSearchParams>(
new URLSearchParams(location.search)
)
@eesa1980
eesa1980 / full-screen-mobile-browser.css
Created March 22, 2021 08:28
Mobile full screen #mobile #fullscreen
html, body {
width: 100vw;
padding: 0;
margin: 0;
overflow: hidden;
min-height: 100%; /* We keep this right? */
min-height: 100vh;
min-height: -webkit-fill-available; /* We want the vendor-prefixed value to take affect
in browsers that support it, fall back to 100vh,
then 100%. */
@eesa1980
eesa1980 / git-cheat-sheet-v2.md
Last active May 13, 2022 10:14
Git cheat sheet #git #CheatSheet
@eesa1980
eesa1980 / .eslintrc.json
Last active July 3, 2021 19:38
#eslint #config
{
"env": {
"browser": true,
"es2021": true
},
"extends": [
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
"react-app/jest"
@eesa1980
eesa1980 / .prettierrc
Last active May 13, 2022 10:12
Prettier Config #prettier #config
{
"trailingComma": "none",
"singleQuote": true,
"semi": false,
"tabWidth": 2,
"useTabs": false,
"printWidth": 80
}
@eesa1980
eesa1980 / package.json
Last active July 3, 2021 19:38
#packagejson #config
{
"name": "my-project",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
"aws-amplify": "^3.3.24",
"axios": "^0.21.1",