Skip to content

Instantly share code, notes, and snippets.

Get a list of branches
for remote in `git branch -r `; do git branch --track $remote; done
Remove merged remote branches
git branch --merged master | grep -v master | cut -d/ -f2- | xargs -n 1 git push --delete origin
Remove merged local branches
@phackwer
phackwer / XGH - en.txt
Created April 1, 2019 13:21 — forked from banaslee/XGH - en.txt
eXtreme Go-Horse Process
eXtreme Go Horse (XGH) Process
Source: http://gohorseprocess.wordpress.com
1. I think therefore it's not XGH.
In XGH you don't think, you do the first thing that comes to your mind. There's not a second option as the first one is faster.
2. There are 3 ways of solving a problem: the right way, the wrong way and the XGH way which is exactly like the wrong one but faster.
XGH is faster than any development process you know (see Axiom 14).
Selecione para inspecionar qq item na tela que esteja no escopo da controller e rode o seguinte comando no console:
var scope = angular.element($0).scope()
Agora vc pode usar a scope e ateh modificar os arrays manualmente
The pre-installed GNOME Calculator in Ubuntu 18.04 is a snap application which may lack some features provided by the traditional one due to restrictions of snap packages.
Remove the snap application by running
snap remove gnome-calculator
and install the traditional apt one by running
sudo apt install gnome-calculator
You may need to to restart GNOME shell by hitting Alt+F2, then typing r and pressing Enter for it to take effect.
@phackwer
phackwer / gist:9f9db7bc95396a48b240f5c3a42cf944
Last active August 17, 2020 13:09
Undervolting linux ubuntu 18.04 (XPS 9570 i9 32GB RAM)
Very useful for the i9 XPS 9570 overheating on Linux. Since I use Linux for development, I don't use the nvidia that comes
with the note and also don't need turboboost enabled, even running dozens of docker containers. I was having problems with
temperature. Notebook was getting so hot it was hard to type for more than 4 hours straight.
Here are my temperatures before undevolting:
phackwer@phackwer-XPS-15-9570 ~/P/p/poc> sensors
coretemp-isa-0000
Adapter: ISA adapter
Package id 0: +53.0°C (high = +100.0°C, crit = +100.0°C)
https://medium.com/@tomwwright/better-battery-life-on-ubuntu-17-10-4588b7f72def
https://www.dell.com/community/Inspiron/Suspend-resume-problems-on-Ubuntu-18-04/td-p/6072410
https://github.com/iberianpig/fusuma
https://martys.typepad.com/blog/2015/08/3-finger-drag-on-linux.html
https://askubuntu.com/questions/744364/displaylink-asus-mb168b-issues
@phackwer
phackwer / gist:87deef5def375867fb4875e05e838e90
Created November 17, 2018 21:45
Windows on external SSD on Macbook
DISCLAIMER: If you found this article you are either me (duh) or clever enough to use Google to find it and find all missing
pieces of information that you are still not aware about. I DON'T DO FREE SUPPORT OTHER THAN WHAT I NEED TO MYSELF AND MAKE
PUBLICLY AVAILABLE!
1 - Install Virtual Box, get an ISO copy of windows installation and open Bootcamp on Mac (Action > Download drivers) to get
the drivers for windows
2 - Create a "ramdisk" that will actually point to your external ssd. For this you need to know the disk (you
can simply type mount on terminal and figure out the disk number by yourself). After you know the number, type this in
terminal:
@phackwer
phackwer / gist:320e59b3c1569debeb07dc825c7e8df6
Created September 19, 2018 23:14
Higher resolution by scaling on low resolution screes
phackwer@phackwer-X540SA ~> xrandr --output eDP-1 --mode 1366x768 --scale-from 1650x900 --panning 1650x900
phackwer@phackwer-X540SA ~> xrandr --output eDP-1 --mode 1366x768 --scale-from 1920x1080 --panning 1920x1080
@phackwer
phackwer / gist:5b5628aff011eb853639d35613b625ce
Last active June 4, 2021 08:52
Remove purple from Ubuntu 16.04
Remove grub background color:
16.04 and later:
sudo -H gedit /usr/share/plymouth/themes/ubuntu-logo/ubuntu-logo.grub
17.10 and later:
sudo -H gedit /usr/share/plymouth/themes/default.grub
@phackwer
phackwer / Rancher.md
Created September 12, 2018 17:06 — forked from lmmendes/Rancher.md
Running Rancher locally (with two hosts) using MacOS Docker and VirtualBox

Rancher

Rancher is an open source project that provides a complete platform for operating Docker in production. It provides infrastructure services such as multi-host networking, global and local load balancing, and volume snapshots.

This documentation describes how to run Rancher localy for development and evaluation propuses.

I'm using Docker for OSX (native) but even for this to work you will need to install VirtualBox.

Launching Management Rancher Server