- Readability is important for maintaining a good app. Make sure your code matches the standard for the project.
- Don't try to be clever. Writing code that other developers understand is more important than writing code that runs as fast as possible, or that is as short as possible.
- Never nest ternaries. Just don't. They're hard to read.
- Code should either work or not work. It should be clear when something is not working. There should be never be an in-between, intermediate half-working state. Eg if a build fails then it shouldn't be in a running-but-not-working state afterwards.
- Leave the code in a better state than it was when you found it. Refactor things that can be simplified, rename things that are badly named, add comments to explain what you've discovered, add tests for things that don't have tests.
- Commits, PRs, and documentation are searchable, so include terms that people might be searching for in your git messages.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const resHeaders = Object.prototype.hasOwnProperty.call(res, 'headers') | |
? res.headers.all() | |
: Object.fromEntries(res.headers.entries()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const MyFunctionProps = z.object({ | |
date: z | |
.string() | |
.datetime() | |
.transform((str) => new Date(str)) | |
}); | |
function MyFunction(props: z.input<typeof MyFunctionProps>): z.output<typeof MyFunctionProps> { | |
const { date } = MyFunctionProps.parse(props); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Array.from( | |
document.querySelectorAll('span.score') | |
).filter( | |
(score)=>score.innerText.match(/[2,3] points/)) | |
.forEach( | |
(score)=>{ | |
[score.closest('tr'), score.closest('tr').previousSibling] | |
.forEach((el)=>el.style.backgroundColor = '#ffd') | |
} | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {getInputProps, Composition, Sequence, Img } from 'remotion'; | |
import React from 'react'; | |
import { Arid } from './components/arid/Arid' | |
import { BlurSwipe } from './components/blur-swipe/BlurSwipe' | |
import { CSSAnim } from './components/CSSAnim/CSSAnim' | |
import chrome from "./assets/chrome.png" | |
const props = getInputProps() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.burns-outer { | |
position: relative; | |
width: 100%; | |
height: 100%; | |
overflow: hidden; | |
} | |
.burns-inner { | |
position: absolute; | |
width: calc(100% + 8em); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {interpolate, Sequence, useCurrentFrame, useVideoConfig, AbsoluteFill, Easing } from 'remotion'; | |
import './styles.css' | |
const TextIn:React.FC<{ text: string, color: string, duration: number }> = ({ text="Whoosh!", color="white", duration }) => { | |
const frame = useCurrentFrame(); | |
const scale = interpolate( | |
frame, | |
[0,duration], | |
[0.1, 50], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
useEffect(()=>{ | |
console.log("Mounted component") | |
return () => { | |
console.log("Unmounted component") | |
}; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Things to check before submitting a PR. | |
Git | |
[ ] Have you definitely created a new branch for this PR using `git checkout -b <branch name>`? | |
[ ] `git add` all your changes to the branch. | |
[ ] `git pull` on the branch that you've based the branch on, and then merge that branch in to your branch. | |
[ ] Are there conflicts? Fix them now. | |
Feature/Bug |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker rm -fv `docker ps -aq` | |
docker rmi -f `docker images -aq` |
NewerOlder