Skip to content

Instantly share code, notes, and snippets.

@dubrowgn
dubrowgn / results-oriented-style-guide.md
Last active July 28, 2022 07:48
Results Oriented Style Guide

Results Oriented Style Guide

For the Improvement of Our Software Craft and the Reduction of Stress

Style Guide Goal

The only goal of this style guide is the collective improvement of our professional craft as software engineers.

Non-Goals

This style guide is not about enforcing consistency, unless that consistency provides some tangible benefit to the professional craft. It is also not about absolutes, or rules that “shall not be broken.” As such, this style guide contains only guidelines.

@dubrowgn
dubrowgn / userChrome.css
Created November 16, 2017 05:17
tree-stype-tabs css fix
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
/*
* 1) open `about:support`, and open profile folder
* 2) create folder `chrome`
* 3) place this file inside using the filename `userChrome.css`
*/
#TabsToolbar {
visibility: collapse !important;
@dubrowgn
dubrowgn / move-copy-borrow.md
Last active September 14, 2023 13:54
Move, Copy, Borrow

Move/Copy/Borrow Semantics in Programming

Or, ramblings and complaints about the general state of programming and other possibly related grievances.

There are 3 primary ways to pass data into functions: move, copy, or borrow (aka a reference). Since mutability is inherently intertwined with data passing (this function can borrow my data, but only if they promise not to mess with it), we end up with 6 distinct combinations.

Move, Copy, Borrow, Mutable, Immutable

Every language has its own level of support and take on these semantics:

@dubrowgn
dubrowgn / language.md
Last active November 16, 2017 05:21
The Language I Wish I Used
  • native utf-8 (mutable vector strings, immutable slices for statics)
  • namespaces/modules
  • implicit memory management (like rust), or explicit with optional garbage collection (full GC, or leak/use-after-free checker)
  • explicit move/copy/borrow semantics
  • generics
  • native map/list/vector support (like clojure)
  • native iterator support (like linq)
  • structs/enums/tagged unions
  • rust style function signatures, incl. explicit self parameter
  • functions return tuples
@dubrowgn
dubrowgn / linq-concat-benchmark.cs
Created January 11, 2016 21:19
Linq Concat Benchmark
static void Main(string[] args)
{
Stopwatch sw = new Stopwatch();
int count;
IEnumerable<int> vals;
int k = 1000000;
for (int loops = 0; loops < 6; loops++)
{
Console.WriteLine($"Run {loops}");