See the new site: https://postgresisenough.dev
This file contains hidden or 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
| #!/bin/bash | |
| # Set the URLs for the hosts files | |
| HOSTS_URLS=( | |
| "https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts" | |
| "https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/fakenews-gambling-only/hosts" | |
| "https://raw.githubusercontent.com/badmojr/1Hosts/master/Lite/hosts.txt" | |
| "https://tgc.cloud/downloads/hosts.txt" | |
| "https://raw.githubusercontent.com/d3ward/toolz/master/src/d3host.txt" | |
| # Add more URLs as needed |
This file contains hidden or 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 math | |
| def haversine(lat1, long1, lat2, long2): | |
| # Radius of the Earth in kilometers | |
| R = 6371 | |
| # Convert latitude and longitude from degrees to radians | |
| lat1, long1, lat2, long2 = map(math.radians, [lat1, long1, lat2, long2]) | |
| # Differences in latitude and longitude |
This file contains hidden or 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 useLazyLoadSvg from "useLazyLoadSvg"; | |
| function TestComponent () { | |
| const { url, Icon } = useLazyLoadSvg(() => import("your-svg-path.svg")) | |
| return ( | |
| <img src={url} /> | |
| <<Icon /> | |
| ) | |
| } |
I hereby claim:
- I am renesansz on github.
- I am renesansz (https://keybase.io/renesansz) on keybase.
- I have a public key whose fingerprint is 7A56 4743 87E8 4F8A D209 3721 DC20 A56B DC0C 79CA
To claim this, I am signing this object:
This file contains hidden or 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
| /** | |
| * A functional programming utility that composes functions from right to left. | |
| * | |
| * @param fns The functions to compose. Each function is expected to accept a single parameter. | |
| * @returns The final function obtained by composing the given functions from right to left. | |
| */ | |
| export const compose = (...fns) => | |
| fns.reduceRight( | |
| (prevFn, nextFn) => | |
| (...args) => |
This file contains hidden or 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
| #!/usr/bin/env bash | |
| lint_check() { | |
| changes="$(git diff -r --exit-code --name-only --staged --diff-filter=duxb -C packages/$1 | grep -E '.*\.(js|jsx|ts|tsx)$')" | |
| # Only execute lint check if response code from git diff is 0 (has changes) | |
| if [ "$?" -eq 0 ]; then | |
| echo -e "🔎 Running lint check for \033[1;34m$1\033[0m" | |
| npm --prefix ./packages/$1 run es ${changes//packages\/$1\//.\/} | |
| fi | |
| # Cancel commit if the last npm run command raised an error code (non-zero) |
This file contains hidden or 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
| html { | |
| background: green; | |
| } |
Picking the right architecture = Picking the right battles + Managing trade-offs
- Clarify and agree on the scope of the system
- User cases (description of sequences of events that, taken together, lead to a system doing something useful)
- Who is going to use it?
- How are they going to use it?
This file contains hidden or 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
| client.on('message', msg => { | |
| if (msg.content === 'ping') { | |
| msg.reply('pong'); | |
| } | |
| }); |
NewerOlder