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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>name</key> | |
<string>idleFingers</string> | |
<key>settings</key> | |
<array> | |
<dict> | |
<key>settings</key> |
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 | |
# NOTE: If you use a git remote that's named something other than "origin", | |
# you will need to edit the $GIT_REMOTE var below: | |
GIT_REMOTE="origin" | |
git_add() { | |
if [ $# = 0 ]; then | |
git add -A |
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
# Set the prompt text (<prompt>$ ) | |
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then | |
debian_chroot=$(cat /etc/debian_chroot) | |
fi | |
# <user>:<cwd>$ | |
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u:\[\033[01;34m\]\w\[\033[00m\]\$ ' | |
# Start the ssh-agent if it's not running so you don't need to keep | |
# typing your password for things like git |
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
adclick.g.doublecklick.net | |
adeventtracker.spotify.com | |
ads-fa.spotify.com | |
analytics.spotify.com | |
audio2.spotify.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
# Declare `foo` to be a string variable. | |
foo = "bar" # type: str | |
# Type error! | |
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
# Old type comments: | |
foo = "bar" # type: str | |
# New type hints for Python 3.5+: | |
foo: str = "bar" |
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
pip install mypy | |
# Check a single file | |
mypy script.py | |
# Check a folder | |
mypy src/ | |
# Check a package | |
mypy -p my_package |
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
# Declare a variable and use it later. | |
foo: int | |
# ... | |
foo = 5 | |
# Add type hints for function arguments and return types. | |
def say_hello(name: str) -> str: | |
return f"Hello {name}!" |
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
# If you want to stop your system from automatically switching audio devices, | |
# there is a simple edit to your PulseAudio config to disable that feature. | |
# Open PulseAudio config | |
sudo vim /etc/pulse/default.pa | |
# Comment out the line with "load-module module-switch-on-connect" | |
# Restart PulseAudio | |
pulseaudio -k |
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
// ParseFieldName takes a reflected struct field and returns the JSON name for the field, | |
// as well if the field is ignored by JSON (using `json:"-"`). | |
func ParseFieldName(f reflect.StructField) (name string, ignore bool) { | |
tag := f.Tag.Get("json") | |
if tag == "" { | |
return f.Name, false | |
} | |
if tag == "-" { |
OlderNewer