Skip to content

Instantly share code, notes, and snippets.

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

Denis Kuzmin 3F

🗃️
⏳ . . .
View GitHub Profile
@3F
3F / act.cs
Last active August 29, 2015 14:23
Default Entry point for user code in vsSolutionBuildEvent - http://vssbe.r-eg.net/doc/Modes/CSharp/
using ICommand = net.r_eg.vsSBE.Actions.ICommand;
using ISolutionEvent = net.r_eg.vsSBE.Events.ISolutionEvent;
namespace vsSolutionBuildEvent
{
public class CSharpMode
{
public static int Init(ICommand cmd, ISolutionEvent evt)
{
return 0;
@3F
3F / Sample.sln.msbuild.targets
Created June 4, 2015 15:25
Variant 3: based on idea 'Map of projects'. Illustrates solution-wide PRE/POST 'events' for build-operations from Visual Studio IDE (i.e. primary from VS IDE and msbuild.exe as optional)
<?xml version="1.0" encoding="utf-8"?>
<!--
Illustrates solution-wide PRE/POST 'events' for build-operations from Visual Studio IDE (i.e. primary from VS IDE and msbuild.exe as optional)
Alternative for IVsUpdateSolutionEvents2/IVsUpdateSolutionEvents etc.
-
Variant 3: based on idea 'Map of projects'.
Problems for this variant:
* Unavailable projects - for example, if user clicked on 'Unload Project' in Solution Explorer.
However, it's trivial and not related as main bug.. This should be resolved with 'Reload Project'.
-
@3F
3F / 1_cshelp.sh
Created April 19, 2015 13:28
Parsing of .html files and generating cshelp.h with C++ macro definitions - /replacement gen_cshelp.py on bash & batch commands - https://bitbucket.org/3F/featuresdc/issue/1/ :: Old sample. Netbeans
#!/bin/sh
# range of 11000 - 11999
# replacement help/gen_cshelp.py
# details on https://bitbucket.org/3F/featuresdc/issue/1/help-cshelph-dcpp-version-revnoinc
##### variables #####
range_begin=11000
workdir=../../../src/help
@3F
3F / revision.bat
Created April 19, 2015 12:50
Deprecated example of how to update revision with data from SCM - git
: Deprecated example of how to update revision with data from SCM - git
: format output: C++ preprocessor directives - #define (macro definitions)
@echo off
: Result into
set fout=revision.h
: Get data
@3F
3F / changes.bat
Created April 19, 2015 12:49
Deprecated example of how to get changes between revisions for SCM - git
: Deprecated example of how to get changes between revisions for SCM - git
@echo off
: Compare from sha1
set fromsha1=73fa2e6a9c01f70c09fd2ed7eb965ee59b924580
: Result into
set fout=Changes.diff
@3F
3F / 0_Version.cs
Last active January 30, 2016 10:07
Example of the Version class for vsSolutionBuildEvent documentation
// This code was generated by a tool.
// Changes to this file may cause incorrect behavior and will be lost if the code is regenerated.
namespace net.r_eg.vsSBE
{
internal class Version
{
public static readonly System.Version number = new System.Version(0, 11, 3, 47085);
public const string numberWithRevString = "0.11.3.47085";
public const string numberString = "0.11.3";
public const string branchName = "master";
#["
To restore packages with GetNuTool
It's important for packages of solution-level in VS2015
https://github.com/NuGet/Home/issues/522
"]
#[($([System.Convert]::ToInt32("$(VisualStudioVersion.Replace('.', ''))")) >= 140)
{
#[NuGet gnt.raw("/p:ngconfig=\".nuget/packages.config\"")]
}]
@3F
3F / gist:b7151892d50bf63df686
Last active August 29, 2015 14:11
Automatic Version Numbering for VSIX Package (vsixmanifest) with vsSolutionBuildEvent
#["
Updating version
"]
#[var ver = #[File get("_version")]]
#[var tpl = #[File get("Version.tpl")]]
#[var vsSBEDir = $($(ProjectDir:$(SolutionName)))]
#[var tStart = $([System.DateTime]::Parse("2015/01/15").ToBinary())]
#[var tNow = $([System.DateTime]::UtcNow.Ticks)]
@3F
3F / gist:fa4ed0c31ae5f2f3ff60
Created September 9, 2014 15:25
for Regex101 - Issue #119
/* Light colors version */
.regex_colorizer b , .richtext b, .community_sub_box b {
background: #EAEFF7;
color: #000080;
}
.regex_colorizer u , .richtext u {
background: #B388EF;
color: #F4F1F9;
}
-- example for http://stackoverflow.com/questions/24580287/#comment38085601_24580344
-- MySQL AI-generator & LAST_INSERT_ID()
INSERT INTO `user` (`id`, `email`) VALUES (1, 'email1'); -- or your INSERT IGNORE INTO
INSERT INTO `user` (`id`, `email`) VALUES (2, 'email2');
SELECT LAST_INSERT_ID(); -- should be 0 /note: all records successfully inserted
/*
CREATE TABLE `user` (