Skip to content

Instantly share code, notes, and snippets.

View devhawk's full-sized avatar

Harry Pierson devhawk

View GitHub Profile
internal unsafe static void AppendUnmanged<T>(this IncrementalHash hasher, in T item) where T : unmanaged
{
fixed (T* ptr = &item)
{
hasher.AppendData(MemoryMarshal.AsBytes(new ReadOnlySpan<T>(ptr, 1)));
}
}
using Neo;
using Neo.SmartContract.Framework;
using Neo.SmartContract.Framework.Services;
namespace DevHawk
{
public class TestContract : SmartContract
{
StorageMap domains = new StorageMap(Storage.CurrentContext, nameof(domains));
@devhawk
devhawk / output.json
Created December 15, 2021 18:50
Neo Test Runner Sample Output
// > Executing task: dotnet neo-test-runner ./invoke-files/register-sample-domain.neo-invoke.json --checkpoint ./checkpoints/contract-deployed.neoxp-checkpoint --account bob --express ./default.neo-express --storages registrar --nef-file ./src/bin/sc/registrar.nef
{
"state": "HALT",
"exception": null,
"gasconsumed": "0.0869496",
"logs": [],
"notifications": [],
"stack": [
{
static int GetLength(ReadOnlyMemory<char> base64)
{
if (base64.IsEmpty) return 0;
var characterCount = base64.Length;
var paddingCount = 0;
if (base64.Span[characterCount - 1] == '=') paddingCount++;
if (base64.Span[characterCount - 2] == '=') paddingCount++;
return (3 * (characterCount / 4)) - paddingCount;
id DN00
title The Design Note Process
author hpierson@hotmail.com
status draft

DN00 - The Design Note Process

@devhawk
devhawk / looking for the mouse.md
Created February 5, 2024 15:10 — forked from jm3/looking for the mouse.md
Gin, Television, and Social Surplus

Gin, Television, and Social Surplus, or, “Looking for the Mouse”

Clay Shirky / April 26, 2008

transcription of a speech [Clay Shirky] gave at the Web 2.0 in 2008, emphasis by @jm3

I was recently reminded of some reading I did in college, way back in the last century, by a British historian arguing that the critical technology, for the early phase of the industrial revolution, was gin.

The transformation from rural to urban life was so sudden, and so wrenching, that the only thing society could do to manage was to drink itself into a stupor for a generation. The stories from that era are amazing-- there were gin pushcarts working their way through the streets of London.

And it wasn't until society woke up from that collective bender that we actually started to get the institutional structures that we associate with the industrial revolution today. Things like public libraries and museums, increasingly broad education for children, elected leaders--a lot of th