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 August 3, 2011 18:05
test with force directed stuff
<!DOCTYPE html>
<html>
<head>
<title>Force-Directed Layout (Dynamic)</title>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.min.js"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.geom.min.js"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.layout.min.js"></script>
<style type="text/css">
html, body {
@ralphbean
ralphbean / index.html
Created August 4, 2011 14:51
d3 viz for narcissus
<!DOCTYPE html>
<html>
<head>
<title>Proof of concept for d3 viz + narcissus</title>
<link rel="stylesheet" type="text/css" href="spider.css"></style>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.min.js"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.geom.min.js"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.layout.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script type="text/javascript" src="spider.js"></script>
@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:

@ralphbean
ralphbean / test-reflect.py
Created August 30, 2011 16:26
Test overriding reflected column types in with sqlalchemy.
#!/usr/bin/env python
""" Demonstrates an issue with overriding reflected column types.
Author: Ralph Bean <ralph.bean@gmail.com>
Take a look at :meth:`reflect_and_verify_legacy_db_mangle`.
Running this script produces the following output::
% ./test-reflect.py
@ralphbean
ralphbean / index.html
Created October 7, 2011 18:45
FPS graph using d3
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Chart of frames/second with d3.js</title>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js">
</script>
<style type="text/css">
@ralphbean
ralphbean / index.html
Created October 7, 2011 19:08
FPS graph using d3
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Chart of frames/second with d3.js</title>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js">
</script>
<style type="text/css">
@ralphbean
ralphbean / ansiimages.py
Created October 31, 2011 13:48
ansi2html test
#!/usr/bin/env python
"""
The great test for ansi2html. Can it reliably reproduce images that have been
converted to ansi color by fabulous?
Before running this, install the following in a virtualenv::
$ pip install ansi2html fabulous PIL
Author: Ralph Bean -- http://threebean.org
@ralphbean
ralphbean / spritely.js
Created December 8, 2011 14:23
Just a copy/paste of spritely.js
/*
* jQuery spritely 0.6.1
* http://spritely.net/
*
* Documentation:
* http://spritely.net/documentation/
*
* Copyright 2010-2011, Peter Chater, Artlogic Media Ltd, http://www.artlogic.net/
* Dual licensed under the MIT or GPL Version 2 licenses.
*
#!/usr/bin/env python
import os
ROOT = '/home/pfmeec'
for dirpath, dirnames, filenames in os.walk(ROOT):
print dirpath, dirnames, filenames
@ralphbean
ralphbean / color_loop.py
Created December 12, 2011 14:33
Loop over all of teh colorz!
#!/usr/bin/env python
step = 8
# step = 1 # for finer resolution in the color-space
bitspan = lambda : range(0, 255, step)
def print_color(r, g, b):
print "%.2x%.2x%.2x" % (r, g, b)
# You could do this one way, by generating every single combination of red,