- got
- Axios
- Ky https://github.com/sindresorhus/ky
- Native JS fetch
- SWR
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
| /** | |
| * Supported IANA timezones. | |
| * Provides a readonly list and a strict `Timezone` type. | |
| */ | |
| export const TIMEZONES = [ | |
| 'UTC', | |
| 'Africa/Abidjan', | |
| 'Africa/Accra', | |
| 'Africa/Addis_Ababa', | |
| 'Africa/Algiers', |
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 python3 | |
| """ | |
| Author: PierreHenry.dev | |
| automation_hub.py - A local automation hub for capturing ideas, prioritising tasks, planning today, | |
| running weekly reviews, and exporting everything to Markdown. | |
| Usage examples: | |
| python automation_hub.py add "Build a Node feature flag article" --type idea --impact 5 --effort 2 | |
| python automation_hub.py add "Ship YouTube thumbnail workflow" --type task --impact 5 --effort 3 --due 2026-03-20 |
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
| try { | |
| var xhr = new XMLHttpRequest(); | |
| xhr.open('GET', 'https://api.exchangerate-api.com/v4/latest/AUD', false); | |
| xhr.send(); | |
| var data = JSON.parse(xhr.responseText); | |
| var eurRate = data.rates.EUR; | |
| var amount = 1; | |
| var converted = (amount * eurRate).toFixed(2); | |
| amount + " AUD = " + converted + " EUR (Rate " + eurRate.toFixed(4) + ")"; | |
| } catch (error) { |
These are my VSCode extensions. Itβs not a complete list, but chances are youβll find them very handy to have installed.
- GitHub Copilot
- ESLint
- Prettier
- Visual Studio Intellicode (JavaScript/TypeScript)
- ES7+ React/Redux/React-Native snippets https://marketplace.visualstudio.com/items?itemName=dsznajder.es7-react-js-snippets
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 { useEffect, RefObject } from 'react'; | |
| /** | |
| * Custom hook to handle click outside events for modals and dropdowns | |
| * @param ref - Reference to the element to detect clicks outside of | |
| * @param handler - Function to call when click outside is detected | |
| * @param enabled - Whether the click outside detection is enabled (default: true) | |
| */ | |
| export const useClickOutside = ( | |
| ref: RefObject<HTMLElement>, |
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 python3 | |
| from PIL import Image, ImageDraw, ImageFont | |
| import os | |
| def create_terminal_icon(size=512): | |
| # Create a new image with transparent background | |
| img = Image.new('RGBA', (size, size), (0, 0, 0, 0)) | |
| draw = ImageDraw.Draw(img) | |
| # Colors |
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
| ## | |
| # Convert text to lowercase. | |
| ## | |
| to_lowercase <- function(input_text) { | |
| # Check if input is character | |
| if (!is.character(input_text)) { | |
| stop("Input must be a character string") | |
| } | |
| # Convert to lowercase |
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
| # Alias | |
| alias vi="nvim" | |
| alias c="clear" | |
| alias push="git push origin head" | |
| alias pull="git pull" | |
| alias amend="git amend" | |
| alias gi="git" | |
| alias g="git" | |
| alias gp="git push" |
NewerOlder