(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
// Paste these lines into website's console (Win/Linux: Ctrl + Shift + I / Mac: Cmd + Alt + I) | |
if(!!window.React || | |
!!document.querySelector('[data-reactroot], [data-reactid]') || | |
Array.from(document.querySelectorAll('*')).some(e => e._reactRootContainer !== undefined || Object.keys(e).some(k => k.startsWith('__reactContainer'))) | |
) | |
console.log('React.js'); | |
if(!!document.querySelector('script[id=__NEXT_DATA__]')) | |
console.log('Next.js'); |
See how a minor change to your commit message style can make a difference.
git commit -m"<type>(<optional scope>): <description>" \ -m"<optional body>" \ -m"<optional footer>"
Just a quick fun experiment to try to make docker-compose
work as a Docker CLI plugin
To use it (assuming you have docker compose installed):
/** | |
* Converts an ArrayBuffer to a String. | |
* | |
* @param buffer - Buffer to convert. | |
* @returns String. | |
*/ | |
export default function arrayBufferToString(buffer: ArrayBuffer): string { | |
return String.fromCharCode.apply(null, Array.from(new Uint16Array(buffer))); | |
} |
/* | |
* Stripe WebGl Gradient Animation | |
* All Credits to Stripe.com | |
* ScrollObserver functionality to disable animation when not scrolled into view has been disabled and | |
* commented out for now. | |
* https://kevinhufnagl.com | |
*/ |
// In TS, interfaces are "open" and can be extended | |
interface Date { | |
/** | |
* Give a more precise return type to the method `toISOString()`: | |
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString | |
*/ | |
toISOString(): TDateISO; | |
} | |
type TYear = `${number}${number}${number}${number}`; |
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
""" | |
Git smart switch | |
Like `git switch` but stashing uncommitted changes and recovering them when you are back. | |
# Install |
#!/usr/bin/env bash | |
PACKAGE_FILE="package.json" | |
PACKAGE_RUN_COMMAND="npm" | |
RUN_COMMAND="bash ${0}" | |
SCRIPT="$1" | |
# Check package manager | |
if [ -f "package-lock.json" ]; then | |
PACKAGE_RUN_COMMAND="npm" |