Skip to content

Instantly share code, notes, and snippets.

View DavidWells's full-sized avatar
😃

David Wells DavidWells

😃
View GitHub Profile
@DavidWells
DavidWells / default.md
Created June 24, 2025 00:42 — forked from cablej/default.md
Cluely System prompt

<core_identity> You are an assistant called Cluely, developed and created by Cluely, whose sole purpose is to analyze and solve problems asked by the user or shown on the screen. Your responses must be specific, accurate, and actionable. </core_identity>

<general_guidelines>

  • NEVER use meta-phrases (e.g., "let me help you", "I can see that").
  • NEVER summarize unless explicitly requested.
  • NEVER provide unsolicited advice.
  • NEVER refer to "screenshot" or "image" - refer to it as "the screen" if needed.
  • ALWAYS be specific, detailed, and accurate.
@DavidWells
DavidWells / clickable-link-prompts.md
Created June 24, 2025 00:36
Get clickable links from Claude Code
#!/usr/bin/env node
const { exec } = require('child_process')
const { platform } = require('os')
// Get ARN from command line arguments
const arn = process.argv[2]
if (!arn) {
console.error('Usage: node aws-open-link.js <resource-arn>')
@DavidWells
DavidWells / claude-code-commit.sh
Last active June 20, 2025 22:33
Alias this to something like `aic` "AI commit". Takes additional optional arg for commit message to have a body
#!/bin/bash
claude_commit_message() {
local debug=false
local should_push=false
local additional_info=""
# Handle arguments
for arg in "$@"; do
if [[ "$arg" == "--debug" ]]; then
@DavidWells
DavidWells / conditional-git-user.md
Created June 1, 2025 23:08
Conditional git user config example

It's possible to conditionally extend the git configuration based on where your repository is located in your file system. That means we can have a global git configuration with all the default configuration and then in a few overrides for all repositories within, for example, the ~/code/work/ folder by adding a little something like this to the ~/.gitconfig file.

via https://dev.to/tastefulelk/conditional-git-profile-configuration-212b

// ~/.gitconfig
[user]
    name = Sebastian Bille
    email = [email protected]
@DavidWells
DavidWells / ddb-to-sql.js
Created February 24, 2025 19:43
DynamoDB to SQL statement
function as_sql_insert(attributes, table_name) {
// Create a copy to avoid modifying the original object
let attrs = Object.assign({}, attributes)
console.log('attributes in sql insert: ', attrs)
const removed_attributes = ['__initialised__', 'PK', "SK", "GSI1PK", "GSI1SK", "GSI2PK", "GSI2SK", "GSI3PK", "GSI3SK", "batch"]
for (const attribute of removed_attributes) {
if (attribute in attrs) {
delete attrs[attribute]
}
@DavidWells
DavidWells / run-tests-for-file.bash
Created February 20, 2025 18:41
Bash for VSCode* to run tests in current file. E.g. Inside file.js will run file.test.js, inside file.test.js it runs itself
#!/bin/bash
if [[ "${relativeFile}" == *.test.js ]]; then
FILE="${relativeFile}"
elif [ -f "${fileDirname}/${fileBasenameNoExtension}.test.js" ]; then
FILE="${fileDirname}/${fileBasenameNoExtension}.test.js"
elif [ -f "${fileDirname}/$(basename "${fileDirname}").test.js" ]; then
FILE="${fileDirname}/$(basename "${fileDirname}").test.js"
else
FILE="${relativeFile}"

Resource Costs Prompt

You are an expert AWS Billing consultant. You are to

Below is a list of resources in this CloudFormation stack. Please provide me with their associated costs.

Please output the response with Fixed costs first (For example KMS key costs $1 per month per key), then Variable costs (for example requests to S3 cost $0.01 per 1000 requests).

If any Fixed Monthly Costs are present, please provide the total monthly cost for all Fixed Monthly Costs.

function testFilename(filename) {
const match = filename.match(/^(?:(\d+)[.-])?([^.]+)(?:\.([^.]+))?(?:\.([^.]+))?$/)
if (match) {
const order = match[1]
const base = match[2] ?? filename
const modifier = match[4] ? match[3] : undefined
const extension = match[4] ?? match[3]
console.log({
@DavidWells
DavidWells / zOrder.ts
Last active April 21, 2025 19:23 — forked from valentinbeggi/zOrder.ts
zOrder for DDB for geospatial
// UTILS
export const getPaddingFromPrecision = (
floatingPointPrecision: number,
): number => {
return Math.ceil(Math.log2(360 * floatingPointPrecision));
};
export const convertToBinary = (
num: number,