Skip to content

Instantly share code, notes, and snippets.

@Rem0ld
Rem0ld / .eslintrc.json
Created January 19, 2022 08:20
Simple eslint and prettier config + dependencies in package.json so it will format on save
{
"env": {
"es2021": true,
"node": true
},
"extends": ["eslint:recommended", "prettier"],
"parserOptions": {
"ecmaVersion": 12,
"sourceType": "module"
},
@Rem0ld
Rem0ld / .prettierrc.js
Created May 11, 2021 19:07
simple prettier config file
module.exports = {
semi: false, // Print semicolons at the ends of statements.
trailingComma: 'es5', // Trailing commas where valid in ES5 (objects, arrays, etc.)
jsxBracketSameLine: false, // Put the > of a multi-line JSX element at the end of the last line
singleQuote: true, // Use single quotes instead of double quotes.
printWidth: 90, // Specify the line length that the printer will wrap on.
useTabs: true, // Indent lines with tabs instead of spaces.
tabWidth: 2, // Specify the number of spaces per indentation-level.
jsxSingleQuote: false, // Use single quotes instead of double quotes in JSX.
endOfLine: 'auto', // Maintain existing line endings
@Rem0ld
Rem0ld / .eslintrc.js
Created May 11, 2021 19:07
example eslint config for typescript react and prettier
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
@Rem0ld
Rem0ld / useWindowDimensions.js
Created January 14, 2021 10:57
React hook to get the dimensions of the window
import { useState, useEffect } from "react";
function getWindowDimensions() {
const { innerWidth: width, innerHeight: height } = window;
return {
width,
height,
};
}
@Rem0ld
Rem0ld / robbyrussell.zsh-theme.sh
Created January 5, 2021 08:15
Command line modif robbyrussel
NEWLINE=$'\n'
PROMPT="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ )"
PROMPT+=' %{$fg[purple]%}%/%{$reset_color%} $(git_prompt_info)${NEWLINE} '
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}git:(%{$fg[red]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})"