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
| #!/bin/bash | |
| /usr/bin/osascript << EOF | |
| property compName : "" | |
| repeat while compName is "" | |
| tell application "Finder" | |
| activate | |
| display dialog "What should this computer be named:" default answer compName |
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
| for ppd in ./*; do | |
| { rm "${ppd}" && awk '/^\*DefaultDuplex/{ sub(/DuplexNoTumble/,"None") }; { print }' > "${ppd}"; } < "${ppd}" | |
| done |
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
| #!/bin/bash | |
| shopt -s extglob | |
| compname=$(scutil --get ComputerName) | |
| if [[ "${compname}" = "NIMC-ML-CKOUT" ]]; then | |
| exit 0 | |
| elif [[ "${compname%%-*}" = +([[:alpha:]]) ]]; then | |
| /usr/sbin/spctl --master-disable |
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 urllib2, urlparse, sys, webbrowser | |
| itags = {'45': 'webm_720p', | |
| '44': 'webm_480p', | |
| '43': 'webm_360p', | |
| '38': 'mp4_3072p', | |
| '37': 'mp4_1080p', | |
| '36': 'phone_mp4_240p', | |
| '35': 'flv_480p', | |
| '34': 'flv_360p', |
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 requests, random, datetime, sys, webbrowser, console | |
| def main(): | |
| song_page = None | |
| if (len(sys.argv) > 0): | |
| try: | |
| song_page = sys.argv[1] | |
| except Exception: | |
| song_page = None | |
| if not song_page: |
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 requests | |
| import webbrowser | |
| from bs4 import BeautifulSoup | |
| page = requests.get('http://xkcd.com') | |
| soup = BeautifulSoup(page.text) | |
| comic = soup.find(id='comic').img['src'] | |
| webbrowser.open(comic) |
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
| while read -r -d $'\0'; do | |
| mv "$REPLY" "${REPLY%.*}.md" | |
| done < <(find $HOME/Dropbox/notes -type f -iname "*.txt" -print0) |
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
| # Banner-style (default) | |
| from Foundation import NSUserNotification, NSUserNotificationCenter | |
| def notify(title, subtitle, text): | |
| notification = NSUserNotification.alloc().init() | |
| notification.setTitle_(str(title)) | |
| notification.setSubtitle_(str(subtitle)) | |
| notification.setInformativeText_(str(text)) | |
| notification.setSoundName_("NSUserNotificationDefaultSoundName") | |
| NSUserNotificationCenter.defaultUserNotificationCenter().scheduleNotification_(notification) |
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
| #!/bin/bash | |
| # build array with brace expansion per Allister's recomendation | |
| array=(/Applications/{GarageBand,Pages,iMovie,iPhoto,Keynote,Numbers}.app) | |
| for path in "${array[@]}"; do | |
| app_name="${path##*/}" | |
| name="${app_name%.*}" | |
| version=$(defaults read "${path}"/Contents/Info CFBundleShortVersionString) | |
| pkgbuild --component "${path}" $HOME/Desktop/"${name}-${version}".pkg |
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
| #!/bin/bash | |
| /usr/bin/osascript << EOF | |
| property compName : "" | |
| repeat while compName is "" | |
| tell application "Finder" | |
| activate | |
| display dialog "What should this computer be named:" default answer compName | |
| set compName to text returned of result |