Skip to content

Instantly share code, notes, and snippets.

private static void Main()
{
Expression<Func<Hoge, Hoge>> expression = x => new Hoge(x.i + 9)
{
a = new[] { 8, 9, x.i * 2 }
};
expression.Dump();
var rewrited = Bind(expression, new Hoge(10));
void Main()
{
var instance = new First {
Second = new Second {
Third = new Third {
Value = 100
}
}
};
static Func<CustomAttributeData, TAttribute> GetAttributeInstanceCreator<TAttribute>(
CustomAttributeData customAttributeData)
{
var customAttributeDataParameter = Expression.Parameter(typeof(CustomAttributeData));
var constructorArgumentsExpression = Expression.Property(
customAttributeDataParameter,
nameof(CustomAttributeData.ConstructorArguments));
var listOfConstructorArgumentIndexer = (PropertyInfo)typeof(IList<CustomAttributeTypedArgument>).GetDefaultMembers()[0];
Components \ Versions 2.0 3.0 4.0 5.0 5.1
PowerShell
PowerShell ISE
PowerShell DSC
WMI
WinRM
Management OData IIS Extensions
Server Manager CIM Provider
Just Enough Administration
$keys =
Get-ChildItem -LiteralPath 'Registry::HKEY_CLASSES_ROOT' |
Add-Member -MemberType ScriptProperty -Name 'LeafName' -Value { Split-Path -Leaf $this.PSPath } -Force -PassThru |
? { $_.LeafName.StartsWith('.') } |
% {
$progIds = @($_.GetValue(''))
$key = Get-Item -LiteralPath (Join-Path -Path $_.PSPath -ChildPath 'OpenWithProgIds') -ErrorAction Ignore
if ($key) {
$progIds += @($key.GetValueNames())
Import-Module -Name PowerShellGet
Update-FormatData -AppendPath (Join-Path -Path $PSScriptRoot -ChildPath '.\InstalledModule.format.ps1xml')
function Get-InstalledModule {
<#
.ForwardHelpTargetName PowerShellGet\Get-InstalledModule
#>
Array.prototype.forEach.call(document.querySelectorAll('.webcatalog-favorite-dialog-color input[value="1"]'), (e) => e.click())
Jenkins.instance.getItem("projectName").items.each {
it.setDisabled(true)
try {
build = it.getLastBuild()
while (build != null) {
previousBuild = build.previousBuild
<Query Kind="Expression">
<NuGetReference>Newtonsoft.Json</NuGetReference>
<Namespace>Newtonsoft.Json</Namespace>
</Query>
JsonConvert.DeserializeObject("{\"foo\": \"bar\"}")
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral"/>
<codeBase version="10.0.0.0" href="bin/Newtonsoft.Json.10.0.0.0/Newtonsoft.Json.dll"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>