curl -sLk https://gist.github.com/raw/1592103/.gitconfig._run | sh -s --
It doesn't add anything if a section already exists.
| ! priority. | |
| ^ calendar | relatives. | |
| # tags. | |
| @ contact. | |
| [ mood. | |
| = location. | |
| ~ duration estimate. | |
| * repeating. | |
| / link. |
| #!/bin/sh -x | |
| [ "${SUDO_USER}" -a `id -u` -eq 0 ] || { | |
| \sudo ${0} | |
| \rm -f ${0} | |
| exit $? | |
| } | |
| \rm -r /Library/Frameworks/Mono.framework | |
| \rm -r /Library/Receipts/MonoFramework-* | |
| for dir in /usr/bin /usr/share/man/man1 /usr/share/man/man3 /usr/share/man/man5; do |
| #!/bin/bash | |
| # Just: | |
| # curl -kOs https://raw.github.com/gist/1536232/randomness.sh; chmod +x randomness.sh; ./randomness.sh | |
| # I know, it seems pointless but it's just a simple example of how to: | |
| # 1. Compile against a Framework on Mac OS. | |
| # 2. Mix sources. | |
| # 3. Determine if a script is sourced or executed directly. | |
| sourced() { [ 'bash' == $0 ] || [ ${BASH_SOURCE[0]} != $0 ]; } | |
| ( |
| sourced() { [ 'bash' == "${0:-i}" ] || [ "${BASH_SOURCE[0]}" != "${0:-i}" ]; } | |
| # Example: | |
| # sourced && return 0 || exit 0 | |
| # For some reason, this function needs to be defined in the same context in which it's used. |
| #!/bin/bash | |
| # Run using: | |
| # curl -Lks https://raw.github.com/gist/1543040/nodepy.sh | sh | |
| # Increase the iterations using: | |
| # curl -Lks https://raw.github.com/gist/1543040/nodepy.sh | it=100000000 sh | |
| it=${it:-10000000} | |
| echo it=${it} $0 | |
| trap 'rm -f pi{,2,3}.{py,java,class,js}' 0 |
| #!/bin/sh | |
| # To run using my bundles (https://raw.github.com/gist/1549404/tmbundles.txt): | |
| # curl -ks https://raw.github.com/gist/1549404/tmbundles.sh | sh | |
| # To use bundles listed in another gist: | |
| # curl -ks https://raw.github.com/gist/1549404/tmbundles.sh | FILE=1549404/tmbundles.txt sh | |
| # Just replace "1549404/tmbundles.txt" with another bundle list | |
| ( | |
| cd ~/Library/Application\ Support/TextMate/Bundles || exit $? |
| /* | |
| curl -kOs https://raw.github.com/gist/1550857/vac.m && cc -framework Cocoa -o vac vac.m && ./vac | |
| For http://stackoverflow.com/questions/8693810/objective-c-possible-shorter-if-notation | |
| Variadic function and NSComparator example. | |
| */ | |
| #import <Cocoa/Cocoa.h> | |
| #import <stdarg.h> | |
| #import <stdio.h> | |
| // This is just a simple object equality comparator. |
| #!/bin/sh | |
| # curl -ks https://gist.github.com/raw/1592071/dock-spacer.sh | sh | |
| defaults write com.apple.dock persistent-apps -array-add '{"tile-type"="spacer-tile";}' |
| #!/bin/sh | |
| # curl -ks https://raw.github.com/gist/1622342/pkgutil-expand.sh | sh -s *.pkg | |
| for i in $(ls ${*:-*.pkg}); do pkgutil --expand ${i} $(basename ${i} .pkg); done |