Skip to content

Instantly share code, notes, and snippets.

Samir Aguiar samiraguiar

Block or report user

Report or block samiraguiar

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@samiraguiar
samiraguiar / docker-destroy-all.sh
Created May 19, 2017 — forked from JeffBelback/docker-destroy-all.sh
Destroy all Docker Containers and Images
View docker-destroy-all.sh
#!/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)
View MacBook Pro Wifi on Fedora 24.md

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 / .gitconfig
Created Jul 29, 2016 — forked from samsalisbury/.gitconfig
Git diff and merge with p4merge (OSX)
View .gitconfig
[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
@samiraguiar
samiraguiar / vimdiff.md
Last active Jun 30, 2016 — forked from mattratleph/vimdiff.md
vimdiff cheat sheet
View vimdiff.md

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 / README.md
Created Jun 22, 2016 — forked from skanev/README.md
Hacky git diff syntax highlighting for the full code
View README.md

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 / git-rcheckout
Last active Apr 20, 2016
Git: recent checked out branches
View git-rcheckout
#!/bin/bash
# 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
samiraguiar / MC Cheat Sheet
Last active Oct 15, 2019 — forked from maciakl/MC Cheat Sheet
Midnight Commander Cheat Sheet
View MC Cheat Sheet
Shortcut Description
---------------------------------------------------------------
C-o Drop to the console
Insert Select/deselect file
C-t Alias for Insert
* Invert selection on files
+ Specify file selection options (including custom pattern)
- The same as above, but for deselecting
F5/F6 Copy/move selected files
You can’t perform that action at this time.