Skip to content

Instantly share code, notes, and snippets.

Phil Hazelden ChickenProp

Block or report user

Report or block ChickenProp

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:1eeca0f34e91bee0a7a968bf1a0df466
[ "GT Rent Roll 2015-02-09 Final Out"
, "Copy of 2015-03-24_Project_Auriga_Portfolio_Summary"
, "Cyclone - Master Rent Roll as of 31.03.2015"
, "01.1 - Mieterliste - 2014-09-10_Hafenplatz 6"
, "7_Static_August 2014"
, "2013-10-04 List of Tenants CBRE Battello 2013_ACTUAL_ EN"
, "2014 06_Waterfront Tenancy Schedule"
, "20150910_Rent_Roll_Victoriastadt-Lofts_FINAL_extern"
, "Copy of SokratesTenancySchedule290914srr"
, "Hamburg_Spaldinghof_ML_Stand_2014-09-18"
@ChickenProp
ChickenProp / gist:3194723
Created Jul 28, 2012
The Liang-Barsky algorithm for line-rectangle collisions
View gist:3194723

The Liang-Barsky algorithm is a cheap way to find the intersection points between a line segment and an axis-aligned rectangle. It's a simple algorithm, but the resources I was pointed to didn't have particularly good explanations, so I tried to write a better one.

Consider a rectangle defined by x_min ≤ x ≤ x_max and y_min ≤ y ≤ y_max, and a line segment from (x_0, y_0) to (x_0 + Δ_x, y_0 + Δ_y). We'll be assuming at least one of Δ_x and Δ_y is nonzero.

Image depicting the situation

(I'm working with Flash, so I'll be using the convention that y increases as you go down.)

We want to distinguish between the following cases:

@ChickenProp
ChickenProp / README.md
Last active Apr 26, 2019
Political Polarization in the US House of Representatives
View README.md

If you intend to fork this, please note that it contains my Google Analytics tracking code.

Summary

This is a visualization of political polarization in the US House of Representatives, as calculated by DW-NOMINATE. DW-NOMINATE allows one to calculate the political leaning of a member simply by comparing their voting record to others', ignoring their party affiliation and even the content of the bills they vote on.

Design

My initial idea was to draw the career progression of every House member as a distinct path, color coded according to their party affiliation in any given congress. The user would also be able to select members to view detailed statistics about them. But when I implemented that, I discovered it was far too noisy. Trends were difficult to make out, few individual members were discernible, and the elements used to represent them were so small that they were almost impossible to select. Feedback #1 confirmed that this was

@ChickenProp
ChickenProp / gist:3037292
Created Jul 3, 2012
Connecting my Raspberry Pi to the internet via my laptop
View gist:3037292

After installing Arch on my Raspberry Pi, internet worked out of the box: I could plug it into the router, turn it on, ssh in and start downloading things. But the router is in my housemate's bedroom, which isn't ideal. If I want the Pi to be connected to the internet in my room, I need it to be connected to my laptop. (Another option would be a USB wifi dongle, of course.) This is how I did it. Much credit goes to the Ubuntu wiki's Connection sharing page.

I should disclaim that I don't fully understand networking stuff, and some of what I say might be wrong. I also didn't write this as I was going; so while I've consulted my browser and shell histories, it's possible I've forgotten some steps.

My laptop is running Gentoo, and this is where most of the work has to be done. It connects to the internet through wifi, on interface wlan0. The ethernet port is eth0, and eth0 is also the name of the ethernet port on the Pi.

Step zero: plug ev

You can’t perform that action at this time.