Skip to content

Instantly share code, notes, and snippets.

Avatar

David Gay dtgay

View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am dtgay on github.
  • I am davidgay (https://keybase.io/davidgay) on keybase.
  • I have a public key ASB5lE0_lMpNYVbloPzLfhfMueav4GqqpZVyQgIrB7GxPwo

To claim this, I am signing this object:

@dtgay
dtgay / gist:6845532
Last active Dec 24, 2015
copy a file cloud to a file butt for @2rs2ts
View gist:6845532
#!/bin/sh
cp cloud butt
# @2rs2ts
@dtgay
dtgay / gpgwot
Created Apr 20, 2013
visualize GPG key web of trust
View gpgwot
#!/bin/bash
gpg --list-sigs --keyring ~/.gnupg/pubring.gpg | sig2dot > ~/.gnupg/pubring.dot
neato -Tps ~/.gnupg/pubring.dot > ~/.gnupg/pubring.ps
convert ~/.gnupg/pubring.ps ~/.gnupg/pubring.gif
eog ~/.gnupg/pubring.gif
View gist:4445087
<div class="container_12">
<div class="grid_6">
<p>This content is in a half-container width column!<p>
</div>
<div class="grid_6">
<p>So is this! Two even columns!</p>
</div>
<div class="clear"></div> <!-- Put this between rows of content. -->
@dtgay
dtgay / littlest_backup.sh
Created Sep 27, 2012
The Littlest Backup
View littlest_backup.sh
#!/bin/sh
# Backup file and directory to local folder
cp -r ~/.task ~/Dropbox/Backup/tasks/
cp ~/.taskrc ~/Dropbox/Backup/tasks/.taskrc
# Backup file and directory to remote location
rsync -r ~/.task yacht:.task
rsync ~/.taskrc yacht:.taskrc
@dtgay
dtgay / gist:3238297
Created Aug 2, 2012
Coderwall API example
View gist:3238297
def handle_coderwall(request, username):
"""
Get data from CoderWall.
"""
from coderwall import CoderWall
try:
cwc = CoderWall(username)
return {
'endorsements': cwc.endorsements,
@dtgay
dtgay / gist:3190973
Created Jul 27, 2012 — forked from gregjurman/gist:3190863
Problem with Stack Exchange API JSON data
View gist:3190973
stack_exchange_api = 'https://api.stackexchange.com/2.1'
request_url = "{0}/users/{1}/associated".format(
stack_exchange_api, usernames['stack_exchange'])
api_request = urllib2.Request(
request_url,
headers={"Accept": "application/json"})
api_z_response = urllib2.urlopen(api_request)
from zlib import decompress, MAX_WBITS
api_response = decompress(api_z_response.read(), 16 + MAX_WBITS)
se_accounts_json = json.loads(api_response)
@dtgay
dtgay / gist:3190781
Created Jul 27, 2012
Problem with Stack Exchange API JSON data
View gist:3190781
stack_exchange_api = 'https://api.stackexchange.com/2.1'
request_url = "{0}/users/{1}/associated".format(
stack_exchange_api, usernames['stack_exchange'])
api_request = urllib2.Request(
request_url,
headers={"Accept": "application/json"})
api_response = urllib2.urlopen(api_request)
se_accounts_json = json.load(api_response)
se_answers = 0 # Number of answers given on SE sites
pprint.pprint(se_accounts_json)
View coder-shell.py
""" Run like: $ python coder-shell.py
First you need to: $ pip install coderwall requests fabulous
"""
from coderwall import CoderWall
import fabulous.image
import fabulous.text
import os
import requests
@dtgay
dtgay / gist:2907543
Created Jun 10, 2012
pcreate failure traceback with Pyramid
View gist:2907543
Traceback (most recent call last):
File "/usr/bin/pcreate", line 9, in <module>
load_entry_point('pyramid==1.3.2', 'console_scripts', 'pcreate')()
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 337, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 2279, in load_entry_point
return ep.load()
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 1989, in load
entry = __import__(self.module_name, globals(),globals(), ['__name__'])
File "/usr/lib/python2.7/site-packages/pyramid-1.3.2-py2.7.egg/pyramid/__init__.py", line 1, in <module>
You can’t perform that action at this time.