This repository tracks the snippets, notes, and ephemera that don't warrant a blog post but may prove useful later. Inspired by Josh Branchaud and Chuck Grimmet.
147 notes and counting...
- Awk
- AWS
- Bash
- CSS
- Data Structures
- Docker
- Drupal
- ElasticSearch
- Git
- HTML
- JavaScript
- Jest
- Laravel
- Mac OS
- MongoDB
- MySQL
- Networking
- Node
- Numpy
- PHP
- PHPUnit
- Python
- React
- Rust
- SQLite
- SQL Server
- Theory
- Tmux
- TypeScript
- Unix
- Vagrant
- Video
- Vim
- Extract substrings from variables
- Get PID of shell running script
- Make an array of files from glob pattern
- Mark variables as readonly
- Use arrays in Bash
- Add unit at end of
calc
expression - Load animation css separately based on user preference
- Target dark mode with media query
- Typeset numbers for tables with font-feature-settings
- Use
font-display: swap;
to render text in fallback font until @font-face font loads - Use clamp to control values over a range
- Add an unlinked item to the breadcrumb in Drupal 8
- Dump all Twig variable names in the current context
- Import updated configuration without uninstalling module
- List all registered plugin IDs for blocks with Drush
- Get URL of current page in Drupal Twig
- Use optional configuration with modules
- Ammend previous commit message
- Create patches
- Discard untracked changes
- Do not paginate output of commands
- Get path to root of repository
- Hide untracked files in git status
- List branches merged (or not) with current branch
- Make new branch from stash
- Mark releases with tags
- Remove stale remote tracking branches
- Revert file to some previous commit
- Search across historical commit diffs
- See diff between current and last commit
- Sign commits with GPG
- Show only filenames in git log output
- Stash and unstash changes
- Check if number type is a safe integer
- Convert an integer to hex, octal, or binary
- Detect Invalid Date objects
- Get color depth of screen
- Get epsilon value in Javascript
- ISO date strings without timezones are handled differently across browsers
- Make an enum-like structure with
Object.freeze
- Maps keep key insertion order and are iterable
- Pad string with padStart
- Rename destructured variables
- Send message to parent window from iframe or popup
- Use
postMessage
API to send messages to Service Worker
- Append computed Eloquent model properties to JSON responses
- Append query parameters to pagination links
- Create model, controller, and migration with one artisan command
- Run test without firing events
- Turn off exception handling in tests
- List available devices and runtimes in the Simulator App
- Show Hidden Files/Folders in Finder
CMD + Shift + .
- Dump database without locking
- Use
group_concat
to concatenate group results into a single string - Perform case-sensitive string comparison with
BINARY
keyword - Return first non-null value from set with
COALESCE
function - See system configuration values
- See the schema of a table
- Show privileges for user
- Show currently running operations
- Filter Wireshark traffic by an IP address source
- Ping over a specific network interface with
-I
- Set DNS server for dig command
- Use
dig
to query DNS information - Query for types of DNS records with dig
- Handle POSIX signals with callback
- Inspect large objects
- List all globally installed NPM packages
- List outdated packages with NPM
outdated
- Pass data to all views in Express with
res.locals
object
- Assign many variables from an array with
list
- Build http query string from an array with
http_build_query
- Call function on script exit with
register_shutdown_function
- Compact variables into an array
- Declare nullable types
- Desctructure named array values
- Format
debug_backtrace
as JSON - Open REPL with
-a
option
- Set a default test suite
- Set constants in config file
- Use data providers to provide variations on input
- Extend behavior of functions with decorators
- Filter a list with list comprehension
- Profile program with
cProfile
- Unpack sequences and collections with star operator
- Use union type hints
- Add a user to a group
- Base64 encode/decode data with
base64
- Check disk usage with
du
- Check file mime type with
file
command - Compress a directory with
tar
- Convert text files from one character set to another with
iconv
- Execute multiple commands with
xargs
- Forward SSH Agent with connection with
-A
flag - Get fingerpint of ssh key
- Peek at just headers of CSV file
- Print sorted disk usage across device
- Schedule a cron job to run every X minutes
- See differences between files with
diff
- See list of files opened by processes with
lsof
- See memory usage with
free
- Send cookies with
curl
-b
- Test headers with
curl
- Convert an mp4 to a gif with ffmpeg
- Cut a clip from a video with ffmpeg
- Remove audio from video with ffmpeg
-an
- Edit file in new tab
- Delete without overwriting yanked text
- Find current word forward or back
- Increment and decrement numbers
- Lowercase a series of words
- Open a file from filename or path in source code
- Open a file from netrw in new tab
- Open
fzf
result in new tab - See list of suggested completions for current word
- Set the color scheme