Skip to content

Instantly share code, notes, and snippets.

View fluffy-critter's full-sized avatar

fluffy fluffy-critter

View GitHub Profile
# Generate a list of popular names, sortable by their relative androgyny. Data is obtained
# from the SSA website at http://catalog.data.gov/dataset/baby-names-from-social-security-card-applications-national-level-data
#
# The expected input is a .csv file with columns of:
#
# name,assigned gender,count
#
# Some example uses of this program:
#
# Find the most androgynous names from 1978 beginning with Q:
@fluffy-critter
fluffy-critter / pngextract.cpp
Created October 18, 2015 03:51
Extract embedded .png files from an uncompressed container
#include <iostream>
#include <fstream>
#include <sstream>
#include <cstdint>
#include <iomanip>
#include <cctype>
const uint8_t magicnum[8] = {0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a};
const std::string magicstr(reinterpret_cast<const char*>(magicnum), 8);