Skip to content

Instantly share code, notes, and snippets.

@hyrmn
hyrmn / gist:51ca84d9a60a63ab66e31cc5871e4b84
Last active May 28, 2017 10:08
German spelt pancakes
400g of spelt flour, type 630 (finely ground)
3 eggs (size L)
750 ml of almond milk
a little salt and some sparkling water, so they'll be very fluffy 👍
If you want them a little sweeter add some sugar, Xylit, or Erythrit, or coconut sugar.
I mixed the sugar all the time. 3 spoons of Xylit and one of coconut sugar.
It's up to you, you don't have to add sugar, maybe you want to try a spicy one.
public class DateAndTimeJsonConverter : IsoDateTimeConverter
{
public DateAndTimeJsonConverter()
{
//NOTE: Need a TypeConverter to control formatting of Dictionary Keys. This applies the type conveter to types you don't control:
// http://stackoverflow.com/questions/3068453/can-you-assign-a-typeconverter-without-a-typeconverterattribute
TypeDescriptor.AddAttributes(typeof(LocalDate), new TypeConverterAttribute(typeof(LocalDateTypeConverter)));
TypeDescriptor.AddAttributes(typeof(LocalDate?), new TypeConverterAttribute(typeof(LocalDateTypeConverter)));
}
@hyrmn
hyrmn / thoughs.md
Last active June 22, 2016 23:51
Raven 2.5 with 500 tenants on several nodes.

The bullet points for 500 tenants on 2.5:

  • Automate tenant creation across all nodes
  • Active-active read/write. Let Raven handle syncing behind the scenes; it's good at this
  • More RAM is better than less RAM
  • Understand how your hosting infra affects Raven. We had to write custom failover code because of all of the virtual layers on Azure (we host on Azure VMs) (https://gist.github.com/hyrmn/7262c3d7450793550e48)
  • Expect replication to randomly not be set up even if it tells you it succeeded. Have logging for this (we have Raven logging to Seq)
  • Pre-stage indexes. Use an index naming scheme to support this (eg, PeopleSearch changes get deployed as PeopleSearch2). This means you should never reference an index by string. RavenDB 3.x with side-by-side indexes address this I think
  • Running is fine but server restarts are slow and messy. Block client traffic to the node and let clients failover to other node(s)
  • Multi-tenant on Raven is incredibly straightforward; use it to isolate at appropri
<!doctype html>
<html>
<head>
<title>Omphaloskepsis</title>
</head>
<body>
<button type="belly" class="innie" id="navel">@</button>
<script>
var navel = document.getElementById('navel');
public class ServiceBus
{
private readonly string _asbSecondaryUri = TypedCloudConfigurationManager.GetSetting("azure.serviceBus.connStrSecondary");
private readonly string _asbUri = TypedCloudConfigurationManager.GetSetting("azure.serviceBus.connStr");
private readonly bool _hasSecondary;
private readonly bool _isSyphon;
private readonly Lazy<MessagingFactory> _messagingFactory;
private readonly NamingStrategy _namingStrategy =
new NamingStrategy(TypedCloudConfigurationManager.GetSetting("azure.serviceBus.namingStrategy"));
#n Wyam.Markdown -p
#n Wyam.Razor -p
#n Wyam.Yaml -p
#n Wyam.Minification -p
#n AngleSharp
#an "System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
#an "System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
Settings.Host = "hyr.mn";
@hyrmn
hyrmn / ChildCollectionQueryTests.cs
Created May 16, 2016 22:05
Querying child collections by id in RavenDB
public class Foo
{
public string Id { get; set; }
public string Name { get; set; }
public Bar[] Bars { get; set; }
}
public class Bar
{
public string Id { get; set; }
@hyrmn
hyrmn / tests.cs
Created May 12, 2016 17:55
Convention-based injection of where clause for soft delete in RavenDB
public class Foo
{
public string Id { get; set; }
public string Name { get; set; }
public bool IsDeleted { get; set; }
}
public class Bar
{
public string Id { get; set; }
@hyrmn
hyrmn / gulpfile.js
Created February 19, 2016 17:23
One of our gulpfiles
var gulp = require('gulp'),
gulpif = require('gulp-if'),
less = require('gulp-less'),
autoprefixer = require('gulp-autoprefixer'),
minifycss = require('gulp-minify-css'),
rename = require('gulp-rename'),
clean = require('gulp-clean'),
runSequence = require('run-sequence'),
concat = require('gulp-concat'),
uglify = require('gulp-uglify'),
DECLARE @OhGod TABLE
(
TheThing varchar(50)
)
insert into @OhGod values('test')
insert into @OhGod values('TEST')
update @OhGod
set TheThing = replace(TheThing COLLATE Latin1_General_BIN, 'st', 'sty')