Skip to content

Instantly share code, notes, and snippets.

Ben Hyrman hyrmn

Block or report user

Report or block hyrmn

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View richhickey.md

Rich Hickey on becoming a better developer

Rich Hickey • 3 years ago

Sorry, I have to disagree with the entire premise here.

A wide variety of experiences might lead to well-roundedness, but not to greatness, nor even goodness. By constantly switching from one thing to another you are always reaching above your comfort zone, yes, but doing so by resetting your skill and knowledge level to zero.

Mastery comes from a combination of at least several of the following:

View gitconfig
[user]
name = Ben Hyrman
email = ben.hyrman@gmail.com
[core]
autocrlf = true
editor = vim
excludesfile = C:\\Users\\B.Hyrman\\Documents\\gitignore_global.txt
[credential]
helper = manager
[merge]
View ServiceBusDispatcher.cs
using System;
using System.Collections.Concurrent;
using Anotar.Serilog;
using Microsoft.ServiceBus.Messaging;
using RezStream.Infrastructure;
namespace RezCloud.Infrastructure.AzureBus
{
public class Queues : Enumeration<Queues, string>
{
View gist:51ca84d9a60a63ab66e31cc5871e4b84
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.
View DateAndTimeJsonConverter.cs
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 Jun 22, 2016
Raven 2.5 with 500 tenants on several nodes.
View thoughs.md

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
View gist:7fc9c1e65b5be83299e1c7c80842e3e0
<!doctype html>
<html>
<head>
<title>Omphaloskepsis</title>
</head>
<body>
<button type="belly" class="innie" id="navel">@</button>
<script>
var navel = document.getElementById('navel');
View ServiceBus.cs
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"));
View config.wyam
#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
Querying child collections by id in RavenDB
View ChildCollectionQueryTests.cs
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; }
You can’t perform that action at this time.