Skip to content

Instantly share code, notes, and snippets.

Peter Baumgartner ipmb

  • Lincoln Loop
Block or report user

Report or block ipmb

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 sample_rss.xml
<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title>RSS Example</title>
<description>This is an example of an RSS feed</description>
<link>http://www.domain.com/link.htm</link>
<lastBuildDate>Mon, 28 Aug 2006 11:12:55 -0400 </lastBuildDate>
<pubDate>Tue, 29 Aug 2006 09:00:00 -0400</pubDate>
@ipmb
ipmb / pivotaltracker.py
Created Nov 4, 2010
Scrapes hours from Pivotal Trackers optional time tracker
View pivotaltracker.py
import datetime
import decimal
import logging
from StringIO import StringIO
from lxml import html
import twill
from twill import commands as twl
logging.basicConfig(level=logging.WARNING)
View add_ec2_user.py
from boto.iam import IAMConnection
iam = IAMConnection(aws_key, aws_secret)
iam.create_user('user')
iam.create_group('group')
iam.put_group_policy('group', 'EC2', '{"Statement":[{"Effect":"Allow","Action":"ec2:*","Resource":"*"}]}')
iam.add_user_to_group('group', 'user')
iam.create_access_key('user')
View fab_sphinx_to_github_page.py
import os
from fabric.api import *
env.local_root=os.path.dirname(__file__)
def deploy_github():
with lcd(env.local_root):
local('git checkout master')
commit = local('git log -1|grep commit', capture=True)
@ipmb
ipmb / test.xml
Created Apr 28, 2011
Feedparser Fail
View test.xml
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Inhabi</title>
<link></link>
<description>Recent items</description>
<language>en-us</language>
<ttl>40</ttl>
<item>
<title>This is a title</title>
@ipmb
ipmb / intense.py
Created Jun 24, 2011 — forked from bartTC/intense.py
Quick and dirty script to export django.contrib.comments as an IntenseDebate Export file to import it in Disqus.
View intense.py
from django.utils.html import escape
from django.contrib.comments.models import Comment
from django.utils.encoding import smart_str
post = u''
for i in Comment.objects.order_by('submit_date'):
if not i.content_object:
continue
post += u"""
@ipmb
ipmb / gist:1140096
Created Aug 11, 2011
Naïve fix #399 for django-haystack
View gist:1140096
diff --git a/haystack/query.py b/haystack/query.py
index 8caa279..988f7f8 100644
--- a/haystack/query.py
+++ b/haystack/query.py
@@ -2,6 +2,7 @@ import operator
import re
import warnings
from django.conf import settings
+from django.utils.encoding import force_unicode
from haystack.backends import SQ
View boost.rb
require 'formula'
class Boost < Formula
homepage 'http://www.boost.org'
url 'http://downloads.sourceforge.net/project/boost/boost/1.48.0/boost_1_48_0.tar.bz2'
md5 'd1e9a7a7f532bb031a3c175d86688d95'
head 'http://svn.boost.org/svn/boost/trunk', :using => :svn
# Bottle built on 10.7.2 using XCode 4.2
bottle 'https://downloads.sourceforge.net/project/machomebrew/Bottles/boost-1.48.0-bottle.tar.gz'
@ipmb
ipmb / RealtimeConf2012.md
Created Oct 29, 2012 — forked from dshaw/RealtimeConf2012.md
Realtime Conf 2012 Talks
View RealtimeConf2012.md
@ipmb
ipmb / election_results.py
Created Nov 7, 2012
Say election results
View election_results.py
#!/usr/bin/env python
import time
import json
import urllib2
import subprocess
def check_results():
page = urllib2.urlopen('http://elections.nytimes.com/2012/results/president/big-board.json')
data = json.loads(page.read())
You can’t perform that action at this time.