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
package main | |
import ( | |
"strings" | |
) | |
func main() { | |
strings.HasPrefix("foobar", "foo") // true | |
} |
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
export DISPLAY=$(powershell.exe -Command '(Get-NetIPAddress -AddressFamily IPv4 | Where-Object {$_.AddressState -eq "Preferred" -and ($_.InterfaceAlias -eq "Wi-Fi" -or $_.InterfaceAlias -eq "Ethernet")}).IPAddress' | sed 's/.$//'):0.0 | |
export LIBGL_ALWAYS_INDIRECT=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 | |
if [ -d "$1" ]; then # If the directory exists | |
if [ "$(ls -A $1)" ]; then | |
# The directory exists & contains files | |
echo "$1 is not empty. Exiting." | |
exit 0 | |
else | |
# The directory exists & is empty | |
rmdir $1 | |
fi |