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
| """ | |
| A pretty nice time parsing regex. | |
| @author Richard Caceres, @rchrd2 | |
| """ | |
| import re | |
| # The history for this regex is stored in my gist | |
| # https://gist.github.com/rchrd2/9773922 | |
| time_range_regex = re.compile(r''' |
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
| # Send a SIGHUP to only the children (--ppid is the magic param here). | |
| cat /var/run/celery.pid | xargs ps --no-headers --ppid | awk '{print $1}' | xargs kill -HUP |
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 | |
| ### BEGIN INIT INFO | |
| # Provides: johnd | |
| # Required-Start: $remote_fs $syslog | |
| # Required-Stop: $remote_fs $syslog | |
| # Default-Start: 2 3 4 5 | |
| # Default-Stop: 0 1 6 | |
| # Short-Description: Start daemon at boot time | |
| # Description: Enable service provided by daemon. | |
| ### END INIT INFO |
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/sh | |
| watchmedo shell-command \ | |
| --pattern="*prof" \ | |
| --ignore-pattern="*png" \ | |
| --wait \ | |
| --command='find profile_data -name "*\.prof" -exec sh -c "test -f {}.png || (gprof2dot -f pstats {} | dot -Tpng -o {}.png && open {}.png)" \;' \ | |
| profile_data |
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 | |
| BITRATE=320 | |
| defvalue='.' | |
| SOURCE_DIR=${1:-$defvalue} | |
| # Validate arguments | |
| if [[ "$#" == 0 ]]; then | |
| echo >&2 "Usage: ./convert.sh ./exports/*.wav" | |
| exit 1; |
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 httplib2 | |
| from apiclient.discovery import build | |
| from oauth2client.client import AccessTokenCredentials | |
| def connect_helper(user): | |
| c = user.social_auth.get(provider='google-oauth2') | |
| access_token = c.tokens['access_token'] | |
| credentials = AccessTokenCredentials(access_token, 'my-user-agent/1.0') | |
| http = httplib2.Http() |
NewerOlder