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
public extension View { | |
func onFirstAppear(_ action: @escaping () -> ()) -> some View { | |
modifier(FirstAppear(action: action)) | |
} | |
} | |
private struct FirstAppear: ViewModifier { | |
let action: () -> () | |
// Use this to only fire your block one time |
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
import SwiftUI | |
struct ContentView: View { | |
@State private var contentHeight: CGFloat = 0 | |
@State private var showsSheet = false | |
@State private var fontSize: CGFloat = 50 | |
var body: some View { | |
VStack(spacing: 20) { | |
Text("onGeometryChange example") |
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
{ | |
config, | |
pkgs, | |
... | |
}: { | |
imports = [ | |
# Include the results of the hardware scan. | |
./hardware-configuration.nix | |
]; |
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
echo " | |
alias ls='ls -la' | |
alias update='sudo apt update' | |
alias c='clear' | |
alias n='nano' | |
alias py='python3' | |
alias s='sudo' | |
" >> ~/.bashrc && source ~/.bashrc |
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
# Blocklist by @codedbydan | |
adtago.s3.amazonaws.com | |
analyticsengine.s3.amazonaws.com | |
analytics.s3.amazonaws.com | |
advice-ads.s3.amazonaws.com | |
advertising-api-eu.amazon.com | |
ads30.adcolony.com | |
adc3-launch.adcolony.com | |
events3alt.adcolony.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
from venmo_api import Client | |
# Authentication (replace with your credentials) | |
access_token = "ACCESS_TOKEN_HERE" | |
# get user id from user input | |
user_id = input("Enter user id: ") | |
# Initialize API client | |
client = Client(access_token=access_token) |
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
defaults write com.apple.dt.Xcode ShowBuildOperationDuration YES |
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
brew install swift-sh; curl https://raw.githubusercontent.com/dan-hart/sh/main/createSwiftScript.sh?token=GHSAT0AAAAAAB246YAPWKNBL5CIDXU52WJEY5UT4ZA > createSwiftScript.sh; chmod +x createSwiftScript.sh; sh createSwiftScript.sh Hello |
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
echo 0 | sudo tee /sys/class/leds/led1/brightness > /dev/null |
NewerOlder