#status/in_progress
rel:: [[030 Interests MOC]] | [[PKM|PKM MOC]]
# Tech Workflows MOC
## Misc Tips and Tricks
### Convert MOV to GIF
from [stack overflow](https://superuser.com/a/836349)
```
brew install ffmpeg gifsicle
ffmpeg -i input.mp4 -pix_fmt rgb24 -r 10 output.gif
# optimize frames
convert input.gif -verbose -coalesce -layers OptimizeFrame input_optframe.gif
# And use gifsicle to make final optimization:
gifsicle -O2 input_optframe.gif -o optimized.gif
```
- [ffmpeg.lav.io](https://ffmpeg.lav.io/) - A tool to help you explore [FFmpeg](https://www.ffmpeg.org/) filters.
### Downloading a youtube mkv video
```bash
# sometimes downloads an mkv video
youtube-dl "https://..."
# simple convert to mp4
ffmpeg -i input.mkv -c copy output.mp4
# strip subtitles, negative mapping
ffmpeg -i input.mkv -map 0 -map -0:s -c copy output.mp4
# re-encode audio to a more comatible format, aac
ffmpeg -i input.mkv -map 0 -c copy -c:a aac output.mp4
```
### Find Recently Edited Files
```bash
find . -not -path "./.git/*" -not -path "./.obsidian/*" -type f -printf '%T+\t%p\n' | sort -n
```
### Blocking Promoted Ads on Twitter
#### Brave/uBlock
1. go to [brave adblock configuration](brave://adblock/)
2. add a line to *Custom Filters*
```
twitter.com##[data-testid="placementTracking"] article
twitter.com##[data-testid="tweet"]:has-text(/Promoted$/)
twitter.com##[data-testid="tweet"]:has-text(/^Promoted by/)
twitter.com##[data-testid="UserCell"]:has-text(/Promoted$/)
twitter.com##[data-testid="UserCell"]:has-text(/^Promoted by/)
```
#### Safari (1Blocker)
1. Custom > Hide Elements (on) > + New Rule
2. New Rule
1. Scope to: twitter.com and subdomains
2. CSS Selector: add css selectors
```css
div[data-testid="placementTracking"] article
div[data-testid="tweet"]:has-text(/Promoted$/)
div[data-testid="tweet"]:has-text(/^Promoted by/)
div[data-testid="UserCell"]:has-text(/Promoted$/)
div[data-testid="UserCell"]:has-text(/^Promoted by/)
```
### Bulk-unlike tweets
1. go to profile
2. likes tab
3. copy/paste following into developer console
```javascript
setInterval(() => {
for (const d of document.querySelectorAll('div[data-testid="unlike"]')) {
d.click()
}
window.scrollTo(0, window.pageYOffset+300)
}, 10000)
```
### Route Links to Different Browser Profiles
#### Reference
- [Finicky Configuration docs](https://github.com/johnste/finicky/wiki/Configuration)
#### Setup
1. install [finicky](https://github.com/johnste/finicky)
- `brew install finicky` on [[MacOS]]
2. Launch _Finicky.app_. When prompted, choose _Finicky_ as your default browser so links route through it.
3. Click the status bar icon, **Config / Create New ...** ![[CleanShot 2022-09-14 at 12.30.39@2x.png]]
4. By default, it creates a config at `~/.finicky.js`. You can instead put it at `~/.config/finicky/finicky.js` (recommended)
5. [Example Configurations](https://github.com/johnste/finicky#example-configuration)
> [!note]
> Finding the exact name for your Chrome browser profile is tricky because it isn't what you see in the chrome profile switcher. Find it by
>
> 1. switching to the profile you want
> 2. visiting [chrome://version](chrome://version) and finding the **Profile Path**.
>
>
> If the path is `/Users/dave/Library/Application Support/BraveSoftware/Brave-Browser/Profile 2`, the profile name is `Profile 2`
6. The config should auto-reload on save. If it doesn't manually reload the config from the status bar: **Config / Reload**
#### Single Sign-On Click
```javascript
// ==UserScript==
// @name Single Sign-On Click
// @namespace [http://tampermonkey.net/](http://tampermonkey.net/)
// @version 0.1
// @description auto-click single sign on button
// @author pmbauer
// @match [https://github.com/DataDog/*](https://github.com/DataDog/*)
// @grant none
// ==/UserScript==
(function() {
'use strict';
if (document.querySelector('body.session-authentication')) {
document.querySelector('button.btn-primary').click();
}
})();
```