Skip to content

Instantly share code, notes, and snippets.

@simonthum
simonthum / Program.cs
Last active February 15, 2024 22:26
Crashmeharder and results from a crashmeharder run (CSV Data)
using System;
using System.Collections.Concurrent;
using System.Diagnostics;
using System.Linq;
namespace CrashMeHarder;
/// <summary>
/// This tries to answer a bold question: Just how hard do you fail when you fail
/// to use thread-safe access on dictionaries where you should have.
@simonthum
simonthum / maketuples.ceylon
Created February 26, 2016 12:58
make type-safe ceylon tuples from sequences
[X] makeTuple1<X>([X*] s) {
"The sequence does not have enough elements."
assert(exists v = s.first);
return [v];
}
shared X[2] makeTuple2<X>([X*] s) {
"The sequence does not have enough elements."
assert(exists v = s.first);
@simonthum
simonthum / detached.ceylon
Created December 6, 2012 21:47
Detatched Annoations for Celyon
doc "An annotation context defines a context in which \"detached\"
annotations are associated to annotable program elements.
Annotations are detached if they are not defined in the source code of
the corresponding program element.
The annotation context makes it possible to view source-code annotations and detached
annotations as equals. It thus enables to use annotations in cases that traditionally
required switching to other (less type-checked) means of configuration.
@simonthum
simonthum / vCard2org.rb
Created November 25, 2012 20:27
create org-contacs entries from vCard input. Only telephone and name so far.
#!/usr/bin/env ruby
#
# Converts VCard to org-mode/org-contacts files
#
# 2012 by Simon Thum
#
# Requires the vpim gem, which in turn needs patches to run (github xing/vpim)
#
# To the extent possible under law, the author(s) have dedicated all
# copyright and related and neighboring rights to this software to the