Open Source code doesn’t always come in big complex packages. At ProPublica we sometimes share small snippets of using GitHub “Gists.” These Gists range from single-byte file delimiters to an entire JavaScript framework for making stepper graphics. They rarely have documentation and don’t even always have names, but they can be super-useful.
Here are some we’ve shared over the past few years:
- A simple way to grab remote template elements in your Rails app (after Brian Boyer’s RemoteSnippets) https://gist.github.com/1664329
- A single byte gist that contains ASCII character 28, which the FEC uses as a field delimiter. https://gist.github.com/2191300
- A quine in Ruby https://gist.github.com/523940
- Check links on a page using JavaScript https://gist.github.com/1502737
- Convert state abbreviations to and from AP Style in JavaScript (requires Underscore) https://gist.github.com/1006390
- Find out if you have permission to publish to a user’s Facebook stream, using JavaScript https://gist.github.com/1181004
- Grab U.S. Code by statute using Ruby https://gist.github.com/861266
- JavaScript color generator based on this color palette by Tyson Evans https://gist.github.com/1558470
- Natural language document clusterng in Ruby https://gist.github.com/1508278
- Non-strict CSV parser in Ruby https://gist.github.com/1684042
- Parse Unix diffs using Ruby https://gist.github.com/335891
- Poor Man’s Fech, in Ruby https://gist.github.com/1405852
- Rake task to build github pages https://gist.github.com/891157
- Ruby code to purge Amazon CloudFront cache https://gist.github.com/1630177
- Shell script to download TIGER/Line shapefiles https://gist.github.com/885812
- Simple dynamic page titles for Rails https://gist.github.com/981957
- Simple JavaScript graphing framework https://gist.github.com/1690779
- Simple Ruby benchmark https://gist.github.com/987477
- Stepper graphic framework using JavaScript https://gist.github.com/1703708
- Turn CSVs into JSON, in Ruby https://gist.github.com/1334996
- Turn hashtags in git commit messages into git tags using Ruby https://gist.github.com/826360
Naturally, this post is available as a gist, too.