Skip to content

Instantly share code, notes, and snippets.

View 3F's full-sized avatar
🗃️
⏳ . . .

Denis Kuzmin 3F

🗃️
⏳ . . .
View GitHub Profile
@3F
3F / _
Last active November 12, 2021 17:08
...
made with ❤ love to opensource, github, and tea ☕
-- Denis Kuzmin
@3F
3F / .csproj
Created February 19, 2020 19:23
ILMerge and other related 3rd party tool for .NET DllExport
<!-- https://ko-fi.com/post/ILMerge-and-other-related-3rd-party-tool-for--NET-Y8Y71FVU4 -->
...
<!-- For .NET DllExport 1.7 -->
<Target Name="Merging" BeforeTargets="DllExportMod">
<Copy SourceFiles="$(DllExportMetaLibFullPath)"
DestinationFolder="$(TargetDir)"
SkipUnchangedFiles="true"
OverwriteReadOnlyFiles="true" />
@3F
3F / PublicKey.bat
Last active March 15, 2020 23:35
PublicKey from .dll or .snk or .pfx
@echo off
:: PublicKey <.dll or .snk or .pfx>
set file=%1 & set ext=%~x1
if not exist %file% goto notfound
if "%ext%"==".dll" (
call sn -q -Tp %file% || goto err
goto exit
)
@3F
3F / 01nsbin.ps1
Created September 30, 2016 10:55
Old script for raw modification of binary .net assemblies on powershell.
# Modification of binary assemblies. Format and specification:
#
# https://github.com/3F/DllExport/issues/2#issuecomment-231593744
#
# Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
#
# 000005B0 00 C4 7B 01 00 00 00 2F 00 12 05 .Д{..../...
# 000005C0 00 00 02 00 00 00 00 00 00 00 00 00 00 00 26 00 ..............&.
# 000005D0 20 02 00 00 00 00 00 00 00 44 33 46 30 30 46 46 ........D3F00FF <<<<
# 000005E0 31 37 37 30 44 45 44 39 37 38 45 43 37 37 34 42 1770DED978EC774B <<<<...
@3F
3F / reloadProjects.cs
Last active November 10, 2016 20:57
Script to reload projects in solution of Visual Studio IDE after adding git submodules. For https://github.com/3F/LunaRoad via vsSBE: https://visualstudiogallery.msdn.microsoft.com/0d1dbfd7-ed8a-40af-ae39-281bfeca2334/
//#[($(ProjectDir:Conari) == "*Undefined*" && ( $(BuildingInsideVisualStudio) || $(VSIDE) || $(DevEnvDir) != "*Undefined*") ) {
using System;
using Microsoft.VisualStudio;
using Microsoft.VisualStudio.Shell.Interop;
using ICommand = net.r_eg.vsSBE.Actions.ICommand;
using ISolutionEvent = net.r_eg.vsSBE.Events.ISolutionEvent;
namespace vsSolutionBuildEvent
{
@3F
3F / msbuild.bat
Last active December 8, 2016 17:21
PowerShell & MSBuild Helper tools :: github.com/3F
@echo off
setlocal enableDelayedExpansion
:: The MSBuild-helper. Part of GetNuTool
:: https://github.com/3F/GetNuTool
:: arguments:
::
:: msbuild -notamd64 <args> - to select x86 instance instead of x64 if it's possible.
:: msbuild <args> - to select any available instance.
@3F
3F / gnt.bat
Last active December 8, 2016 17:27
Portable non-binary NuGet Client for work with NuGet packages. [GNT], [gnt.core] /GetNuTool v1.6 :: https://github.com/3F/GetNuTool
@echo off
:: GetNuTool - Executable version
:: Copyright (c) 2015-2016 Denis Kuzmin [ entry.reg@gmail.com ]
:: https://github.com/3F/GetNuTool
set gntcore=gnt.core
set tgnt="%temp%\%random%%random%%gntcore%"
set args=%*
set a=%args:~0,30%
@3F
3F / msiextr.cmd
Created May 19, 2016 20:14
Shell extension - MSI extractor. For quick unpacking files from Windows Installer Package and other access when 7z can't help...
@echo off
set in=%1
set fpath=%in:~1,-1%
set odir=%fpath:~0,-4%_msi
echo extract into %odir% ...
msiexec /a "%fpath%" /qb TARGETDIR="%odir%"
REM # ~
@3F
3F / CalculateOrder.cs
Created September 7, 2015 21:55
How to detect the first & last project of build-order in solution of Visual Studio. And how to use directly SBE-Scripts engine from C# Mode. / Example for vsSolutionBuildEvent users
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
using ICommand = net.r_eg.vsSBE.Actions.ICommand;
using ISolutionEvent = net.r_eg.vsSBE.Events.ISolutionEvent;
namespace vsSolutionBuildEvent
{
@3F
3F / CfgNLog.cs
Created September 2, 2015 15:54
Example of NLog initialization with bug fixes from other assemblies if exists
/*
* Example of NLog initialization with bug fixes from other assemblies if exists:
* 1. if another used the NLog.Config.SimpleConfigurator.
* 2. if target from another has been configured as "*" (optional bug)
*/
using NLog;
using NLog.Config;
using NLog.Filters;
using NLog.Targets;