Skip to content

Instantly share code, notes, and snippets.

Avatar

Ron Jones boatilus

View GitHub Profile
@boatilus
boatilus / markdown-comparison.md
Created Apr 11, 2019
JavaScript Markdown Parser Size Comparison
View markdown-comparison.md

| markdown-it | 104kb | | showdown | 79kb | | marked | 23kb |

View keybase.md

Keybase proof

I hereby claim:

  • I am boatilus on github.
  • I am ovao (https://keybase.io/ovao) on keybase.
  • I have a public key ASBNTfSbut9LBqYJHEu67Mfov5UEGCfJV_f9qiFZ4R7Fxgo

To claim this, I am signing this object:

View sso_string.cpp
#include <cassert>
#include <cstddef>
#include <string>
template <int8_t len>
class string {
private:
char arr[len + 1];
public:
View to_tuple.cpp
#include <tuple>
#include <type_traits>
#include <cassert>
template <class T, class... TArgs> decltype(void(T{std::declval<TArgs>()...}), std::true_type{}) test_is_braces_constructible(int);
template <class, class...> std::false_type test_is_braces_constructible(...);
template <class T, class... TArgs> using is_braces_constructible = decltype(test_is_braces_constructible<T, TArgs...>(0));
struct any_type {
template<class T>
@boatilus
boatilus / ltoa.c
Created Apr 25, 2014
Public domain ltoa implementation
View ltoa.c
/*
** LTOA.C
**
** Converts a long integer to a string.
**
** Copyright 1988-90 by Robert B. Stout dba MicroFirm
**
** Released to public domain, 1991
**
** Parameters: 1 - number to be converted
@boatilus
boatilus / gist:7016354
Last active Dec 25, 2015
Dynamically-resizing vector implementation around JavaScript typed arrays
View gist:7016354
define [], ->
return class Vector
constructor: (@type, @wordLength, initialSize) ->
@buffer = new ArrayBuffer ((initialSize or 10) * wordLength) / 8
@view = new window[type + wordLength + 'Array'] @buffer
type: ''
buffer: null
view: null
@boatilus
boatilus / gist:4186981
Created Dec 2, 2012
Statically-checked std::array set()
View gist:4186981
namespace stdx {
template <size_t position, typename T, size_t size>
void set(std::array<T, size>& arr, const T& value) noexcept {
static_assert(position < size, "index out of bounds");
arr[position] = value;
}
}
You can’t perform that action at this time.