Skip to content

Instantly share code, notes, and snippets.

@lmmx
lmmx / custom-instruction.md
Last active November 1, 2024 18:17
Custom instruction to make Claude Artifacts use persistent file identifiers and names

Custom instruction to make Claude Artifacts use persistent and distinct file identifiers in Projects

  • The title attribute of the <AntArtifact> XML tag becomes the file_name attribute when 'Add to Project' is clicked.
  • Since Claude defaults to a human-readable title (e.g. "Modified Web Page With New Features"), this will tend to change the filename in the Project
  • It's easier to keep a single file copy in your Project docs ("Project Knowledge") when the file names are persistent in this way
Click to show earlier versions

0.0.1

# IDA (disassembler) and Hex-Rays (decompiler) plugin for Apple AMX
#
# WIP research. (This was edited to add more info after someone posted it to
# Hacker News. Click "Revisions" to see full changes.)
#
# Copyright (c) 2020 dougallj
# Based on Python port of VMX intrinsics plugin:
# Copyright (c) 2019 w4kfu - Synacktiv
@mortenson
mortenson / ddrush.sh
Last active March 20, 2022 09:51
What I currently use for local Drupal/Tome dev
#! /bin/bash
# This runs a new Docker container, mounts the current directory (Drupal root),
# and runs an arbitrary drush command, in case you don't want to run it in dsession.
sudo docker run --rm -it --init -v "$(pwd)":/var/www/tome mortenson/tome drush "$@"
@mortenson
mortenson / index.js
Last active September 11, 2020 09:26
A quick CSS audit script for finding overly long/specific selectors in CSS files
#!/usr/bin/env node
// This is a quick CSS audit script I wrote for finding overly long/specific selectors in CSS files.
// Usage: Download this file, then run:
// $ npx https://gist.github.com/mortenson/628fd527a25efe4fd1a4940e14c31066 <space separated list of CSS files to audit>
const listSelectors = require('list-selectors');
const { calculate, compare } = require('specificity');
// This is useful if you want to anonymize the results to avoid blaming.
@jibran
jibran / FileEntity.php
Created March 24, 2017 00:39
Migrating Drupal 7 File Entities to Drupal 8 Media Entities
<?php
// modules/custom/my_custom_module/src/Plugin/migrate/source/FileEntity.php
namespace Drupal\my_custom_module\Plugin\migrate\source;
use Drupal\Core\Database\Query\Condition;
use Drupal\migrate\Row;
use Drupal\migrate_drupal\Plugin\migrate\source\d7\FieldableEntity;
/**
* Drupal 7 file_entity source from database.
@itsmattsoria
itsmattsoria / gistfil1.textile
Last active October 13, 2024 22:55
Mac Terminal Cheat Sheet

SHORTCUTS

Key/Command Description
Tab Auto-complete files and folder names
Ctrl + A Go to the beginning of the line you are currently typing on
Ctrl + E Go to the end of the line you are currently typing on
Ctrl + U Clear the line before the cursor
Ctrl + K Clear the line after the cursor
Ctrl + W Delete the word before the cursor
Ctrl + T Swap the last two characters before the cursor
@plentz
plentz / nginx.conf
Last active November 16, 2024 14:10
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@marcedwards
marcedwards / high-dpi-media.css
Last active November 19, 2023 12:56
A CSS media query that captures almost all high DPI aware devices.
/* ---------------------------------------------------------- */
/* */
/* A media query that captures: */
/* */
/* - Retina iOS devices */
/* - Retina Macs running Safari */
/* - High DPI Windows PCs running IE 8 and above */
/* - Low DPI Windows PCs running IE, zoomed in */
/* - Low DPI Windows PCs and Macs running Firefox, zoomed in */
/* - Android hdpi devices and above */