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
public static class FooBar | |
{ | |
public static string Foo { get; } = "Foo"; | |
public static string Bar { get; } = "Bar"; | |
public static IEnumerable<string> All { get; } = GetAll().ToImmutableList(); | |
static IEnumerable<string> GetAll() | |
{ | |
foreach (var prop in typeof(FooBar).GetProperties(BindingFlags.Static | BindingFlags.Public | BindingFlags.DeclaredOnly)) |
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
k3os-17054 [~]$ k3s check-config | |
Verifying binaries in /var/lib/rancher/k3s/data/688c8ca42a6cd0c042322efea271d6f3849d3de17c850739b0da2461f6c69ee8/bin: | |
- sha256sum: good | |
- links: good | |
System: | |
- /usr/sbin iptables v1.8.3 (legacy): ok | |
- swap: disabled | |
- routes: ok |
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
use crate::tag::TagLookup; | |
use git2::Repository; | |
pub struct Context { | |
// NOTE: This lifetime is fake | |
tags: TagLookup<'static>, | |
// IMPORTANT: this has to be last to be dropped last | |
repo: Box<Repository>, | |
} |
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
trait ValueCaster { | |
unsafe fn cast_to_any(&self, b: Box<dyn Value>) -> Box<dyn Any>; | |
} | |
struct BoxCaster<V: Value>(PhantomData<V>); | |
impl<V: Value> BoxCaster<V> { | |
const INSTANCE: BoxCaster<V> = BoxCaster(PhantomData); | |
} |
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
public static class Extensions | |
{ | |
// Temporary workaround until https://github.com/ChilliCream/hotchocolate/issues/2522 is resolved | |
public static LocaleDirective ToLocaleDirective(this IDirectiveContext context) | |
{ | |
var node = context.Directive.ToNode(removeNullArguments: false); | |
CultureInfo culture; | |
var cultureArgument = node.Arguments.FirstOrDefault(t => t.Name.Value == "culture"); | |
switch (cultureArgument) |
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
[Serializable] | |
[GraphQLName("locale")] | |
public sealed class LocaleDirective : ISerializable | |
{ | |
public LocaleDirective(CultureInfo culture) | |
{ | |
Culture = culture; | |
} | |
LocaleDirective(SerializationInfo info, StreamingContext context) |
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; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.Text.Json; | |
using StrawberryShake; | |
using StrawberryShake.Configuration; | |
using StrawberryShake.Http; | |
using StrawberryShake.Http.Subscriptions; | |
using StrawberryShake.Transport; |
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
// This file was initially generated by Windows Terminal (Unpackaged) 0.11.200421001-release0.11 | |
// It should still be usable in newer versions, but newer versions might have additional | |
// settings, help text, or changes that you will not see unless you clear this file | |
// and let us generate a new one for you. | |
// To view the default settings, hold "alt" while clicking on the "Settings" button. | |
// For documentation on these settings, see: https://aka.ms/terminal-documentation | |
{ | |
"$schema": "https://aka.ms/terminal-profiles-schema", |
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
macro_rules! define_core_ast_struct { | |
(@method [$($m:tt)*] $name:ident StringId) => { | |
$($m)* | |
pub fn $name<'a, 'ctx: 'a>(&'a self, context: &'ctx Context) -> &'ctx str { | |
&context.strings.lookup(self.$name) | |
} | |
}; | |
(@method [$($m:tt)*] $name:ident SliceId<$ty:ident>) => { | |
$($m)* |
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
pub(crate) struct Id<T: Sized>(NonZeroU32, PhantomData<*const T>); | |
impl<T: Sized> Clone for Id<T> { | |
#[inline] | |
fn clone(&self) -> Self { | |
*self | |
} | |
} | |
impl<T: Sized> Copy for Id<T> {} | |
impl<T: Sized> PartialEq for Id<T> { | |
#[inline] |