Skip to content

Instantly share code, notes, and snippets.

View cosmincatalin's full-sized avatar
👻

Cosmin Catalin SANDA cosmincatalin

👻
View GitHub Profile
@cbzehner
cbzehner / Cargo.toml
Last active September 20, 2023 08:27
Prompt for missing values in Clap
[package]
name = "clap_prompt_example"
version = "0.1.0"
edition = "2021"
[dependencies]
clap = { version = "3.1", features = ["derive"] }
dialoguer = "0.10"
@sandipchitale
sandipchitale / rewritehistory-main.sh
Last active October 1, 2023 22:25
Collapse all history of git repo. #git
git checkout --orphan onetime
git add -A
git commit -m "Initial commit"
git branch -D main
git branch -m main
git gc --aggressive --prune=all
git push -f origin main
@mitchwongho
mitchwongho / Docker
Last active November 29, 2023 06:36
Docker 'run' command to start an interactive BaSH session
# Assuming an Ubuntu Docker image
$ docker run -it <image> /bin/bash
@colorful-tones
colorful-tones / ClearDNSCache
Created June 11, 2013 14:40
clear dns cache on mac via Terminal or iTerm
sudo killall -HUP mDNSResponder
@lttlrck
lttlrck / gist:9628955
Created March 18, 2014 20:34
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@CristinaSolana
CristinaSolana / gist:1885435
Created February 22, 2012 14:56
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream