Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / 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 / macos-restart-audio-service.sh
Last active May 14, 2021 14:32
[MacOS. Restart audio service] #macos
sudo pkill -9 coreaudiod
@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 / 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 / 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 / github-cli-authentication.md
Last active October 22, 2021 12:03
[GitHub CLI: Setup after authentication] #git
$ gh config set git_protocol https -h github.com
$ gh auth status --show-token  # <== copy your authentication token

$ git credential reject <<<"url=https://github.com"
$ git credential approve <<<"url=https://USER:[email protected]"

source: cli/cli#1326

@gringoh
gringoh / scrcpy-select-device.md
Last active August 31, 2023 11:29
[scrcpy: Select device] #android #scrcpy

scrcpy: Select device

scrcpy --serial 0123456789abcdef 
scrcpy -s 0123456789abcdef # short

Record screen with no audio