Skip to content

Instantly share code, notes, and snippets.


Rafael Teixeira monoman

View GitHub Profile
monoman / UberQueue.cs
Created Aug 16, 2021
My Take on David Fowler UberQueue Challenge
View UberQueue.cs
// See for more information
using System.Collections;
using System.Collections.Generic;
Console.WriteLine("Hello, UberQueue!");
var uq = new UberCollections.UberQueue<string>(
new TestAsyncQueue(delay: 500, "One", "Two", "Three"),
new TestAsyncQueue(delay: 1000, "Four", "Five"),
new TestAsyncQueue(delay: 150, "Six", "Seven", "Eight", "Nine")
monoman /
Last active Dec 28, 2020
Trying to add a Document file to a chain through the IL2 Node’s REST API

FAQ - Document Registry on REST [DEPRECATED]


Trying to add a Document file to a chain through the IL2 Node’s REST API


1 - Where should the document content be posted to?

The body content of the POST is the file content (as native unencoded bytes) and it should be posted to the URL built from the query parameters

Partial request path: /documents@t_HlFTTruR33B6_hsgfpq8bPCaADamwrfQy1stPJTkY?Cipher=None&Name=BlahBlah.txt

View ConfigureLogger.cs
static void ConfigureLogger()
const string logConfig = @"<?xml version=""1.0"" encoding=""utf-8"" ?>
<level value=""INFO"" />
<appender-ref ref=""console"" />
<appender name=""console"" type=""log4net.Appender.ColoredConsoleAppender"">
<layout type=""log4net.Layout.PatternLayout"">
monoman / TranslatableStrings_Example.cs
Last active Aug 29, 2015
TranslatableStrings aims to enable Roslyn to again be at peace with resources or any other translation mechanism when using string interpolation
View TranslatableStrings_Example.cs
var person="David";
Console.WriteLine($_"Hello {person}");
// Prints "Alô David" in pt-BR
Console.WriteLine($"Hello {person}");
// Prints "Hello David" in pt-BR
View SplayTree`2.cs
/* ---- MIT LICENSE ----
Copyright (c) 2011 John Gietzen
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:
monoman / Thanks to Hao Kung, b_levitt
Created Oct 27, 2014
Add to Global.asax.cs and call InitJQuery on Application_Start() to avoid "WebForms UnobtrusiveValidationMode requires a ScriptResourceMapping for 'jquery'" on migrating to ASP.NET 4.5
View Thanks to Hao Kung, b_levitt
Based on **b_levitt** answer to
But avoiding hardcoding the jQuery version (doesn't play nice with nuget) by using some regex as explained by **Hao Kung** on
monoman / gist:2053145
Created Mar 16, 2012
Some things that could make ASP.NET MVC 4 Web API even better
View gist:2053145
// this offends my coding sensibility
public Contact GetContact(int id)
Contact contact = _repository.Get(id);
if (contact == null)
throw new HttpResponseException(HttpStatusCode.NotFound);
return contact;
View nuget.xsd
<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="nuspec"
<xs:element name="package">
View ReadonlyProperties.cs
public class Person {
public Person(string name, int age) {
_name = name;
_age = age;
private readonly string _name;
private readonly int _age;
/// Full name
public string Name { get _name; }
/// Age in years
monoman / Boo Marvels - 1
Last active Sep 25, 2015
Boo's creator answering a question on Boolang list. Another wonder of meta-programming...
View Boo Marvels - 1
Daniel Brauer's Question:
Of course I just figured it out: I was trying to declare a bunch of floats like this:
m_forwardPower = 2f,
m_backwardPower = 1f,
m_strafePower = 0f,
m_maxVelocity = 5f,
m_turnSpeed = 3f,