Skip to content

Instantly share code, notes, and snippets.

View nickytonline's full-sized avatar
:octocat:

Nick Taylor nickytonline

:octocat:
View GitHub Profile
if (
process.env.NODE_ENV === 'production' &&
window.__REACT_DEVTOOLS_GLOBAL_HOOK__ &&
Object.keys(window.__REACT_DEVTOOLS_GLOBAL_HOOK__._renderers).length
) {
window.__REACT_DEVTOOLS_GLOBAL_HOOK__._renderers = {}
}
@Rich-Harris
Rich-Harris / service-workers.md
Last active April 21, 2025 16:53
Stuff I wish I'd known sooner about service workers

Stuff I wish I'd known sooner about service workers

I recently had several days of extremely frustrating experiences with service workers. Here are a few things I've since learned which would have made my life much easier but which isn't particularly obvious from most of the blog posts and videos I've seen.

I'll add to this list over time – suggested additions welcome in the comments or via twitter.com/rich_harris.

Use Canary for development instead of Chrome stable

Chrome 51 has some pretty wild behaviour related to console.log in service workers. Canary doesn't, and it has a load of really good service worker related stuff in devtools.

@piotrwitek
piotrwitek / tslint.json
Last active April 20, 2019 01:18
TSLint rules with ESLint/React extension based on airbnb style guide
{
"rules": {
"align": [
true,
"parameters",
"arguments",
"statements"
],
"ban": false,
"class-name": true,
@joepie91
joepie91 / promises-faq.md
Last active June 25, 2023 09:02
The Promises FAQ - addressing the most common questions and misconceptions about Promises.
@fokusferit
fokusferit / enzyme_render_diffs.md
Last active April 23, 2025 17:13
Difference between Shallow, Mount and render of Enzyme

Shallow

Real unit test (isolation, no children render)

Simple shallow

Calls:

  • constructor
  • render
@timvisee
timvisee / falsehoods-programming-time-list.md
Last active April 24, 2025 23:38
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
@mrmartineau
mrmartineau / stimulus.md
Last active April 9, 2025 15:37
Stimulus cheatsheet
@swalkinshaw
swalkinshaw / tutorial.md
Last active February 26, 2025 21:15
Designing a GraphQL API
@CodeMouse92
CodeMouse92 / beginners-tag.md
Last active March 6, 2024 06:03
DEV.to Moderation Comments and Messages

MOVED TO https://github.com/CodeMouse92/DEVModInACan

#BEGINNERS TAG REMOVALS

Non-Beginner Article

All articles on #beginners should be written for those new to programming, development, networking, or to a particular language. These posts should also require little to no prerequisite knowledge. If you wish, you may rewrite your post to meet these requirements, at which point you may request that the tag be added back. Otherwise, just use the appropriate technology tags. (Read more about the tag rules here.)

Non-Beginner Question

@nickcernis
nickcernis / docker-cleanup.md
Last active April 10, 2025 21:13
Docker commands to remove all containers and images

docker kill $(docker ps -q) to kill all running containers
docker rm $(docker ps -a -q) to delete all stopped containers.
docker volume rm $(docker volume ls -q) to delete all volumes.
docker rmi $(docker images -q) to delete all images.

Run all commands:

docker kill $(docker ps -q) && docker rm $(docker ps -a -q) && docker volume rm $(docker volume ls -q) && docker rmi $(docker images -q)

For fish shell, remove the $: