Skip to content

Instantly share code, notes, and snippets.

View ChickenProp's full-sized avatar

Phil Hazelden ChickenProp

View GitHub Profile
@ChickenProp
ChickenProp / gist:3805370
Created September 29, 2012 22:55
Piiwii - a Raspberry Pi-powered robot controlled by a Wii nunchuk

I turned my Raspberry Pi into a robot, controlled by a Wii nunchuk. It's surprisingly easy to do - at least, surprisingly to me, who has not previously made a robot. But because it's surprising, it might help others to have a guide, so here one is.

Parts

I'm linking to SKPang for most of these, but Sparkfun and Adafruit would be good places to look if you're in the US.

(If you're in the UK, a word of caution - I bought motors and some other stuff from Sparkfun to save £7 over SKPang, but the package got stopped at customs and I had to pay £4 VAT and £8 handling fees. My understanding is that this will only happen on packages whose contents are worth more than £15, but you'd be a fool to trust me on this. It didn't happen when I spent £20 at Adafruit or £5 at Sparkfun. YMMV.)

  • Raspberry Pi - for the robot logic. An Arduino or similar could be substituted (though the software would need to be rewritten).

Keybase proof

I hereby claim:

  • I am chickenprop on github.
  • I am philh (https://keybase.io/philh) on keybase.
  • I have a public key whose fingerprint is 84A5 6F31 7B32 3DBD 160C 37E8 6EAA 563A 7D8D E4A4

To claim this, I am signing this object:

@ChickenProp
ChickenProp / README.md
Last active April 26, 2019 14:58
Political Polarization in the US House of Representatives

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 / Main.hs
Last active April 2, 2022 19:53
Exploring variadic functions in Haskell
-- See: http://reasonableapproximation.net/2022/04/02/variadic-hm.html
{-# LANGUAGE AllowAmbiguousTypes
, ConstraintKinds
, DataKinds
, FlexibleInstances
, FunctionalDependencies
, KindSignatures
, PolyKinds
, ScopedTypeVariables