mirror of
https://github.com/jbranchaud/til
synced 2026-01-20 23:48:02 +00:00
Compare commits
4 Commits
c5127aaaa6
...
750ed05b2e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
750ed05b2e | ||
|
|
d52a126767 | ||
|
|
d9080cc583 | ||
|
|
654c65c8f6 |
@@ -10,7 +10,7 @@ pairing with smart people at Hashrocket.
|
||||
|
||||
For a steady stream of TILs, [sign up for my newsletter](https://crafty-builder-6996.ck.page/e169c61186).
|
||||
|
||||
_1562 TILs and counting..._
|
||||
_1565 TILs and counting..._
|
||||
|
||||
See some of the other learning resources I work on:
|
||||
- [Ruby Operator Lookup](https://www.visualmode.dev/ruby-operators)
|
||||
@@ -334,6 +334,7 @@ See some of the other learning resources I work on:
|
||||
- [Interactively Unstage Changes](git/interactively-unstage-changes.md)
|
||||
- [Keep File Locally With `git rm`](git/keep-file-locally-with-git-rm.md)
|
||||
- [Last Commit A File Appeared In](git/last-commit-a-file-appeared-in.md)
|
||||
- [List All Files Added During Span Of Time](git/list-all-files-added-during-span-of-time.md)
|
||||
- [List All Files Changed Between Two Branches](git/list-all-files-changed-between-two-branches.md)
|
||||
- [List Branches That Contain A Commit](git/list-branches-that-contain-a-commit.md)
|
||||
- [List Commits On A Branch](git/list-commits-on-a-branch.md)
|
||||
@@ -1804,6 +1805,7 @@ See some of the other learning resources I work on:
|
||||
- [Break Justfile Into Separate Hidden Steps](workflow/break-justfile-into-separate-hidden-steps.md)
|
||||
- [Change Window Name In iTerm](workflow/change-window-name-in-iterm.md)
|
||||
- [Configure Email Redirect With Cloudflare](workflow/configure-email-redirect-with-cloudflare.md)
|
||||
- [Control Media With Drop Keyboard](workflow/control-media-with-drop-keyboard.md)
|
||||
- [Convert An ePub Document To PDF On Mac](workflow/convert-an-epub-document-to-pdf-on-mac.md)
|
||||
- [Create A Local Sanity Dataset Backup](workflow/create-a-local-sanity-dataset-backup.md)
|
||||
- [Create A Public URL For A Local Server](workflow/create-a-public-url-for-a-local-server.md)
|
||||
@@ -1814,6 +1816,7 @@ See some of the other learning resources I work on:
|
||||
- [Import A Github Project Into CodeSandbox](workflow/import-a-github-project-into-codesandbox.md)
|
||||
- [Interactively Kill A Process With fkill](workflow/interactively-kill-a-process-with-fkill.md)
|
||||
- [Open Slack's Keyboard Shortcuts Reference Panel](workflow/open-slacks-keyboard-shortcuts-reference-panel.md)
|
||||
- [Pop Videos Out As Picture-in-Picture](workflow/pop-videos-out-as-picture-in-picture.md)
|
||||
- [Prune The Excess From node_modules](workflow/prune-the-excess-from-node-modules.md)
|
||||
- [Rotate An Image To Be Oriented Upright](workflow/rotate-an-image-to-be-oriented-upright.md)
|
||||
- [See Overlaps For A Set Of Time Zones](workflow/see-overlaps-for-a-set-of-time-zones.md)
|
||||
|
||||
49
git/list-all-files-added-during-span-of-time.md
Normal file
49
git/list-all-files-added-during-span-of-time.md
Normal file
@@ -0,0 +1,49 @@
|
||||
# List All Files Added During Span Of Time
|
||||
|
||||
I wanted to get an idea of all the TIL posts I wrote during 2024. Every TIL I
|
||||
write is under version control in a [git repo on
|
||||
github](https://github.com/jbranchaud/til). That means git has all the info I
|
||||
need to figure that out.
|
||||
|
||||
The `git diff` command is a good way at this problem. With the
|
||||
`--diff-filter=A` flag I can restrict the results to just files that were
|
||||
_Added_. And with `--name-only` I can cut all the other diff details out and
|
||||
get just filenames.
|
||||
|
||||
But filenames added to which commits? We need to specify a ref range. There is
|
||||
a ton of flexibility in how you define a ref, including [a date specification
|
||||
suffix](https://git-scm.com/docs/gitrevisions#Documentation/gitrevisions.txt-emltrefnamegtltdategtemegemmasteryesterdayememHEAD5minutesagoem)
|
||||
that points to the value of the ref at an earlier point in time.
|
||||
|
||||
So, how about from the beginning of 2024 to the beginning of 2025:
|
||||
|
||||
```
|
||||
HEAD@{2024-01-01}..HEAD@{2025-01-01}
|
||||
```
|
||||
|
||||
Putting that all together, we this command and potentially a big list of files.
|
||||
|
||||
```bash
|
||||
$ git diff --diff-filter=A --name-only HEAD@{2024-01-01}..HEAD@{2025-01-01}
|
||||
```
|
||||
|
||||
I wanted to restrict the results to just markdown files, so I added a filename
|
||||
pattern.
|
||||
|
||||
```bash
|
||||
$ git diff --diff-filter=A --name-only HEAD@{2024-01-01}..HEAD@{2025-01-01} -- "*.md"
|
||||
```
|
||||
|
||||
I could even go a step further to see only the files added to a specific
|
||||
directory.
|
||||
|
||||
```bash
|
||||
$ git diff --diff-filter=A --name-only HEAD@{2024-01-01}..HEAD@{2025-01-01} -- "postgres/*.md"
|
||||
```
|
||||
|
||||
As a final bonus, I can spit out the github URLs for all those files with a bit of `awk`.
|
||||
|
||||
```bash
|
||||
$ git diff --diff-filter=A --name-only HEAD@{2024-01-01}..HEAD@{2025-01-01} -- "postgres/*.md" |
|
||||
awk '{print "https://github.com/jbranchaud/til/blob/master/" $0}'
|
||||
```
|
||||
21
workflow/pop-videos-out-as-picture-in-picture.md
Normal file
21
workflow/pop-videos-out-as-picture-in-picture.md
Normal file
@@ -0,0 +1,21 @@
|
||||
# Pop Videos Out As Picture-in-Picture
|
||||
|
||||
I recently learned that just about any video playing in Chrome and Firefox can
|
||||
be popped out to a picture-in-picture (PIP) player. A PIP player gives you a sidecar
|
||||
video player window that you can arrange and resize anywhere on your screen. It
|
||||
sits on top of other windows so that you can view it while working from other
|
||||
apps. This is useful if, for instance, you are working through a coding
|
||||
tutorial on youtube.
|
||||
|
||||
For most video players, you can right click on the video and the menu that
|
||||
appears will include a "Picture in Picture" option. Select that and the arrange
|
||||
the player to your liking.
|
||||
|
||||
Youtube overrides right-click. If you right-click, you'll see one menu of
|
||||
Youtube-specific options. Right-click a second time to open the standard
|
||||
browser menu which will include the PIP option.
|
||||
|
||||
I noticed while also testing this on Firefox, that they have a PIP icon that
|
||||
appears as a small overlay on the right side of the video player that you can
|
||||
click as well. This is useful because I found some site's video players were
|
||||
(inadvertently) preventing right-click.
|
||||
Reference in New Issue
Block a user