This file contains 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 | |
# Check if both directory name and branch name are provided | |
if [ $# -lt 2 ]; then | |
echo "Usage: $0 <worktree_directory> <branch_name>" | |
exit 1 | |
fi | |
# Set the worktree directory name and branch name | |
WORKTREE_DIR="$1" |
This file contains 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 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 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
/**! 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() |
This file contains 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
import UIKit | |
public class ScrollableStackView: UIView { | |
// MARK: Properties | |
private var didSetupConstraints = false | |
private lazy var scrollView: UIScrollView = { | |
let scrollView = UIScrollView(frame: .zero) |
This file contains 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 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 | |
# 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} |
This file contains 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 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 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"' |
NewerOlder