Skip to content

Instantly share code, notes, and snippets.

View regexident's full-sized avatar

Vincent Esche regexident

View GitHub Profile
@regexident
regexident / fizz_buzz.cpp
Last active January 11, 2024 10:57
FizzBuzz in C++ Template Meta-Programming
// Created by Vincent Esche on 2/10/15.
// Copyright (c) 2015 Vincent Esche. All rights reserved.
#include <iostream>
#include <cxxabi.h>
struct fizz;
struct buzz;
struct fizz_buzz;
@regexident
regexident / tomono.sh
Created June 12, 2017 10:35 — forked from eisisig/tomono.sh
convert multiple repos to monorepo
#!/bin/bash
# Merge multiple repositories into one big monorepo. Migrates every branch in
# every subrepo to the eponymous branch in the monorepo, with all files
# (including in the history) rewritten to live under a subdirectory.
#
# To use a separate temporary directory while migrating, set the GIT_TMPDIR
# envvar.
#
# To access the individual functions instead of executing main, source this
@regexident
regexident / AnyDiffable.swift
Created March 17, 2017 10:26 — forked from ollieatkinson/AnyDiffable.swift
Implementation of Paul Heckel's Diff Algorithm in Swift 3
public protocol Diffable: Hashable {
var primaryKeyValue: String { get }
}
public struct AnyDiffable: Diffable {
private let _primaryKeyValue: () -> String
@regexident
regexident / README-Template.md
Last active January 23, 2023 22:17 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Synopsis

At the top of the file there should be a short introduction and/ or overview that explains what the project is. This description should match descriptions added for package managers (Gemspec, package.json, etc.)

Motivation

// half->float variants.
// by Fabian "ryg" Giesen.
//
// I hereby place this code in the public domain.
//
// half_to_float_fast: table based
// tables could be done in a more compact fashion (in particular, can store tab2 in low word of tab1!)
// but something of a dead end since not very SIMD-friendly. pretty much abandoned at this point.
//
// half_to_float_fast2: use FP adder hardware to deal with denormals.
// float->half variants.
// by Fabian "ryg" Giesen.
//
// I hereby place this code in the public domain, as per the terms of the
// CC0 license:
//
// https://creativecommons.org/publicdomain/zero/1.0/
//
// float_to_half_full: This is basically the ISPC stdlib code, except
// I preserve the sign of NaNs (any good reason not to?)
/**
Copyright 2020 Joseph Duffy
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:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
@regexident
regexident / wifi-field
Created April 21, 2020 11:05 — forked from fredo-dedup/wifi-field
Calculating WIFI propagation with IJulia
{
"metadata": {
"language": "Julia",
"name": "WIFI simulation"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [

Contributing

When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.

Please note we have a code of conduct, please follow it in all your interactions with the project.

Pull Request Process

  1. Ensure any install or build dependencies are removed before the end of the layer when doing a
@regexident
regexident / GenericsManifesto.md
Created November 14, 2017 09:16
Draft for extended section on generic protocols in Swift Raw

Generic protocols

One of the most commonly requested features is the ability to parameterize protocols themselves. For example, a protocol that indicates that the Self type can be constructed from some specified type T or converted into T:

// T -> Self:
protocol ConstructibleFrom<T> {
  init(from value: T)
}