Skip to content

Instantly share code, notes, and snippets.

View dtgay's full-sized avatar

David Gay dtgay

View GitHub Profile

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 December 24, 2015 18:49
copy a file cloud to a file butt for @2rs2ts
#!/bin/sh
cp cloud butt
# @2rs2ts
@dtgay
dtgay / gpgwot
Created April 20, 2013 15:28
visualize GPG key web of trust
#!/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
@dtgay
dtgay / gist:4445087
Created January 3, 2013 17:19
960gs demo
<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 September 27, 2012 21:18
The Littlest Backup
#!/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 August 2, 2012 16:13
Coderwall API example
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 July 27, 2012 23:12 — forked from gregjurman/gist:3190863
Problem with Stack Exchange API JSON data
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 July 27, 2012 22:34
Problem with Stack Exchange API JSON data
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)
@dtgay
dtgay / coder-shell.py
Created July 4, 2012 22:05 — forked from ralphbean/coder-shell.py
coder-shell++
""" 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 June 10, 2012 22:29
pcreate failure traceback with Pyramid
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>