Skip to content

Instantly share code, notes, and snippets.

View ralphbean's full-sized avatar

Ralph Bean ralphbean

  • Red Hat, Inc
  • Rochester, NY
View GitHub Profile
@ralphbean
ralphbean / index.html
Created March 21, 2018 21:01 — forked from d3noob/.block
Simple vertical tree diagram using v4
<!DOCTYPE html>
<meta charset="utf-8">
<style> /* set the CSS */
.node circle {
fill: #fff;
stroke: steelblue;
stroke-width: 3px;
}
@ralphbean
ralphbean / index.html
Created March 21, 2018 19:54 — forked from d3noob/.block
Simple vertical d3.js tree diagram
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Collapsible Tree Example</title>
<style>
.node circle {
@ralphbean
ralphbean / pkgdb-bz-overrides-to-yaml.py
Created August 3, 2017 14:25
This is a quick script to migrate the Bugzilla default assignees data from PkgDB to a YAML format.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This is a quick script to migrate the Bugzilla default assignees data from
PkgDB to a YAML format.
"""
import argparse
import requests
import yaml
import os
#!/usr/bin/env python
# A script to count the number of current and maximum fedmsg zeromq connections
# Author: Luke Macken <[email protected]>
# License: GPLv3
import os
import requests
from BeautifulSoup import BeautifulSoup
cur_sessions = 0
@ralphbean
ralphbean / simple_file_completer.py
Created November 12, 2012 18:28
Half-working filename tab-completer. Play with it--it mostly works, but you have to help it along more than you're used to at the command line.
#!/usr/bin/env python
import readline
import os
import re
import sys
# This will tab-complete from the working directory, starting from /, and going
# through the sub-directories, but it doesn't behave quite the way you expect.
# For instance, it chooses for you if there are two partial matches.
@ralphbean
ralphbean / insanity.py
Created June 25, 2012 19:15 — forked from rossdylan/insanity.py
Pure insanity in one line
(
lambda args: map(
lambda repo: __import__("os").system('git clone {0} {1}/{2}'.format(
repo.git_url,
args.backupdir,
repo.name)
),
__import__("pygithub3").Github().repos.list(args.username).all()
)
)(
@ralphbean
ralphbean / test_site.py
Created June 14, 2012 14:41 — forked from moschlar/test_site.py
Test multiple sites
from sauce.tests import TestController
__all__ = ['TestSite']
class TestSite(TestController):
sites = ['/', '/about', '/contact']
def _do_site(self, site):
response = self.app.get(site)
@ralphbean
ralphbean / submission.py
Created May 30, 2012 20:48 — forked from moschlar/submission.py
A ToscaWidgets2 widget that needs a dynamic SelectField and does not work :(
# -*- coding: utf-8 -*-
'''
Created on 17.03.2012
@author: moschlar
'''
import tw2.core as twc
import tw2.forms as twf
import tw2.sqla as twsa
@ralphbean
ralphbean / linkify.py
Created February 21, 2012 19:12 — forked from lmacken/linkify.py
A script to linkify URLs in text
#!/usr/bin/env python
# A simple script that can be used to turn URLs into links
#
# Using within a pipeline:
#
# $ echo 'http://lewk.org' | linkify
# <a href="http://lewk.org">http://lewk.org</a>
#
# Using on a file:
#
@ralphbean
ralphbean / gist:1163585
Created August 22, 2011 21:09 — forked from voodootikigod/gist:1155790
PyCodeConf Ticket Give-away
Day job:
  • Research Systems Administrator at RIT. I teach Chemists and Biologists (and others) how to program for high performance computing environments.
Favorite Python project:
Favorite Conference:
  • PyCon US

Python Experience Level: