Today I Learned
A collection of concise write-ups on small things I learn day to day across a variety of languages and technologies. These are things that don't really warrant a full blog post. These are things I've picked up by Learning In Public™ and pairing with smart people at Hashrocket.
For a steady stream of TILs, sign up for my newsletter.
1295 TILs and counting...
- 智能截图 打i开发者工具 Command + shift + P
- 多开账号导入书签
- Chrome 可以在地址栏通过标签备注,直接检索到网址
- Access A Value Logged To The Console
- Chrome Supports Many Unix Keyboard Shortcuts
- Copy Some Data From The Console
- Duplicate The Current Tab
- Easier Access To Network Throttling Controls
- Keybinding To Focus The Address Bar
- Pause JavaScript From The Source DevTools Panel
- Navigate The Browser History With Vimium
- Pretty Print Tabular Data
- Reference The Selected Node
- Selecting DOM Elements Faster Than Ever
- Simulating Various Connection Speeds
- Toggle Device Mode
- Toggle Open The Console Drawer
- View Network Traffic For New Tabs
- Add Fab Icons To Your Site With FontAwesome 5
- Animate Smoothly Between Two Background Colors
- Apply Multiple Box Shadows To Single Element
- Apply Styles Based On Dark-Mode Preferences
- Apply Styles To The Last Child Of A Specific Type
- Change The Orientation Of An Image
- Circular Icons With A Massive Border Radius
- Clean Up Repetition With :is() Pseudo-Class
- Conditional Styling For Unsupported CSS Features
- Create A Pulsing Background With CSS Animation
- Define CSS Custom Properties With CSS Variables
- Define HSL Colors With Alpha Values
- Display Responsive iframe Maintaining Aspect Ratio
- Dry Up SCSS With Mixins
- Give Elements The Same Width With Flexbox
- Let Pointer Events Pass Through An Element
- Lighten And Darken With CSS Brightness Filter
- Lighten And Darken With SCSS
- Make A Block Of Text Respect New Lines
- Parameterized SCSS Mixins
- :root Has Higher Specificity Than html
- Style A Background With A Linear Gradient
- Using Maps In SCSS
- Docker Desktop Vmmem内存占用过高问题解决方案
- Aliasing An Ansible Host
- Allow Cross-Origin Requests To Include Cookies
- Allow HTTPS Through Your UFW Firewall
- Check For Cached Site Assocation File For iOS
- Check The Status of All Services
- Check The Syntax Of nginx Files
- Connect To An RDS PostgreSQL Database
- Determine The IP Address Of A Domain
- Path Of The Packets
- Push Non-master Branch To Heroku
- Reload The nginx Configuration
- Resolve The Public IP Of A URL
- Running Out Of inode Space
- SSH Into A Docker Container
- SSL Certificates Can Cover Multiple Domains
- Wipe A Heroku Postgres Database
- Accessing a Lost Commit
- Add A Range Of Filename To gitignore
- Amend Author Of Previous Commit
- Auto-Squash Those Fixup Commits
- Caching Credentials
- Change The Start Point Of A Branch
- Checking Commit Ancestry
- Checkout Old Version Of A File
- Checkout Previous Branch
- Cherry Pick A Range Of Commits
- Clean Out All Local Branches
- Clean Out Working Copy With Patched Restore
- Clean Up Old Remote Tracking References
- Clone A Repo Just For The Files, Without History
- Clone A Repo Locally From .git
- Configure Global gitignore File
- Configuring The Pager
- Copy A File From Another Branch
- Create A New Branch With Git Switch
- Delete All Untracked Files
- Determine The Hash Id For A Blob
- Diffing With Patience
- Dropping Commits With Git Rebase
- Dry Runs in Git
- Exclude A File From A Diff Output
- Excluding Files Locally
- Find And Remove Files That Match A Name
- Find The Date That A File Was Added To The Repo
- Find The Initial Commit
- Get The Name Of The Current Branch
- Get The Short Version Of The Latest Commit
- Grab A Single File From A Stash
- Grep For A Pattern On Another Branch
- Grep Over Commit Messages
- Ignore Changes To A Tracked File
- Ignore Files Specific To Your Workflow
- Include A Message With Your Stashed Changes
- Include Or Exclude Remaining Patch Changes
- Include Some Stats In Your Git Log
- Intent To Add
- Interactively Unstage Changes
- Last Commit A File Appeared In
- List All Files Changed Between Two Branches
- List Branches That Contain A Commit
- List Commits On A Branch
- List Different Commits Between Two Branches
- List Filenames Without The Diffs
- List Just The Files Involved In A Commit
- List Most Git Commands
- List Untracked Files
- List Untracked Files For Scripting
- Move The Latest Commit To A New Branch
- Pick Specific Changes To Stash
- Pulling In Changes During An Interactive Rebase
- Push To A Branch On Another Remote
- Quicker Commit Fixes With The Fixup Flag
- Rebase Commits With An Arbitrary Command
- Reference A Commit Via Commit Message Pattern Matching
- Rename A Remote
- Renaming A Branch
- Resetting A Reset
- Resolve A Merge Conflict From Stash Pop
- Review Commits From Before A Certain Date
- Run A Git Command From Outside The Repo
- Set A Custom Pager For A Specific Command
- Shorthand To Force Push A Branch
- Show All Commits For A File Beyond Renaming
- Show Changes For Files That Match A Pattern
- Show Changes In The Compose Commit Message View
- Show File Diffs When Viewing Git Log
- Show List Of Most Recently Committed Branches
- Show Only Commits That Touch Specific Lines
- Show The diffstat Summary Of A Commit
- Show The Good And The Bad With Git Bisect
- Show What Is In A Stash
- Single Key Presses in Interactive Mode
- Skip A Bad Commit When Bisecting
- Skip Pre-Commit Hooks
- Staging Changes Within Vim
- Staging Stashes Interactively
- Stash A Single Untracked File
- Stash Everything
- Stashing Only Unstaged Changes
- Stashing Untracked Files
- Switch To A Recent Branch With FZF
- Transition A Branch From One Base To Another
- Turn Off The Output Pager For One Command
- Two Kinds Of Dotted Range Notation
- Unstage Changes Wih Git Restore
- Untrack A Directory Of Files Without Deleting
- Untrack A File Without Deleting It
- Update The URL Of A Remote
- Using Commands With A Relative Date Format
- Verbose Commit Message
- Viewing A File On Another Branch
- What Changed?
- What Is The Current Branch?
- Whitespace Warnings
- 解决git pull/push每次都需要输入密码问题
- Capture An Output Value For Use In A Later Step
- Reference An Encrypted Secret In An Action
- Adding Alt Text To An Image
- Determine Which Button Submitted The Form
- Disable Auto-Completion For A Form Input
- Prevent Search Engines From Indexing A Page
- Render Text As Superscript
- Submit A Form With A Button Outside The Form
- 清除无用 import 快捷键以及自动清除设置? Ctrl + Alt + o
- 自动创建变量 option + command + v
- 在Intellij IDEA中优雅地使用Debug
- Add Emoji To GitHub Repository Description
- Enable Keyboard Shortcuts In Gmail
- Exclude Whitespace Changes From GitHub Diffs
- Figure Out Your Public IP Address
- Focus The URL Bar
- Get Random Images From Unsplash
- Search Tweets By Author
- Show All Pivotal Stories With Blockers
- Accessing Arguments To A Function
- Basic Date Formatting Without A Library
- Character Codes from Keyboard Listeners
- Check Classes On A DOM Element
- Check If A Number Is Positive Or Negative
- Check If File Exists Before Reading It
- Check If Something Is An Array
- Check The Password Confirmation With Yup
- Compare The Equality Of Two Date Objects
- Computed Property Names In ES6
- Conditionally Include Pairs In An Object
- Configure Jest To Run A Test Setup File
- Create A Cancelable Promise With PCancelable
- Create An Array Containing 1 To N
- Create An Object With No Properties
- Create Bootstrapped Apps With Yarn
- Create Future And Past Dates From Today
- Custom Type Checking Error Messages With Yup
- Default And Named Exports From The Same Module
- Define A Custom Jest Matcher
- Destructure With Access To Nested Value And Parent Value;
- Destructuring The Rest Of An Array
- Enable ES7 Transforms With react-rails
- Ensure Shell Can Find Global npm Binaries
- Easy Date Comparison With DayJS
- Expand Emojis With The Spread Operator
- Fill An Input With A Ton Of Text
- Find The Version Of An Installed Dependency
- Find Where Yarn Is Installing Binaries
- for...in Iterates Over Object Properties
- Formatting Values With Units For Display
- Freeze An Object, Sorta
- Generate A V4 UUID In The Browser
- Generate Random Integers
- Get The Location And Size Of An Element
- Get The Response Status From An Axios Error
- Get The Time Zone Of The Client Computer
- Globally Install A Package With Yarn
- Globally Install Specific Version Of PNPM
- Immutable Remove With The Spread Operator
- Initialize A New JavaScript Project With Yarn
- Install The Latest Version Of Node With Nvm
- Interpolate A String Into A Regex
- ISO-8601 Formatted Dates Are Interpreted As UTC
- Link A JavaScript Package Locally
- List Top-Level NPM Dependencies
- Make The Browser Editable With Design Mode
- Matching A Computed Property In Function Args
- Matching Multiple Values In A Switch Statement
- Mock A Function With Return Values Using Jest
- New Dates Can Take Out Of Bounds Values
- Numbers Are Empty
- Object Initialization With Shorthand Property Names
- Obtain Undefined Value With The Void Operator
- Parse A Date From A Timestamp
- Pre And Post Hooks For Yarn Scripts
- Purge Null And Undefined Values From Object
- Random Cannot Be Seeded
- Reach Into An Object For Nested Data With Get
- Render An Array Of Elements With React 16
- Resolve And Pass Multiple Values From A Then
- Running ES6 Specs With Mocha
- Scoping Variables With A Block Statement
- Sleep For A Bit In Async Code
- Sorting Arrays Of Objects With Lodash
- Splat Arguments To A Function
- Spread Merging Objects Includes Nil Values
- Spread The Rest With ES6
- Start Node Process In Specific Timezone
- String Interpolation With Template Literals
- Support Nested Matching In Custom Jest Matchers
- Tell Jest To Focus On Running Only One Test
- Tell Prettier To Not Format A Statement
- Test Coverage Stats With Jest
- Test Timing-Based Code With Jest Fake Timers
- The Comma Operator
- Throttling A Function Call
- Timing Processes
- Transforming ES6 and JSX With Babel 6
- Truthiness of Integer Arrays
- Turn An HTMLCollection Into An Array
- Turn Off Console Error Messages In A Test
- Waiting On Multiple Promises
- Who Am I: NPM Edition
- Write A JavaScript Object To A JSON File
- Yarn Commands Without The Emojis
- Yup Schemas Are Validated Asynchronously
- Count Each Collection In A JSON Object
- Count The Number Of Things In A JSON File
- Extract A List Of Values
- Find All Objects In An Array Where Key Is Set
- Find All Objects With A Matching Key Value Pair
- Reduce Object To Just Entries Of A Specific Type
- 自动 kill Java 进程,并升级 jar 包.md
- Check Ubuntu Version
- Configure Your Server Timezone
- List The Statuses Of All Upstart Jobs
- Show Current System Time And Settings
- Show Used And Available System Memory
- Upgrading Ubuntu
- 端口占用 sudo lsof -i tcp:8082
- Access All Screen And Video Capture Options
- Access System Information On OS X
- Access Unsupported Screen Resolutions With RDM
- Clean Up Old Homebrew Files
- Convert An HEIC Image File To JPG
- Default Screenshot Location
- Disable Swipe Navigation For A Specific App
- Display A Message With Alfred
- Find The Process Using A Specific Port
- Gesture For Viewing All Windows Of Current App
- Insert A Non-Breaking Space Character
- List All The Say Voices
- Open Finder.app To Specific Directory
- Quickly Type En Dashes And Em Dashes
- Require Additional JS Libraries In Postman
- Resize App Windows With AppleScript
- Resizing Both Corners Of A Window
- Run A Hardware Check
- Run AppleScript Commands Inline In The Terminal
- Set A Window To Its Default Zoom Level
- Specify App When Opening From Command Line
- Use Default Screenshot Shortcuts With CleanShot X
- View All Windows Of The Current App
- Determine The Database Version
- Dump A Remote Database
- Dump And Restore With A Single gzip File
- Get Size Stats For A Collection
- List Size Stats For All Collections
- 导出数据表
- 根据一个表的所有主键-为另一个表生成记录
- 全局锁和表锁 :给表加个字段怎么有这么多阻碍
- Change Existing Column To Not Null
- Default Username And Password For New Instance
- Display Output In A Vertical Format
- Doing Date Math
- Dump A Database To A File
- List Databases And Tables
- Show Create Statement For A Table
- Show Tables That Match A Pattern
- Show Indexes For A Table
- Aborting Git Commits And Rebases
- Absolute And Relative Line Numbers
- Add A File Without Loading It
- Add Custom Dictionary Words
- All The Ways To Write And Quit In Vim
- Almost The End Of The Line
- Alternate Files With vim-rails
- Always Keep The Gutter Open
- Amend Commits With Fugitive
- Backspace Options
- Beginning And End Of Previous Change
- The Black Hole Register
- Blank Lines Above And Below
- Breaking The Undo Sequence
- Buffer Time Travel
- Build And Install A Go Program
- Case-Aware Substitution With vim-abolish
- Case-Insensitive Substitution
- Center The Cursor
- Check For An Executable
- Check Your Current Color Scheme
- Clear Out The Jump List
- Close All Other Splits
- Close All Other Windows
- Close the Current Buffer
- Coerce The Current Filetype
- Coercing Casing With vim-abolish
- Configure FZF To Use fd For File Finding
- Count the Number of Matches
- Create A New Directory In netrw
- Create A New File In A New Directory
- Creating Non-Existent Directories
- Default netrw To Tree Liststyle
- Delete Every Other Line
- Delete Lines That Match A Pattern
- Delete To The End Of The Line
- Deleting Buffers In BufExplorer
- Deleting Directories Of Files From netrw
- Detect If You Are On A Mac
- Difference Between :wq and :x
- Display Word Count Stats
- Edges Of The Selection
- Edit A File At A Specific Line Number
- Edit A File Starting On The Last Line
- End Of The Word
- Escaping Terminal-Mode In An Nvim Terminal
- Filter Lines Through An External Program
- Find The Nth Character Position In A File
- Fix The Spelling Of A Word
- Fold A Visual Selection And Expand It Back
- For When That Escape Key Is Hard To Reach
- Format Long Lines To Text Width
- From Ruby Variables To JavaScript Variables
- Generate and Edit Rails Migration
- Get The pid Of The Session
- Go Back To The Previous Window
- Go To File With Line Number
- Grepping Through The Vim Help Files
- Head of File Name
- Help For Non-Normal Mode Features
- Highlighting Search Matches
- Horizontal to Vertical and Back Again
- Increment All The Numbers
- Incremental Searching
- Interact With The Alternate File
- Interactive Buffer List
- Joining Lines Together
- Jump Back To The Latest Jump Position
- Jump Between And Stage Git Hunks With Fugitive
- Jump To Matching Pair
- Jump To The Next Misspelling
- List All Buffers
- List autocmds Configured For The Current Buffer
- List Of Plugins
- Load A Directory Of Files Into The Buffer List
- Make Directories For The Current File
- Marks Across Vim Sessions
- Match The Beginning And End Of Words
- Moving To A Specific Line
- Navigate To The Nth Column On A Line
- Navigating By Blank Lines
- NETRW Listing Styles
- Next Modified Buffer
- Normal Node Binding To Just Quit
- Open A Tag In A Split Window
- Open an Unnamed Buffer
- Open FZF Result In A Split
- Open Routes File With vim-rails
- Open The Directory Of The Current File
- Open The Fugitive Git Summary Window
- Open The Gemfile
- Open The Latest Rails Migration
- Open The Selected Lines In GitHub With Gbrowse
- Open Vim To A Tag Definition
- Opening a URL
- Opening Man Pages In Vim
- Paste A Register From Insert Mode
- Preventing Typos with Abbreviations
- Previous Buffer
- Previous Visual Selection
- Print The Relative Path Of The Current File
- Print Version Information
- Quick File Info
- Quick Man Pages
- Quick Quickfix List Navigation
- Quickly Fix A Misspelled Word
- Quickly Switch To A Buffer By Number
- Quit When There Is An Argument List
- Re-indenting Your Code
- Read In The Contents Of A Rails File
- Rename A File Through netrw
- Rename Current File
- Repeat The Previous Change
- Repeating Characters
- Replace A Character
- Reset Target tslime Pane
- Reverse A Group Of Lines
- Rotate Everything By 13 Letters
- Rotate The Orientation Of Split Windows
- Running Bundle With vim-bundler
- Scrolling Relative to the Cursor
- Search Backward Through A File
- Searching For Hex Digits
- Select Several Results From An FZF Search
- Set End Of Line Markers
- Set Your Color Scheme
- Setting Filetype With Modelines
- Show All Syntax Highlighting Rules
- Show Matching Entries For Help
- Specify The Line Height Of The Quick Fix Window
- Split Different
- Split The Current Window
- Splitting For New Files
- Source Original vimrc When Using Neovim
- Swap Occurrences Of Two Words
- Swapping Split Windows
- Swap The Position Of Two Split Windows
- Tabs To Spaces
- The Vim Info File
- Toggle Absolute And Relative Paths In BufExplorer
- Toggling Syntax Highlighting
- Turning Off Search Highlighting
- Unloading A Buffer
- Use Active Window With BufExplorer
- Use The Terminal Inside A Vim Session
- Using vim-surround With A Visual Selection
- Verbose Commits With Fugitive
- View Commit History of a File
- View The Current File In GitHub
- Viewing Man Pages with man.vim
- Vim Without The Extras
- What Is On The Runtime Path?
- Whole Line Auto-Completion
- Wrap With Some Room
- Better Module Imports With Aliases
- Debugging With Full Source Maps
- Run ESLint As A Preloader
- Specify Port Of CRA's Webpack Dev Server
- Use A Specific Config File
- Change Window Name In iTerm
- Convert An ePub Document To PDF On Mac
- Create A Public URL For A Local Server
- Enable Dev Tools For Safari
- Forward Stripe Events To Local Server
- Get Your Public IP Address
- Import A Github Project Into CodeSandbox
- Interactively Kill A Process With fkill
- Open Slack's Keyboard Shortcuts Reference Panel
- Prune The Excess From node_modules
- Rotate An Image To Be Oriented Upright
- Set Recurring Reminders In Slack
- Toggle Between Stories In Storybook
- Update asdf Plugins With Latest Package Versions
- View The PR For The Current GitHub Branch
The .vimrc
file for this project contains a function CountTILs
that can
be invoked with <leader>c
. This will do a substitution count of the
current number of TILs and display the result in the command tray.
I shamelessly stole this idea from
© 2015-2022 Josh Branchaud
This repository is licensed under the MIT license. See LICENSE
for
details.