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
def resolve_type_argument(query_type: type, target_type: type | GenericAlias, argument: TypeVar) -> type | TypeVar: | |
"Resolves a given TypeVar for a generic type `query_type` when supplied by `target_type`" | |
type_params = query_type.__parameters__ | |
type_arguments = resolve_type_arguments(query_type, target_type) | |
params_to_args = {key: value for (key, value) in zip(type_params, type_arguments)} | |
return params_to_args[argument] | |
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.IO; | |
using System.Windows; | |
using System.Windows.Input; | |
using System.Windows.Media; | |
using Microsoft.CodeAnalysis; | |
using RoslynPad.Editor; | |
using WpfAppCommon; | |
namespace Namespace |
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.Concurrent; | |
using System.Linq; | |
using System.Reflection; | |
using LanguageExt; | |
using Newtonsoft.Json; | |
using Newtonsoft.Json.Linq; | |
public class OptionJsonConverter : JsonConverter | |
{ |
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
#!/usr/bin/env bash | |
# | |
# Example usage: | |
# | |
# $ VERSION=1.3 sudo ./goinst.sh | |
if [ "$(id -u)" != "0" ]; then | |
echo "This script must be run as root" 1>&2 | |
exit 1 | |
fi |
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 class AlignableWrapPanel : Panel | |
{ | |
public HorizontalAlignment HorizontalContentAlignment | |
{ | |
get { return (HorizontalAlignment)GetValue(HorizontalContentAlignmentProperty); } | |
set { SetValue(HorizontalContentAlignmentProperty, value); } | |
} | |
public static readonly DependencyProperty HorizontalContentAlignmentProperty = | |
DependencyProperty.Register("HorizontalContentAlignment", typeof(HorizontalAlignment), typeof(AlignableWrapPanel), new FrameworkPropertyMetadata(HorizontalAlignment.Left, FrameworkPropertyMetadataOptions.AffectsArrange)); |