This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type ObjectKeys<T> = { [P in keyof T]: T[P] extends object ? P : never }[keyof T]; | |
type FirebaseInit<T> = Omit<T, ObjectKeys<T>> & {[P in ObjectKeys<T>]: ''} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Using docker subcommand `compose` | |
$ docker compose up | |
$ docker container inspect kafka -f ' Image: {{ .Image }}{{"\n"}}Config.Image: {{.Config.Image}}' | |
Image: sha256:d694642b6bef4693082bd6192d923f37af9e27ef15beef9de7d93a51d1a5d74d | |
Config.Image: sha256:d694642b6bef4693082bd6192d923f37af9e27ef15beef9de7d93a51d1a5d74d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Window xmlns="https://github.com/avaloniaui" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
xmlns:vm="using:AvaloniaTest.ViewModels" | |
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" | |
x:Class="AvaloniaTest.Views.MainWindow" | |
Icon="/Assets/avalonia-logo.ico" | |
Title="AvaloniaTest"> | |
<Window.Styles> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package metrics | |
import ( | |
"fmt" | |
"github.com/onsi/gomega/format" | |
"github.com/onsi/gomega/matchers" | |
"github.com/onsi/gomega/types" | |
"reflect" | |
"strings" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using (var outStream = new MemoryStream()) | |
{ | |
var zipOutputStream = new ZipOutputStream(outStream); | |
await outStream.FlushAsync(cancellationToken); | |
outStream.Seek(0, SeekOrigin.Begin); | |
zipOutputStream.SetLevel(CompressionMax); | |
foreach (var file in files) | |
{ | |
using (var inStream = new MemoryStream()) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Linq; | |
using static System.IO.File; | |
using static System.Console; | |
int GetTreeProd(string[] map, params (int x, int y)[] strats) | |
=> strats.Aggregate(1, (a, t) => a * Enumerable.Range(0, map.Length / t.y).Count(i => map[t.y * i][t.x * i % map[0].Length] == '#')); | |
var map = ReadAllLines("input.txt"); | |
WriteLine($"Silver: {GetTreeProd(map, (3, 1))}"); | |
WriteLine($"Gold: {GetTreeProd(map, (1,1), (3,1), (5,1), (7,1), (1,2))}"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.IO; | |
using System.Collections.Immutable; | |
using System.Linq; | |
using static System.Linq.Enumerable; | |
using static ConLib.PrettyConsole; | |
var seats = new bool[0b1111111111]; | |
foreach (var line in File.ReadLines("input.txt")) | |
seats[line.Select(s => "BR".Contains(s) ? 1 : 0).Aggregate(0, (a, b) => b | a << 1)] = true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Linq; | |
using static System.IO.File; | |
using static System.Console; | |
using System.Text.RegularExpressions; | |
var required = new [] {"byr","iyr","eyr","hgt","hcl","ecl","pid"}; | |
var eyecol = new [] {"amb", "blu", "brn", "gry", "grn", "hzl", "oth"}; | |
bool numInRange(string y, int min, int max) => int.TryParse(y, out int yr) && yr >= min && yr <= max; | |
bool heightValid(string h) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="Windows-1252" ?> | |
<!--// | |
Monokai-pkmod | |
Copyright (c) 2008 Fabio Zendhi Nagao <http://zend.lojcomm.com.br/> | |
Modifications by nils, piksel bitworks | |
Permission is hereby granted, free of charge, to any person | |
obtaining a copy of this software and associated documentation | |
files (the "Software"), to deal in the Software without |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git diff origin/master -- go.mod | |
index 300eb31..d549e82 100644 | |
--- a/go.mod | |
+++ b/go.mod | |
@@ -39,8 +39,8 @@ require ( | |
github.com/lib/pq v1.2.0 // indirect | |
github.com/miekg/pkcs11 v0.0.0-20190401114359-553cfdd26aaa // indirect | |
github.com/morikuni/aec v0.0.0-20170113033406-39771216ff4c // indirect | |
- github.com/onsi/ginkgo v1.8.0 | |
- github.com/onsi/gomega v1.5.0 |