Skip to content

Instantly share code, notes, and snippets.

View rekomat's full-sized avatar
:octocat:
Octodog

René Keller rekomat

:octocat:
Octodog
View GitHub Profile
@rekomat
rekomat / react-cheatsheet.md
Created November 12, 2023 10:56
React Cheatsheet

React Cheatsheet

Toggle state

const [isOn, setIsOn] = useState(false);

// ✔ do
const toggle = () => setIsOn(isOn => !isOn);

Typescript Cheatsheet

Enums

Using objects instead of enums

export enum Position {
  Top = 'top',
 Bottom = 'bottom',
@rekomat
rekomat / ascii-tree.md
Created June 22, 2022 10:08
Samples of ASCII file sctructure trees

ASCII Tree

@igs/ngx-ui
├── app-layout
│   ├── app-frame (app-layout)
│   └── app-header-drawer
├── workspace-layout (feature-layout)
│   ├── workspace-header
│ ├── workspace-simple (feature-layout-simple)

npm Cheatsheet

Update all packages to latest

# Install ncu globally
npm install -g npm-check-updates

# Run it to update all version hints in package.json 
# (dependencies and dev-dependencies)

Facebook Graph API Cheatsheet

Access Token

Generate temporary access token

The temporary access token can be exchanged against a permanent access token later (s. below).

SSH Cheatsheet

Use custom port to connect

# ~/.ssh/config
Host my.host.com
  Port 1234

nvm Cheatsheet

Check if nvm is installed

command -v nvm

Get currently active version

nvm current -- or -- node -v

@rekomat
rekomat / chrome-inspector-cheatsheet.md
Last active September 10, 2020 07:18
Chrome inspector cheatsheet

DNS Lookup Cheatsheet

Get DNS for a domain

$ dig -t NS pixelherz.com
pixelherz.com.		10534	IN	NS	ns1.netzone.ch.
pixelherz.com.		10534	IN	NS	ns3.netzone.ch.
pixelherz.com.		10534	IN	NS	ns2.netzone.ch.

JRW Consulting, Corporate Design Cheatsheet

Typography

  • Font Family: Karla
  • Font Weight: Regular
  • Line Height: tbd
  • Paragraph: tbd
  • Kerning: tbd