Skip to content

Instantly share code, notes, and snippets.

View ddbeck's full-sized avatar

Daniel D. Beck ddbeck

View GitHub Profile
@ddbeck
ddbeck / toggleDistractions.js.scpt
Last active August 29, 2015 14:22
A script to toggle distractions from Mac OS X Dock badges
// Use this Mac OS X automation script to quickly hide notifications for
// distracting apps. Put the names of the distracting apps in the
// `distractingApps` array and save the script. Run the script to toggle the
// badges on and off.
// Tip: To run this script much faster, move the distracting apps to the top of
// the list in System Preferences's Notifications pane.
var distractingApps = ['Tweetbot', 'Slack']
@ddbeck
ddbeck / gist:1113035
Created July 29, 2011 02:48
Generator Madness
# you'll do something silly like this
def v1_powers_of_two(limit=10):
def po2s():
for x in range(0, limit):
yield 2 ** x
return list(po2s())
# instead of something sensible like this
def v2_powers_of_two(limit=10):
@ddbeck
ddbeck / gist:1201804
Created September 7, 2011 21:30
A Thing I Learned About Text Indentation
def indent_test_one():
print """\
Hi,
You'd think this would work nicely, but it doesn't.
- annoyances
- abound
Thanks,
@ddbeck
ddbeck / fabsay.py
Created December 2, 2011 05:08
a Coprocess script for iTerm2 to read aloud Fabric task completion
#!/usr/local/bin/python2.7
# use as a trigger.
# Trigger regex: Executing task '(.*)'$
# Coprocess command: $HOME/bin/fabsay.py \1
import subprocess
import sys
@ddbeck
ddbeck / example.json
Created May 5, 2012 22:44
JSON Syntax Error Example
{
"key": "value",
"name": "Jeremy", // <--- this comma is fine
"location": "USA", // <--- this comma is an error
}
@ddbeck
ddbeck / .gitconfig
Created April 22, 2013 19:42
A shell script and alias to avoid making dumb mistakes with git-svn.
[alias]
ci = commit
co = checkout
st = status
wdiff = diff --color-words
svnci = !$HOME/src/dotfiles/git-svn-safe.sh dcommit
svnre = !$HOME/src/dotfiles/git-svn-safe.sh rebase
@ddbeck
ddbeck / wtd_london_23_feb_2016_notes.md
Created February 24, 2016 16:50
Write the Docs London 23 February 2016 Notes

Write the Docs London 23 February 2016 Notes

I had some excellent conversations with folks at the Write the Docs London meetup on 23 February 2016. Here's some links to things I remember talking about. —@ddbeck

Podcast recommendations

At dinner we talked a little about podcasts. Here's some podcasts that came up:

  • Slate's Working: interviews with people about their jobs
  • 5by5: a podcast network created by a former technical writer and software developer (and fellow graduate of the fine tech writing program at the University of Central Florida), Dan Benjamin. Lots of different podcasts, mostly conversational format on different topics (the first few episodes of Back to Work are probably a good introduction).
# modify your .gitconfig to include these in the alias section
[alias]
svnci = !$HOME/bin/git-svn-safe.sh dcommit
svnre = !$HOME/bin/git-svn-safe.sh rebase
svnsync = !git svnre && git svnci
@ddbeck
ddbeck / brew_config.shell
Last active November 4, 2016 14:30
brew update failure with git formula
$ brew config
HOMEBREW_VERSION: 1.0.9-41-g0028cf9
ORIGIN: https://github.com/Homebrew/brew
HEAD: 0028cf9fb85e7fecb4ad803a817600068c821dc9
Last commit: 14 hours ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 3ade4a12394af41ad4815edd7b1acdbd0b95b56f
Core tap last commit: 57 minutes ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_REPOSITORY: /usr/local/Homebrew
@ddbeck
ddbeck / brief_example.py
Last active November 8, 2016 12:03
example WebFaction install script
-----BEGIN WEBFACTION INSTALL SCRIPT-----
#!/usr/bin/env python2.7
"""This is a docstring."""
import sys
import xmlrpclib
server = xmlrpclib.ServerProxy('https://api.webfaction.com/')