Skip to content

Instantly share code, notes, and snippets.

@gringoh
gringoh / ffmpeg-rotate-video.md
Last active September 21, 2021 08:50
[ffmpeg: rotate video] #ffmpeg

ffmpeg: Rotate video

ffmpeg -i in.mov -vf "transpose=1" out.mov

For the transpose parameter you can pass:

  • 0 = 90 Counter Clockwise and Vertical Flip (default)
  • 1 = 90 Clockwise
  • 2 = 90 Counter Clockwise
@gringoh
gringoh / git-delete-multiple-branches.md
Created June 15, 2021 11:04
[Git: Delete multiple branches] #git

Delete multiple git branches

Delete all branches with fix prefix

git branch | grep fix | xargs git branch -D

Delete all branches with feat prefix

git branch | grep feat | xargs git branch -D
@gringoh
gringoh / zoom-download-recordings.md
Last active May 12, 2021 13:08
[Zoom. Download recordings] #zoom

How to download zoom recordings

youtube-dl -o output-filename.mp4 --referer "https://zoom.us/" --add-header "Cookie: <Header cookie>" "<General Request URL>"

When you visit the Zoom recording that you want to download.

  • Go to the url of the recording you want to download and open the browsers developer tools by pressing Ctrl + Shift + I or F12.
  • Click on the Network tab on the developer tools
  • Refresh the page Ctrl+R or F5.
  • Search for .mp4 in the search box of the developer tools.
@gringoh
gringoh / macos-restart-audio-service.sh
Last active May 14, 2021 14:32
[MacOS. Restart audio service] #macos
sudo pkill -9 coreaudiod
@gringoh
gringoh / ios-record-simulator-screen.md
Last active October 14, 2021 16:21
[iOS: Record simulator screen] #ios

iOS. Record simulator screen

xcrun simctl io booted recordVideo myVideo.mov

Options

You can specify the following options to the command.

  • --codec Specifies the codec type: "h264" or "hevc". Default is "hevc".
@gringoh
gringoh / ffmpeg-transform-to-mp4-and-resize.md
Last active September 21, 2021 08:50
[ffmpeg: Transform to mp4 and resize to 300px] #ffmpeg

ffmpeg: Transform to mp4 and resize to width=300px

ffmpeg -i input.webm -filter:v scale="300:trunc(ow/a/2)*2" -vcodec h264 -an output.mp4

-an means no sound

@gringoh
gringoh / android-emulator-reduce-cpu-usage.md
Last active September 22, 2024 11:39
[Android: Android emulator. Reduce CPU usage on MacOS] #android

Android emulator. Reduce CPU usage on MacOS

I wasn't able to shut the audio off with the config.ini file, but only with the -noaudio cmd line argument to qemu. However, with Android Studio 3.2, you can't add custom arguments to the emulator, so I made this:

In the emulator dir of the Android SDK, in my case ~/Android/Sdk/emulator/

mv emulator emulator.orig Make a bash script called emulator with the content:

#!/bin/bash
@gringoh
gringoh / git-rebase.md
Last active July 22, 2024 14:07
[Git: Rebase] #git

Git: Rebase

From your feature branch:

git fetch
git rebase origin/master

If any conflict shall arise, resolve them one by one. Once all conflicts are dealt with:

git rebase --continue
@gringoh
gringoh / dart-create.md
Last active July 25, 2022 16:08
[Dart: Create project] #dart

Dart: Create project

dart create -t console-simple project_name

Available templates:

  • console-simple: A simple command-line application. (default)
  • console-full: A command-line application sample.
  • package-simple: A starting point for Dart libraries or applications.
  • web-simple: A web app that uses only core Dart libraries.
@gringoh
gringoh / flutter-create.md
Last active June 22, 2021 15:58
[Flutter: Create project, library or plugin] #flutter

Flutter: Create project, library or plugin

  • create project
flutter create --org com.example.project.name  --androidx -i swift -a kotlin --description 'Description goes here' flutter_project_name
  • create library/package
flutter create --org com.example.package.name  --description 'Description goes here' --template=package flutter_package_name
  • create plugin