- httpss://bruno.foundation
- @brunogama
- in/brunogama
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// FROM SWIFTLINT | |
import Dispatch | |
import Foundation | |
private let outputQueue: DispatchQueue = { | |
let queue = DispatchQueue( | |
label: "io.realm.swiftlint.outputQueue", | |
qos: .userInteractive, | |
target: .global(qos: .userInteractive) | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final class Box<Type> { | |
var value: Type | |
init(_ value: Type) { | |
self.value = value | |
} | |
} | |
extension Box: CustomStringConvertible where Type: CustomStringConvertible { | |
var description: String { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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%/*} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 "$@" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sqlite3 ~/Library/Caches/carthage/Cache.db 'DELETE from cfurl_cache_response where request_key like "%.json"' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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="" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[alias] | |
# full status | |
rstatus = !sh -c 'git status -sb --ignore-submodules=dirty && git submodule foreach --recursive git status -sb --ignore-submodules=dirty' - | |
rstatus-no-subs = !sh -c 'git status -sb --ignore-submodules=all && git submodule foreach --recursive git status -sb --ignore-submodules=all' - | |
s = !sh -c 'git rstatus-no-subs' - | |
# fetches all modules | |
rfetch = !sh -c 'git fetch && git submodule foreach --recursive git fetch' - | |
# updates project and all submodules | |
r-fetch-pull-merge = !sh -c 'git rfetch && git submodule foreach --recursive git merge && git merge && git s' - | |
r-fetch-pull-rebase = !sh -c 'git rfetch && git submodule foreach --recursive git rebase && git rebase && git s' - |