Skip to content

Instantly share code, notes, and snippets.

@gringoh
gringoh / git-sync-forked-copy-with-original-repo.md
Created May 28, 2024 11:31
[Git: Sync forked copy with original] #git

Sync forked copy with original

Add the remote, call it "upstream":

git remote add upstream https://github.com/whoever/whatever.git

Fetch all the branches of that remote into remote-tracking branches

@gringoh
gringoh / git-list-ignored-file-list.md
Created May 27, 2024 18:51
[Git: List ignored file list] #git
@gringoh
gringoh / zsh-configuration.md
Last active May 27, 2024 18:31
[ZSH Configuration]

Common PATH configurations

export PATH="/usr/local/opt/ruby/bin:$PATH"

# Android
export PATH="$PATH:$HOME/Library/Android/sdk"
export PATH="$PATH:$HOME/Library/Android/sdk/platform-tools"
#export PATH="$PATH:$HOME/Development/extras/gradle/bin"
@gringoh
gringoh / git-squash-multiple-commits.md
Created March 21, 2024 16:13
[Git: Squash multiple commits into one] #git

Squash multiple commits into one

To squash multiple commits into one, you can use Git's interactive rebase feature. Here's how you can do it:

  • Open your terminal or command prompt.
  • Navigate to your Git repository using the cd command if you're not already in the repository.
  • Run the following command to start an interactive rebase:
git rebase -i HEAD~9
@gringoh
gringoh / git-remotes-management.md
Created June 30, 2022 16:50
[Git: remotes management] #git

Remotes management

Add remote to a local repository

git remote add origin git@github.com:emanuelnlopez/dart-exercism-exercises.git

Add remote to a local repository when using a custom ssh key

git remote add origin git@personal-github:emanuelnlopez/dart-exercism-exercises.git
@gringoh
gringoh / flutter-dart-clean-cache.md
Last active April 25, 2022 16:30
[Clean Dart & Flutter cache] #dart #flutter

Flutter & Dart: Clean cache

dart pub cache clean
flutter pub cache clean
@gringoh
gringoh / flutter-run-web-app.md
Created December 2, 2021 13:28
[Flutter: Run web app] #flutter

Flutter: Run web app

open -n -a /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --args --user-data-dir="/tmp/chrome_dev_test8" --disable-web-security

flutter run -d web-server --web-port 9000
@gringoh
gringoh / mov-to-mp4.md
Last active August 16, 2023 21:04
[ffmpeg: mov-to-mp4] #ffmpeg

ffmpeg: Convert .mov to .mp4

ffmpeg -i input.mov -vcodec h264 -an output.mp4

ffmpeg: Reduce video size with minimal quality loss

ffmpeg -i input.mpg -c:v libx265 -crf 23 -preset medium -c:a aac -b:a 128k output.mp4
@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

@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:TOKEN@github.com"

source: cli/cli#1326