[ Pre-order, Amazon ] Bose New QuietComfort Ultra Bluetooth Headphones (2nd Gen), Wireless Headphones with Spatial Audio, Over Ear Noise Cancelling with Mic, Up to 30 Hours of Play time, Black
List Price: $449.00
#BoseHeadphones #techtwitter #ad #amazonfinds2025 #technology #techtweets #amazonus
[ Amazon, Pre-order ] Belkin MagSafe Charger Compatible, 2-in-1 Charging Station, Qi2.2 25W Magnetic Wireless Charger Dock, Foldable Stand, with 5W USB-C Port, for iPhone 16/15/14, AirPods (45W Adapter Included)
Price: $59.99
#technology #techtweets #ad #amazonus #amazonfinds #apple #GooglePixel10
`useWhyDidYouUpdate("MyComponent", props);`
This hook will let you know from the console the attributes of an object that have been updated, causing rerendering.
You should use it to avoid unnecessary renders.
#techtweets #day200
When writing JavaScript, you should always pick functions over classes.
For the same result, the code generated by Babel with be smaller with functions.
#techtweets #day199
You can use intersection types to extends an existing TypeScript type.
It is useful to reuse and factorize some pieces of definitions.
#techtweets #day198
With ECMAScript 2022, JavaScript now has private fields in classes.
You need to prefix an attribute or a method with # to make it private.
#techtweets #day197
`git config --global --add --bool push.autoSetupRemote true`, starting Git 2.37.0, will automatically set the up the upstream branch, and will save you from `git push --set-upstream origin feat/awesome-feature`
#techtweets #day196
The object-fit CSS property will keep your image with a good ratio and the box will either contain the image perfectly or crop it.
#techtweets #day195
High order component add a generic behavior to a component.
It can be helpful to wrap an element with a descriptive tooltip.
#techtweets #day194
You can load polyfills with the `nomodule` attribute: modern browser will ignore the script while old will not understand the `nomodule` attribute.
#techtweets #day193
To create truly readonly objects in TypeScript, you can use the `as const` suffix to a variable declaration.
Any property or sub-property will then become readonly.
#techtweets #day192
The padStart and padEnd functions are adding a specific character at the start or the end of your string to reach a specific string length.
#techtweets #day191
Get the current branch name of a git repository in a single command: `git rev-parse --abbrev-ref HEAD`
It can give you superpowers when creating a shell script.
#techtweets #day190
With the CSS aspect-ratio, you can define the size of an element without knowing about the final rendered width of your element.
It might help you avoid layout shifts
#techtweets #day189
`setInterval` is not directly compatible with React, as it needs to match start and stop with a component mounting and unmounting.
The hook that solves that uses refs and effects to manage the interval correctly.
#techtweets #day188
Did you know that you can group your TypeScript code inside namespaces?
It will act like an object, but it will also merge multiple definitions if included in the same namespace
#techtweets #day186
There is a `showPicker()` method on HTML `<input>` elements that can open the detailed view for `date`, `month`, `week`, `time`, `datetime-local`, `color`, and `file` types.
This can also be triggered for `<datalist>`.
#techtweets #day185
Find files (and lines) where a specific text is in tracked files with git grep:
`git grep --heading --line-number 'text to find'`
--heading will group lines by file
--line-number (or -n) will show... line numbers.
#techtweets #day184
The CSS order property allow you to display items in a different order.
It is very helpful on responsive designs or to priorise the right information for screen readers -a title is more important than an image.
Use it with care however.
#techtweets #day183
The useKeyPress hook returns true when a specific key is pressed.
`const forward = useKeyPress("w");`
You might want to use it for a `wasd` navigation for example.
#techtweets #day182
Typescript decorators are a simple way to apply an high order function on a method or a class.
It can be used to measure a method's performance or inject additional parameters among many other use cases.
#techtweets #day180
JavaScript has a limit for integer values... Hopefully, with BigInt, you can go further.
It can be instanced from most supported numeric format such as hexadecimal, octal, binary an of course decimal.
Just add a `n` at the end of your number!
#techtweets @day179
`git diif`, `git commti`, `git dad`... Are you often making typos with git commands?
You can tell git to automatically correct your mistakes by adding a global config:
`git config --global help.autocorrect 1`
#techtweets #day178
Nice shapes are one CSS line away with `clip-path`.
With this property, you can apply a SVG polygon, circle, ellipse, path, ... to modify the shape of your element.
For example, it is easy to create askew blocs with polygon!
#techtweets #day177
You can use a React hook to listen to the escape key stroke to close a modal or quit a focus.
BTW, looks at the `event.code` instruction which is meant to replace the `event.keyCode` which is now deprecated.
#techtweets #day176
You can use the `is` type guard to specify what type is the returned value in TypeScript.
When working with union types, it will help you apply a specific behavior to a specific type
#techtweets #day174
JavaScript has a proxy object that could extend another object with a specific behavior: replacing values, performance measurement, extend DOM nodes, etc.
#techtweets #day173
Some files are missing from your git files? They might be in the ignored files.
You can list all the excluded files with `git ls-files --others -i --exclude-standard`.
#techtweets #day172
You can use React Hooks to apply simple and usual behaviors to your code.
One of the useful hooks I often use is `useDebouncedValue`.
Check the ALT on the image to copy the code.
#techtweets #day170