Skip to content

Instantly share code, notes, and snippets.

Avatar

Robert Dempsey rdempsey

  • McLean, VA
View GitHub Profile
View my_first_python_app.py
#!/usr/bin/env python
# Create the lists of things to choose from
verbs = ['eat', 'speak', 'kick', 'punch', 'yell']
fruit = ['apples', 'oranges', 'pears', 'grapes', 'bananas', 'mangos']
time_of_day = ['morning', 'afternoon', 'evening', 'dusk', 'dawn']
# Run this code until the user hits `Control-C` on her keyboard.
while True:
# Ask the user for various inputs
@rdempsey
rdempsey / onename.txt
Last active Jun 4, 2017
Onename gist
View onename.txt
Verifying that "robertdempsey.id" is my Blockstack ID. https://onename.com/robertdempsey
@rdempsey
rdempsey / test_dockerized_traptor_collection.py
Created Sep 28, 2016
Test collection with a dockerized Traptor
View test_dockerized_traptor_collection.py
import redis
# Redis connection
redis_conn = redis.StrictRedis(host='localhost',
port=6379,
db=5,
decode_responses=True)
# New rule
new_rule = {
'tag': 'rob.test',
@rdempsey
rdempsey / pbic_pricing_scraper.py
Last active May 6, 2017
A simple Python web scraper to obtain pricing data from the Packt website
View pbic_pricing_scraper.py
#!/usr/bin/env python
# encoding: utf-8
"""
pbic_pricing_scraper.py
Created by Robert Dempsey on 09-29-2015
Copyright (c) 2015 Robert Dempsey. All rights reserved.
Utility script to obtain the price information for my book: Python Business Intelligence Cookbook
http://pythonbicookbook.com/
"""
@rdempsey
rdempsey / Three Pandas Tips for Pandas Noobs.ipynb
Last active Oct 10, 2015
Three Pandas Tips for Pandas Noobs
View Three Pandas Tips for Pandas Noobs.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rdempsey
rdempsey / matrix_color_scheme_iterm2
Created Jul 10, 2015
Matrix color scheme for iTerm2. Import with script from here: http://ngs.io/2014/05/05/iterm2-color-schemes/
View matrix_color_scheme_iterm2
{
'Ansi 7 Color' = {
'Blue Component' = '0.751819';
'Green Component' = '0.859729';
'Red Component' = '0.796432';
};
'Selected Text Color' = {
'Blue Component' = '1.000000';
'Green Component' = '1.000000';
'Red Component' = '1.000000';
View README.md

##Description Simple Dashing widget (and associated job) to display RSS feeds. Based on toddq's News widget. Due to comments about the widget not working for many sites I updated the widget to use Ruby's RSS library. It works quite well now.

##Screenshot

##Dependencies nokogiri

htmlentities

View Mailer.py
#!/usr/bin/env python
# encoding: utf-8
"""
Mailer.py
Created by Robert Dempsey on 11/07/14.
Copyright (c) 2014 Robert Dempsey. All rights reserved.
"""
import sys
import os
@rdempsey
rdempsey / python_3_email_with_attachment.py
Created Dec 6, 2014
Use Python 3 to send an email with an attachment using Gmail
View python_3_email_with_attachment.py
#!/usr/bin/env python
# encoding: utf-8
"""
python_3_email_with_attachment.py
Created by Robert Dempsey on 12/6/14.
Copyright (c) 2014 Robert Dempsey. Use at your own peril.
This script works with Python 3.x
NOTE: replace values in ALL CAPS with your own values