Skip to content

Instantly share code, notes, and snippets.

View RikkiGibson's full-sized avatar

Rikki Gibson RikkiGibson

View GitHub Profile
RunTest command line
--dotnet C:\Program Files\dotnet\dotnet.exe --logs C:\Users\rikki\src\roslyn2\artifacts\log\Debug --configuration Debug --tfm net472 --timeout 90 --include '\.UnitTests' --html --platform x86
Running 'C:\Program Files\dotnet\dotnet.exe --version'..
6.0.100
Assembly Schedule: Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests.dll
Partition: 1 method count 2310 delta 310
ConvertNamespaceTestState 0
ExceptionCodeAction 0
Microsoft.CodeAnalysis.AddMissingImports.CSharpAddMissingImportsRefactoringProviderTests 9
@RikkiGibson
RikkiGibson / required-props-1st-feb-2021.md
Last active February 1, 2021 21:37
Design notes on "required properties" from Feb 1st 2021

inits() vs other keywords

In the 28th January meeting we decided the inits() syntax is the one we're happiest with so far. There are likely multiple areas of concern about it, but one noteworthy concern is about the keyword that begins the "inits" clause.

A few reasons for concern about the keyword "inits":

  • inits is VB-ish, in the way that VB says Overrides while C# says override.
  • inits strongly resembles init, but init has an unrelated meaning, which we may want to introduce independently to method signatures. (The proposed init modifier on a method enables it to call init accessors, while making the method only callable during construction.)

The biggest reason I can think of to separate inits from init is the following: A "helper" should not be limited to only being called during construction. If object instances are sometimes allocated from scratch and used, and other times are fetched from a pool and used, it may be desirable to call a helper both during and after constr

# This script scrapes AzDo data and writes out a CSV of build runtimes
$roslynPipelineId = "15"
$baseURL = "https://dev.azure.com/dnceng/public/_apis/"
$runsURL = "$baseURL/pipelines/$roslynPipelineId/runs?api-version=6.0-preview.1"
$buildsURL = "$baseURL/build/builds/"
$runs = (Invoke-WebRequest -uri $runsURL | ConvertFrom-Json)
$wantedRecords = @(
private static void ValidateGoogleSchedule(List<GoogleRouteSchedule> routeSchedules)
{
foreach (GoogleRouteSchedule routeSchedule in routeSchedules)
{
foreach (GoogleDaySchedule routeDaySchedule in routeSchedule.Days)
{
var stopSchedules = routeDaySchedule.StopSchedules;
var pairs = stopSchedules.Take(stopSchedules.Count - 1).Zip(stopSchedules.Skip(1), (fst, snd) => (fst, snd));
foreach (var (fst, snd) in pairs)
{
! function(e, a) {
"object" == typeof exports && "undefined" != typeof module ? a(exports, require("ms-rest-azure-js"), require("ms-rest-js")) : "function" == typeof define && define.amd ? define(["exports", "ms-rest-azure-js", "ms-rest-js"], a) : a(e.ArmStorage20180301Preview = {}, e.msRestAzure, e.msRest)
}(this, function(e, a, t) {
"use strict";
var r = function(e, a) {
return (r = Object.setPrototypeOf || {
__proto__: []
}
instanceof Array && function(e, a) {
e.__proto__ = a
interface Point {
row: number
column: number
someOtherShitThatAtomUses: idk
color: string
}
var doStuffWithPoint(point: { row: number, column: number}) {
...
}
@RikkiGibson
RikkiGibson / gist:8085aad972750d3d3cb8
Created March 29, 2016 00:05
Stack level too deep with "brew search gcc"
The invocation that failed:
$ brew search gcc
Error: stack level too deep
Please report this bug:
https://git.io/brew-troubleshooting
/usr/local/Library/Homebrew/formulary.rb:21
----- brew config -----
HOMEBREW_VERSION: 0.9.5
@RikkiGibson
RikkiGibson / adt.ts
Created March 11, 2016 23:44
Fake ADTs in TypeScript
type Meters = { meters: number };
type Feet = { feet: number };
type Distance = Meters | Feet;
function isMeters(distance: Distance): distance is Meters {
return typeof (distance as Meters).meters === 'number';
}
function isFeet(distance: Distance): distance is Feet {
return typeof (distance as Feet).feet === 'number';
}