Skip to content

Instantly share code, notes, and snippets.

View bigjonroberts's full-sized avatar

Jon Roberts bigjonroberts

  • San Antonio, TX
  • 19:12 (UTC -05:00)
View GitHub Profile
@ctsrc
ctsrc / .gitignore
Last active February 19, 2024 01:55
Random dungeon generator from https://news.ycombinator.com/item?id=19309378, deobfuscated, refactored and commented
/.idea/
/cmake-build-debug/
/dungeon
@munificent
munificent / generate.c
Last active May 1, 2024 20:06
A random dungeon generator that fits on a business card
#include <time.h> // Robert Nystrom
#include <stdio.h> // @munificentbob
#include <stdlib.h> // for Ginny
#define r return // 2008-2019
#define l(a, b, c, d) for (i y=a;y\
<b; y++) for (int x = c; x < d; x++)
typedef int i;const i H=40;const i W
=80;i m[40][80];i g(i x){r rand()%x;
}void cave(i s){i w=g(10)+5;i h=g(6)
+3;i t=g(W-w-2)+1;i u=g(H-h-2)+1;l(u
@alferov
alferov / docker-rm-images.md
Last active July 24, 2023 08:33
Remove all (untagged) images and containers from Docker
# Delete all containers
docker rm $(docker ps -aq)
# Delete all images
docker rmi $(docker images -q)
# Delete all untagged images
docker rmi $(docker images -q --filter "dangling=true")

References:

@mjul
mjul / elasticsearch.fsx
Last active June 1, 2022 08:15
Elasticsearch in F# example
// paket add nuget NEST
#I "../../packages"
#r "Elasticsearch.Net/lib/net46/Elasticsearch.Net.dll"
#r "NEST/lib/net46/Nest.dll"
open System
//open Elasticsearch.Net
open Nest
@jen20
jen20 / MessageIdentity.cs
Created August 19, 2014 17:39
Generator for deterministic GUIDs
public class MessageIdentity
{
public Guid NameSpace;
private readonly byte[] _namespaceBytes;
public MessageIdentity(Guid guidNameSpace)
{
NameSpace = guidNameSpace;
_namespaceBytes = guidNameSpace.ToByteArray();
SwapByteOrder(_namespaceBytes);
@brainded
brainded / JsonExtensions.cs
Last active September 16, 2018 17:18
Code snippet to make a ToJson extension method for objects in C#. Relies on NewtonSoft.Json Nuget.
public static class ObjectExtensions
{
/// <summary>
/// The string representation of null.
/// </summary>
private static readonly string Null = "null";
/// <summary>
/// The string representation of exception.
/// </summary>
@valm
valm / TPL DataFlow and Reactive Extensions Examples
Created November 14, 2013 14:04
TPL DataFlow and Reactive Extensions Example
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Reactive.Linq;
using System.Text;
using System.Threading;
@ttscoff
ttscoff / a_lazy_youtube_tag.rb
Last active January 26, 2020 17:57
My current setup for embedding YouTube videos in Jekyll. Responsive layout, poster image first/click to load for faster page loads.Provides a `{% youtube VIDEOID 800 600 "optional caption" %}` tag that generates the markup needed for the CSS and jQuery script.
# Title: Responsive Lazy Load YouTube embed tag for Jekyll
# Author: Brett Terpstra <http://brettterpstra.com>
# Description: Output a styled element for onClick replacement with responsive layout
#
# Syntax {% youtube video_id [width height] ["Caption"] %}
#
# Example:
# {% youtube B4g4zTF5lDo 480 360 %}
# {% youtube http://youtu.be/2NI27q3xNyI %}
@SzymonPobiega
SzymonPobiega / gist:5220595
Last active April 25, 2024 17:19
DDD/CQRS/ES/Architecture videos

If you have two days to learn the very basics of modelling, Domain-Driven Design, CQRS and Event Sourcing, here's what you should do:

In the evenings read the [Domain-Driven Design Quickly Minibook]{http://www.infoq.com/minibooks/domain-driven-design-quickly}. During the day watch following great videos (in this order):

  1. Eric Evans' [What I've learned about DDD since the book]{http://www.infoq.com/presentations/ddd-eric-evans}
  2. Eric Evans' [Strategic Design - Responsibility Traps]{http://www.infoq.com/presentations/design-strategic-eric-evans}
  3. Udi Dahan's [Avoid a Failed SOA: Business & Autonomous Components to the Rescue]{http://www.infoq.com/presentations/SOA-Business-Autonomous-Components}
  4. Udi Dahan's [Command-Query Responsibility Segregation]{http://www.infoq.com/presentations/Command-Query-Responsibility-Segregation}
  5. Greg Young's [Unshackle Your Domain]{http://www.infoq.com/presentations/greg-young-unshackle-qcon08}
  6. Eric Evans' [Acknowledging CAP at the Root -- in the Domain Model]{ht