Skip to content

Instantly share code, notes, and snippets.

@jechtom
jechtom / bears-query.txt
Last active September 10, 2023 23:17
demo-technical-debt-2023
Based on the given format specification, write a few example documents in this format.
Documentation follows:
2. BEARS Grammar
A BEARS text is a sequence of tokens. The set of tokens includes six
structural characters, strings, numbers, and three literal names.
A BEARS text is a serialized value. Note that certain previous
specifications of BEARS constrained a BEARS text to be an object or an
@jechtom
jechtom / ASS.md
Created September 3, 2023 15:01 — forked from anonymous/ASS.md
Acronyms Seriously Suck - Elon Musk

From time to time, Musk will send out an e-mail to the entire company to enforce a new policy or let them know about something that's bothering him. One of the more famous e-mails arrived in May 2010 with the subject line: Acronyms Seriously Suck:

There is a creeping tendency to use made up acronyms at SpaceX. Excessive use of made up acronyms is a significant impediment to communication and keeping communication good as we grow is incredibly important. Individually, a few acronyms here and there may not seem so bad, but if a thousand people are making these up, over time the result will be a huge glossary that we have to issue to new employees. No one can actually remember all these acronyms and people don't want to seem dumb in a meeting, so they just sit there in ignorance. This is particularly tough on new employees.

That needs to stop immediately or I will take drastic action - I have given enough warning over the years. Unless an acronym is approved by me, it should not enter the SpaceX glossary.

@jechtom
jechtom / google-plus-api-shutdown-simulate.farx
Created February 3, 2019 09:27
Simulates shutting down Google+ API in Fiddler using AutoResponderRules
<?xml version="1.0" encoding="utf-8"?>
<AutoResponder LastSave="2019-02-03T10:25:37.3009272+01:00" FiddlerVersion="5.0.20182.28034">
<State Enabled="true" Fallthrough="true" UseLatency="false">
<ResponseRule Match="regex:(?inx)^https://www.googleapis.com/plus/.+$" Action="404_Plain.dat" Enabled="true" />
</State>
</AutoResponder>

Keybase proof

I hereby claim:

  • I am jechtom on github.
  • I am jechtom (https://keybase.io/jechtom) on keybase.
  • I have a public key whose fingerprint is 6F7C A1C4 A6DA BF80 8EFB 5936 484F D183 D5DF 9C50

To claim this, I am signing this object:

using Newtonsoft.Json;
using Newtonsoft.Json.Bson;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Services
@jechtom
jechtom / bug
Created February 20, 2015 11:49
foreach (var dataContract in contracts)
{
var result = dataContract.Validate();
if (result.IsValid)
return;
// disable logging for this kind of exception (its validation error)
var ex = result.ToException(ErrorCodes.InvalidRequest);
MarkAsValidationError(ex);
throw ex;
bool ok = false;
// make sure all data has been written
while (fileStream.Position < fileStream.Length || !(ok = true))
{
var data = _dataSerializer.Read(fileStream);
if (data == null) // if null, data is corrupted
break;
checkedDataLength = fileStream.Position;