Dev Notebook
My curated list of dev hacks, notes and fixes. Props to @xemasiv for the idea)
- Change port for create-react-app
- Close single simulator in Xcode
- React Native Expo changes not reloaded
- Safe CSS Defaults
- Online Code Editor
- Hot Links
- Per-repository SSH keys
- Kill Chrome Command
- Lofty Concepts
- Cheat Sheets
- Axios catch error
- Concepts
Update all packages from storybook
npx npm-check-updates '/storybook/' -u && npm install
Change port for create-react-app
Change the start script to from
"start": "react-scripts start"
to
"start": "PORT=3006 react-scripts start"
Close single simulator in Xcode
Select Simulator.. Go into File Menu -> Close window or press [Command + W ]. It will close the simulator which is on top. Source
React Native expo changes not reloaded
rm .git/index.lock
Safe CSS Defaults
Property | Value |
---|---|
background | "transparent (transparent stands for rgba(0, 0, 0, 0)) or none or 0 0" |
border | none or 0 |
border-image | none |
border-radius | 0 |
box-shadow | none |
clear | none |
color | "No value, so best option is to use inherit to cascade from a parent element’s color value." |
content | normal |
display | inline |
float | none |
font | normal |
height | auto |
letter-spacing | normal |
line-height | normal |
max-width | none |
max-height | none |
min-width | 0 |
min-height | 0 |
opacity | 1 |
overflow | visible |
page-break-inside | auto |
position | static (not relative) |
text-shadow | none |
text-transform | none |
transform | none |
transition | none |
vertical-align | baseline |
visibility | visible |
white-space | normal |
width | auto |
word-spacing | normal |
z-index | auto (not none or 0) |
Hot Links
Per-repository SSH keys
If you want to use different keys depending on the repository you are working on, you can issue the following command while inside your repository:
git config core.sshCommand "ssh -o IdentitiesOnly=yes -i ~/.ssh/private-key-filename-for-this-repository -F /dev/null"
This will not use the SSH Agent and requires at least Git 2.10.
Kill Chrome Command
killall -9 "Google Chrome"
Lofty Concepts
Code Playgrounds
- front-end languages like HTML, CSS, JavaScript etc Codepen
- Better for web apps with support for imports etc codesandbox
- Like codepen with support for serverside (Node, PHP etc) Glitch
- React Native Flexbox Yoga Layout
- Dexter's Lab (The playground of lodash and lodash/fp) Dexter's Lab
- Like Codepen but for React Native Snack https://runkit.com/home#endpoint
Cheat Sheets
Axios catch error
Disable eslint for a file
/* eslint-disable */
Find files with an extention in dir
find ./components -type f -name '*.stories.tsx'
Set a stage status in Jenkins Pipelines
pipeline {
agent any
stages {
stage('1') {
steps {
sh 'exit 0'
}
}
stage('2') {
steps {
catchError(buildResult: 'SUCCESS', stageResult: 'UNSTABLE') {
sh "exit 1"
}
}
}
stage('3') {
steps {
sh 'exit 0'
}
}
}
}