Skip to content

Instantly share code, notes, and snippets.

View adamelliotfields's full-sized avatar
:atom:
aef.me

Adam Fields adamelliotfields

:atom:
aef.me
View GitHub Profile
@adamelliotfields
adamelliotfields / prompt.md
Created March 12, 2024 02:54
Claude 3 System Prompt

The assistant is Claude, created by Anthropic. The current date is March 4th, 2024.

Claude's knowledge base was last updated on August 2023. It answers questions about events prior to and after August 2023 the way a highly informed individual in August 2023 would if they were talking to someone from the above date, and can let the human know this when relevant.

It should give concise responses to very simple questions, but provide thorough responses to more complex and open-ended questions.

If it is asked to assist with tasks involving the expression of views held by a significant number of people, Claude provides assistance with the task even if it personally disagrees with the views being expressed, but follows this with a discussion of broader perspectives.

Claude doesn't engage in stereotyping, including the negative stereotyping of majority groups.

@adamelliotfields
adamelliotfields / typography.md
Last active December 29, 2023 03:08
Tailwind Typography Markdown Sample Copy

Tailwind Typography

Until now, trying to style an article, document, or blog post with Tailwind has been a tedious task that required a keen eye for typography and a lot of complex custom CSS.

By default, Tailwind removes all of the default browser styling from paragraphs, headings, lists and more. This ends up being really useful for building application UIs because you spend less time undoing user-agent styles, but when you really are just trying to style some content that came from a rich-text editor in a CMS or a markdown file, it can be surprising and unintuitive.

We get lots of complaints about it actually, with people regularly asking us things like:

Why is Tailwind removing the default styles on my h1 elements? How do I disable this? What do you mean I lose all the other base styles too?

@adamelliotfields
adamelliotfields / deno.ts
Last active December 31, 2023 18:08
Deno by Example All-in-One for Prompting
/**
* @title Benchmarking
* @difficulty beginner
* @tags cli
* @run deno bench <url>
* @resource {https://deno.land/manual@v1.30.0/tools/benchmarker} Manual: Benchmarker tool
* @resource {/http-requests} Example: HTTP Requests
*
* When writing libraries, a very common task that needs to be done is
* testing the speed of methods, usually against other libraries. Deno
@adamelliotfields
adamelliotfields / alert_blockquotes.md
Last active August 31, 2023 19:37
New GitHub Markdown Alert Blockquotes

These are so sweet. I didn't see an announcement or blog post; first noticed them in vitest-axe. Here's the community discussion on them.

> [!NOTE]  
> Highlights information that users should take into account, even when skimming.

Note

Highlights information that users should take into account, even when skimming.

@adamelliotfields
adamelliotfields / favicon.sh
Last active April 5, 2024 17:58
Favicon and Webmanifest Script
#!/usr/bin/env bash
set -euo pipefail
# Generates favicons and a webmanifest from a single image
# https://evilmartians.com/chronicles/how-to-favicon-in-2021-six-files-that-fit-most-needs
#
# Usage:
# favicon.sh <file> [dir] [flags]
#
# Args:
@adamelliotfields
adamelliotfields / github_projects_emoji.md
Created August 6, 2023 15:10
GitHub Projects Emoji Categorization

GitHub Projects uses emoji for status, priority, and sizing which I happen to think is very refreshing 🍹

Statuses

  • 🆕: New (:new:)
  • 📋: Backlog (:clipboard:)
  • 🔖: Ready (:bookmark:)
  • 🏗️: In progress (:building_construction:)
  • 👀: In review (:eyes:)
  • ✅: Done (:white_check_mark:)
@adamelliotfields
adamelliotfields / show_minimap_setting.py
Created August 5, 2023 19:32
Sublime Text 4 Show/Hide Minimap Setting
import sublime
import sublime_plugin
"""
Put this in your user packages:
```
mv ~/Downloads/show_minimap_setting.py ~/Library/Application\ Support/Sublime\ Text/Packages/User
```
Then add the setting to Preferences.sublime-settings:
@adamelliotfields
adamelliotfields / disable_jupysql_telemetry.md
Last active August 4, 2023 23:07
Fix Posthog `ConnectionError` in JupySQL (Jupyter) Notebook

If you're using JupySQL in Jupyter and see the below error:

INFO:backoff:Backing off send_request(...) for 0.9s (requests.exceptions.ConnectionError: HTTPSConnectionPool(host='app.posthog.com', port=443): Max retries exceeded with url: /batch/ (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x1290869e0>: Failed to establish a new connection: [Errno 61] Connection refused')))

It could be because you're using a network or DNS ad-blocker like Adguard. Fortunately, you can disable telemetry[^1].

export PLOOMBER_STATS_ENABLED=false
@adamelliotfields
adamelliotfields / disable_mac_airplay.md
Last active July 25, 2023 23:27
Fix Ports 5000 and 7000 on macOS
@adamelliotfields
adamelliotfields / npm_upgrade.sh
Last active August 31, 2023 12:58
Upgrade pinned NPM dependencies
#!/usr/bin/env bash
#shellcheck disable=SC2155
set -euo pipefail
# upgrade outdated pinned dependencies and commit the changes
npm_upgrade() {
local dry_run=false
local prod_only=false
local help=false
local help_msg="npm_upgrade