Skip to content

Instantly share code, notes, and snippets.

@rmartinho
rmartinho / text-design.md
Last active Oct 7, 2015
Design ideas for ogonek::text
View text-design.md

Motivation

ogonek::text is intended as a Unicode-based string class. Not as a glorified container of characters, like std::basic_string, but as an actual piece of Unicode text.

Storage

text is not about storage, so it delegates that to another container. That container can be customized, yielding a varied range of performance characteristics suitable to any situations. One could have a Unicode text array, similar to std::basic_string, or one could have a Unicode text deque, or even a rope.

Encoding

@rmartinho
rmartinho / deprecated.md
Last active Oct 7, 2015
[[deprecated]] attribute proposal
View deprecated.md

Introduction

This documents describes a proposal for providing authors of C++ libraries with a standard facility to mark code entities as deprecated.

Motivation and Scope

Libraries change with time. Sometimes features are replaced by more powerful ones, or are found to be inherently flawed. A common way for library writers to deal with this problem is to recommend against such old features, i.e., to mark them as deprecated.

Right now there is no standard means of doing that. Library writers are thus forced to either simply document them as deprecated, or to use the preprocessor to decide upon one of the various compiler extensions that exist to support this feature.

@rmartinho
rmartinho / frontier-magic.md
Last active Oct 7, 2015
Beyond the Frontier Magic
View frontier-magic.md

The [Frontier Magic rules][wizards rules] created by Wizards are a good start but not as fun as we had expected. So we made up new rules based off of the same idea. These are those modified rules.

Terrain

TODO: more complete description of the terrain

Home row

The home row is a row between a player and the land cards.

@rmartinho
rmartinho / gist:3174021
Created Jul 25, 2012
Example of gist.io bug with quotes and lists
View gist:3174021
> - This is a list item, in a quote!
> - This is another list item, in a quote!
@rmartinho
rmartinho / hate.markdown
Last active Jul 15, 2020
I will hate you
View hate.markdown

Dear C++ library writer,

  1. If your library forces me to use new all over, I will hate you.

  2. If your library has types with bogus values, I will hate you.

  3. If the documentation for your library gets the terminology of its own domain wrong, I will hate you.

  4. If I say "My God, it's full of stars!" when I see the function signatures in your library, I will hate you.

View halcyon.md

This document is an informal collection of design ideas for the Halcyon programming language. This document in in permanent draft status; do not take anything you read here as final. There are no plans to ever actually implement the ideas here; they're listed only for future reference.

Wants

  • Static, strong typing

    Type errors at runtime are stupid.

  • Type inference

@rmartinho
rmartinho / arrays.h
Last active Oct 12, 2015
Simple functions for better usage of arrays
View arrays.h
// begin() and end() functions for arrays (C++03)
//
// Written in 2012 by Martinho Fernandes
//
// To the extent possible under law, the author(s) have dedicated all copyright and related
// and neighboring rights to this software to the public domain worldwide. This software is
// distributed without any warranty.
//
// You should have received a copy of the CC0 Public Domain Dedication along with this software.
// If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
@rmartinho
rmartinho / sarray2d.h
Created Oct 26, 2012
Two-dimensional array with dimensions determined at compile-time
View sarray2d.h
// Two-dimensional array with dimensions determined at compile-time
//
// Written in 2012 by Martinho Fernandes
//
// To the extent possible under law, the author(s) have dedicated all copyright and related
// and neighboring rights to this software to the public domain worldwide. This software is
// distributed without any warranty.
//
// You should have received a copy of the CC0 Public Domain Dedication along with this software.
// If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
@rmartinho
rmartinho / darray2d.h
Created Oct 26, 2012
Two-dimensional array with dimensions determined at runtime
View darray2d.h
// Two-dimensional array with dimensions determined at runtime
//
// Written in 2012 by Martinho Fernandes
//
// To the extent possible under law, the author(s) have dedicated all copyright and related
// and neighboring rights to this software to the public domain worldwide. This software is
// distributed without any warranty.
//
// You should have received a copy of the CC0 Public Domain Dedication along with this software.
// If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
View SetJekyllPostSyntax.vim
" Sets up multi-language syntax for Jekyll blog posts
fun! SetJekyllPostSyntax()
" Bring in YAML syntax for front matter
unlet b:current_syntax
syntax include @Yaml syntax/yaml.vim
syntax region yamlFrontmatter start=/\%^---$/ end=/^---$/ keepend contains=@Yaml
" Bring in C++11 syntax for code snippets
unlet b:current_syntax
syntax include @Cpp syntax/cpp11.vim