Skip to content

Instantly share code, notes, and snippets.

samiraguiar /
Created May 19, 2017 02:09 — forked from JeffBelback/
Destroy all Docker Containers and Images
# Stop all containers
docker stop $(docker ps -a -q)
# Delete all containers
docker rm $(docker ps -a -q)
# Delete all images
docker rmi $(docker images -q)

The current kernel/drivers of Fedora 24 do not support the Wifi chip used on my Mac Book Pro. Proprietary Broadcom drivers are packaged and available in the rpmfusion repo.

Verify that your card is a Broadcom using: lspci -vnn -d 14e4:

Sample output:

02:00.0 Network controller [0280]: Broadcom Corporation BCM4360 802.11ac Wireless Network Adapter [14e4:43a0] (rev 03)


Install the rpmfusion repo, note only "nonfree" is required, as the Broadcom Driver is proprietry:

samiraguiar / .gitconfig
Created July 29, 2016 04:14 — forked from samsalisbury/.gitconfig
Git diff and merge with p4merge (OSX)
keepBackup = false
tool = p4merge
[mergetool "p4merge"]
cmd = /Applications/ "\"$PWD/$BASE\"" "\"$PWD/$REMOTE\"" "\"$PWD/$LOCAL\"" "\"$PWD/$MERGED\""
keepTemporaries = false
trustExitCode = false
keepBackup = false
tool = p4merge
samiraguiar /
Last active July 2, 2021 16:10 — forked from mattratleph/
vimdiff cheat sheet

vimdiff cheat sheet

##git mergetool

In the middle file (future merged file), you can navigate between conflicts with ]c and [c.

Choose which version you want to keep with :diffget //2 or :diffget //3 (the //2 and //3 are unique identifiers for the target/master copy and the merge/branch copy file names).

:diffupdate (to remove leftover spacing issues)

:only (once you’re done reviewing all conflicts, this shows only the middle/merged file)

samiraguiar /
Created June 22, 2016 20:12 — forked from skanev/
Hacky git diff syntax highlighting for the full code

Hacky syntax highlighting in git diff

Normally git diff would color additions green and deletions red. This is cool, but it would be even cooler if it adds syntax highlighting to those lines. This is a git pager that does so.

It parses the diff output and picks up the SHAs of files with additions and deletions. It uses [CodeRay][coderay] to highlight each file and then it extracts the lines that are shown in the diff. It then uses [term/ansicolor][color] to make a gradient from the CodeRay color and the diff color (red for deletion, green for addition) and uses it to replace the original.

I tried using rugged instead of shelling out to git show – it was faster overall, but it did incur a noticeable start up time.

Check out the image below for a demo.

samiraguiar / git-rcheckout
Last active April 20, 2016 13:30
Git: recent checked out branches
# Outputs in the format (most recent at the bottom)
# (2016-04-15T16:08:25) branch1 -> branch2
# (2016-04-15T16:08:25) branch2 -> branch1
# (2016-04-15T16:08:25) branch2 -> branch3
git reflog --pretty="%aI %gs" | grep 'checkout: moving from' | sort | awk '{ printf "(%.19s) %-30.30s -> %s\n", $1, $5, $7}'
samiraguiar / MC Cheat Sheet
Last active May 20, 2024 12:17 — forked from maciakl/MC Cheat Sheet
Midnight Commander Cheat Sheet / Shortcuts
Note for newcomers:
In the shortcuts below, "C" stands for CTRL and "A" stands for "ALT". This is a convention
used in the Midnight Commander documentation and was kept here.
You can also use "ESC" instead of "ALT", which is useful on Macbooks.
Main View
- File/directory operations