Skip to content

Instantly share code, notes, and snippets.

@samiraguiar
samiraguiar / .gitconfig
Created July 29, 2016 04:14 — forked from samsalisbury/.gitconfig
Git diff and merge with p4merge (OSX)
[merge]
keepBackup = false
tool = p4merge
[mergetool "p4merge"]
cmd = /Applications/p4merge.app/Contents/Resources/launchp4merge "\"$PWD/$BASE\"" "\"$PWD/$REMOTE\"" "\"$PWD/$LOCAL\"" "\"$PWD/$MERGED\""
keepTemporaries = false
trustExitCode = false
keepBackup = false
[diff]
tool = p4merge

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

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

@samiraguiar
samiraguiar / docker-destroy-all.sh
Created May 19, 2017 02:09 — forked from JeffBelback/docker-destroy-all.sh
Destroy all Docker Containers and Images
#!/bin/bash
# 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)
@samiraguiar
samiraguiar / README.md
Created June 22, 2016 20:12 — forked from skanev/README.md
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
samiraguiar / vimdiff.md
Last active July 2, 2021 16:10 — forked from mattratleph/vimdiff.md
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
samiraguiar / MC Cheat Sheet
Last active March 15, 2024 14:05 — 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