Skip to content

Instantly share code, notes, and snippets.

@ksimek
ksimek / program_options_boilerplate.cpp
Last active December 28, 2023 05:12
Boilerplate code for a C++ program using boost program options. Usage string is automatically generated from positional arguments.
#include <boost/program_options.hpp>
#include <sstream>
#include <fstream>
#include <iterator>
#include <algorithm>
namespace po = boost::program_options;
class Options
{
@bnoordhuis
bnoordhuis / punycode.js
Created June 20, 2011 15:49
javascript punycode encoder and decoder
/**
* Copyright (C) 2011 by Ben Noordhuis <info@bnoordhuis.nl>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*