Skip to content

Instantly share code, notes, and snippets.

View brunogama's full-sized avatar
🏠
Working from home

Bruno Gama brunogama

🏠
Working from home
  • Banco Inter
  • Brazil
  • 20:12 (UTC -03:00)
  • X @brunogama
View GitHub Profile
@brunogama
brunogama / nuke-xcinstall.sh
Last active January 17, 2023 13:56
XCInstall cleaner
#!/bin/bash
FIRST_APP_ON_XC_INSTALL=$(find ~/Library/Developer/Xcode/DerivedData \
-path "*/Build/Products/*/.XCInstall/*.app" \
-type d \
-maxdepth 6 \
-print \
-quit \
-exec dirname {} \;)
CLEAN=${FIRST_APP_ON_XC_INSTALL%/*}
@brunogama
brunogama / .gitconfig
Created November 23, 2022 10:17 — forked from codexico/.gitconfig
git alias
# https://gist.github.com/codexico/2a34c0d599f3af93b46f
[color]
# Use colors in Git commands that are capable of colored output when
# outputting to the terminal. (This is the default setting in Git ≥ 1.8.4.)
ui = auto
[color "branch"]
/**! Currently these two cause this warning:
This NSLayoutConstraint is being configured with a constant that exceeds internal limits.
A smaller value will be substituted, but this problem should be fixed.
Break on BOOL _NSLayoutConstraintNumberExceedsLimit(void) to debug. This will be logged only once.
This may break in the future.
*/
extension UIStackView {
/// A vertical spacer view that will expand to fill the available space
fileprivate func verticalSpacer() -> UIView {
let v = UIView()
@brunogama
brunogama / ScrollableStackView.swift
Created August 11, 2022 12:34 — forked from eMdOS/ScrollableStackView.swift
Scrollable Stack View
import UIKit
public class ScrollableStackView: UIView {
// MARK: Properties
private var didSetupConstraints = false
private lazy var scrollView: UIScrollView = {
let scrollView = UIScrollView(frame: .zero)
pihole -w clients4.google.com
pihole -w clients2.google.com
pihole -w s.youtube.com
pihole -w video-stats.l.google.com
pihole -w www.googleapis.com
pihole -w youtubei.googleapis.com
pihole -w oauthaccountmanager.googleapis.com
pihole -w android.clients.google.com
pihole -w reminders-pa.googleapis.com firestore.googleapis.com
pihole -w gstaticadssl.l.google.com
@brunogama
brunogama / subcheckout
Created January 5, 2022 20:58 — forked from yoeunes/subcheckout
An alternative to "git submodule foreach --recursive git checkout develop"
#!/bin/bash
# add this function to your .bashrc or .zshrc and then run "source ~/.zshrc"
# - subcheckout param1 param2
# by default subcheckout will change to develop in every submodule
# if you pass a first parameter it will checkout to that branch if exist on submodule
# if you pass a second parameter as default branch if the first branch not exists
function subcheckout() {
branch=${1:-develop}
@brunogama
brunogama / functions.sh
Created December 8, 2021 00:21 — forked from junegunn/functions.sh
Key bindings for git with fzf (https://junegunn.kr/2016/07/fzf-git/)
# GIT heart FZF
# -------------
is_in_git_repo() {
git rev-parse HEAD > /dev/null 2>&1
}
fzf-down() {
fzf --height 50% --min-height 20 --border --bind ctrl-/:toggle-preview "$@"
}
Setup a Static IP Address
Questions about setting Static IP Address are among the most common on this site. There are very many tutorials (many wrong, obsolete or incomplete).
If the reason you are contemplating a Static IP Address is you want your Pi to be assigned a predictable IP Address you can request the DHCP server to assign one.
E.g. Adding the following to /etc/dhcpcd.conf will request an address on wlan0 and on eth0.
interface wlan0
request 10.1.2.99
interface eth0
@brunogama
brunogama / clear-carthage.sh
Last active March 24, 2021 13:02
Clears carthage http cache
sqlite3 ~/Library/Caches/carthage/Cache.db 'DELETE from cfurl_cache_response where request_key like "%.json"'
@brunogama
brunogama / process.sh
Created January 21, 2021 19:44 — forked from krzysztofzablocki/process.sh
3rd party tooling processing script
#!/bin/zsh
cd "$(dirname "$0")/.."
if [[ -n "$CI" ]] || [[ $1 == "--fail-on-errors" ]] ; then
FAIL_ON_ERRORS=true
echo "Running in --fail-on-errors mode"
ERROR_START=""
COLOR_END=""
INFO_START=""