-
CTRL + A
— Move to the beginning of the line -
CTRL + E
— Move to the end of the line -
CTRL + [left arrow]
— Move one word backward (on some systems this is ALT + B) -
CTRL + [right arrow]
— Move one word forward (on some systems this is ALT + F) -
CTRL + U
— (bash) Clear the characters on the line before the current cursor position -
CTRL + U
—(zsh) If you're using the zsh, this will clear the entire line -
CTRL + K
— Clear the characters on the line after the current cursor position -
ESC + [backspace]
— Delete the word in front of the cursor
// | |
// Regular Expression for URL validation | |
// | |
// Author: Diego Perini | |
// Created: 2010/12/05 | |
// Updated: 2018/09/12 | |
// License: MIT | |
// | |
// Copyright (c) 2010-2018 Diego Perini (http://www.iport.it) | |
// |
# Usage: | |
# source iterm2.zsh | |
# iTerm2 tab color commands | |
# https://iterm2.com/documentation-escape-codes.html | |
if [[ -n "$ITERM_SESSION_ID" ]]; then | |
tab-color() { | |
echo -ne "\033]6;1;bg;red;brightness;$1\a" | |
echo -ne "\033]6;1;bg;green;brightness;$2\a" |
ffprobe -v quiet -print_format json -show_format -show_streams "lolwut.mp4" > "lolwut.mp4.json" |
// Add on element with overflow | |
-webkit-mask-image: -webkit-radial-gradient(white, black); |
#!/usr/bin/env node | |
// Channel ID is on the the browser URL.: https://mycompany.slack.com/messages/MYCHANNELID/ | |
// Pass it as a parameter: node ./delete-slack-messages.js CHANNEL_ID | |
// CONFIGURATION ####################################################################################################### | |
const token = 'SLACK TOKEN'; | |
// Legacy tokens are no more supported. | |
// Please create an app or use an existing Slack App |
#!/bin/bash | |
youtube_url="$1" | |
echo "Downloading video..." | |
video_info=$(yt-dlp -e -o "%(title)s" -- "$youtube_url") | |
sanitized_title=$(echo "$video_info" | sed 's/[^a-zA-Z0-9_.-]/_/g') | |
output_file="${sanitized_title}.mp4" | |
yt-dlp -o "temp.mp4" -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best' -- "$youtube_url" |
-
When writing a string of multiple utility classes, always do so in an order with meaning. The "Concentric CSS" approach works well with utility classes (i.e,. 1. positioning/visibility 2. box model 3. borders 4. backgrounds 5. typography 6. other visual adjustments). Once you establish a familiar pattern of ordering, parsing through long strings of utility classes will become much, much faster so a little more effort up front goes a long way!
-
Always use fewer utility classes when possible. For example, use
mx-2
instead ofml-2 mr-2
and don't be afraid to use the simplerp-4 lg:pt-8
instead of the longer, more complicatedpt-4 lg:pt-8 pr-4 pb-4 pl-4
. -
Prefix all utility classes that will only apply at a certain breakpoint with that breakpoint's prefix. For example, use
block lg:flex lg:flex-col lg:justify-center
instead ofblock lg:flex flex-col justify-center
to make it very clear that the flexbox utilities are only applicable at the
If you're using a high-end bluetooth headset on your Macbook Pro it's likely your mac is using an audio codec which favors battery efficiency over high quality. This results in a drastic degradation of sound, the SBC codec is the likely culprit, read more about it here.
// This list comes from Wikipedia deprecated timezones: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones | |
const deprecatedList = [ | |
{ old: 'Australia/ACT', new: 'Australia/Sydney' }, | |
{ old: 'Australia/LHI', new: 'Australia/Lord_Howe' }, | |
{ old: 'Australia/North', new: 'Australia/Darwin' }, | |
{ old: 'Australia/NSW', new: 'Australia/Sydney' }, | |
{ old: 'Australia/Queensland', new: 'Australia/Brisbane' }, | |
{ old: 'Australia/South', new: 'Australia/Adelaide' }, | |
{ old: 'Australia/Tasmania', new: 'Australia/Hobart' }, | |
{ old: 'Australia/Victoria', new: 'Australia/Melbourne' }, |