Skip to content

Instantly share code, notes, and snippets.

🐍
Snek

Greg Taylor gtaylor

🐍
Snek
Block or report user

Report or block gtaylor

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:912caae15e70cdcf4d4e
[2014-10-14 01:30:13,857: WARNING/MainProcess] consumer: Connection to broker lost. Trying to re-establish the connection...
Traceback (most recent call last):
File "/home/cbweb/.virtualenvs/coursebook/local/lib/python2.7/site-packages/celery/worker/consumer.py", line 278, in start
blueprint.start(self)
File "/home/cbweb/.virtualenvs/coursebook/local/lib/python2.7/site-packages/celery/bootsteps.py", line 123, in start
step.start(parent)
File "/home/cbweb/.virtualenvs/coursebook/local/lib/python2.7/site-packages/celery/worker/consumer.py", line 821, in start
c.loop(*c.loop_args())
File "/home/cbweb/.virtualenvs/coursebook/local/lib/python2.7/site-packages/celery/worker/loops.py", line 70, in asynloop
next(loop)
View gist:c9fdf67aa83cd58f74af
{
"school": {
"url": "https://get.pathwright.local/",
"image": "https://d3s4ni8cjo6ws9.cloudfront.net/api/file/DpJ9HPskQV2Q3k1oxNRf?policy=eyJleHBpcnkiOiAiMTQxMzQwMjkyMCJ9&signature=84cbdf3ed6b3abb22380e8218f0e1a25ac5a83d17c953fd78117ee180bbceaf6",
"id": 17,
"name": "PathwrightU"
},
"class_section": {
"url": "https://get.pathwright.local/course/pw101/571/",
"id": 571,
View gist:9064a5f325b9fc7b4ba2
{
"school": {
"url": "https://get.pathwright.local/",
"image": "https://d3s4ni8cjo6ws9.cloudfront.net/api/file/DpJ9HPskQV2Q3k1oxNRf?policy=eyJleHBpcnkiOiAiMTQxMzQwMjkyMCJ9&signature=84cbdf3ed6b3abb22380e8218f0e1a25ac5a83d17c953fd78117ee180bbceaf6",
"id": 17,
"name": "PathwrightU"
},
"class_section": {
"url": "https://get.pathwright.local/course/pw101/571/",
"id": 571,
View gist:e3926a90fe108d52a4c8
WITH RECURSIVE cte (
id, discussion_id, body, num_votes, last_edited_time,
class_section_id, created_time, modified_time,
author_id, reply_parent_id, num_inappropriate_flags,
path, depth
) AS (
SELECT discussion_response.id, discussion_response.discussion_id,
discussion_response.body, discussion_response.num_votes,
discussion_response.last_edited_time,
discussion_response.class_section_id,
View gist:d7e78505c5eaed70ecde
DROP FUNCTION modify_player_inventory(
player_id integer, mod_amount integer, item_name text
);
CREATE OR REPLACE FUNCTION modify_player_inventory(
player_id integer, mod_amount integer, item_name text
) RETURNS integer AS
$BODY$
BEGIN
LOOP
-- first try to update the key
View gist:9aec5dda57f5ae019435
libconn = librato.connect(settings.LIBRATO_USERNAME, settings.LIBRATO_API_KEY)
libconn.submit(
metric_name, count, type='gauge', source=_METRIC_SOURCE, period=300, measure_time=epoch)
File "/home/gtaylor/workspace/coursebook/pathwright/apps/pwstats/src/metric_api.py", line 35, in send_counter_metric
**kwargs)
File "/home/gtaylor/.virtualenvs/coursebook/lib/python2.7/site-packages/librato/__init__.py", line 182, in submit
self._mexe("metrics", method="POST", query_props=payload)
File "/home/gtaylor/.virtualenvs/coursebook/lib/python2.7/site-packages/librato/__init__.py", line 148, in _mexe
resp_data, success, backoff = self._process_response(resp, backoff)
@gtaylor
gtaylor / bt-182p3.diff
Created Mar 13, 2014
PennMUSH 1.8.2p3 diff to incorporate liberated btech from BattletechMUX
View bt-182p3.diff
diff -ur -x btech -x .svn -x '*.o' -x data pennmush/game/mushcnf.dst btpenn/game/mushcnf.dst
--- pennmush/game/mushcnf.dst 2007-04-22 09:00:06.000000000 -0700
+++ btpenn/game/mushcnf.dst 2007-02-04 20:58:41.000000000 -0800
@@ -840,3 +840,7 @@
###
include restrict.cnf
+###
+### BattleTech options are in btech.cnf
+###
@gtaylor
gtaylor / gist:6378871
Created Aug 29, 2013
A very naive HTTP server that listens for a Github webhook. Upon receiving a request, we build the Pelican content and upload to S3.
View gist:6378871
/*
A very basic HTTP server that listens for Github webhooks. When we hear from
Github, build the blog and upload to S3.
Note: This is a very naive server. We don't attempt to authenticate in any
way, and we don't block to prevent spamming.
*/
package main
import (
@gtaylor
gtaylor / gist:4288166
Created Dec 14, 2012
Alex Gaynor's Shit List
View gist:4288166
Alex Gaynor's Shit List
-----------------------
* Everyone.
@gtaylor
gtaylor / gist:1901752
Created Feb 24, 2012
Dynamic Fabric deployment with boto
View gist:1901752
def ec2():
"""
Set env.roledefs according to our deployment setup. From this, an
env.hosts list is generated, which determines which hosts can be
messed with. The roledefs are only used to determine what each server is.
Since we are running on EC2, these instances are completely variable.
We need to hit their API to determine which instances are currently in
service.
"""
You can’t perform that action at this time.