Skip to content

Instantly share code, notes, and snippets.

@MVoz
MVoz / CYRILLIC_FONT_FIX.md
Created April 23, 2017 23:37 — forked from Dither/CYRILLIC_FONT_FIX.md
Если в графических редакторах (Photoshop, GIMP, Krita итп) не печатаются русские буквы русифицированных (sic!) шрифтов

Проблемы со шрифтами

В русской раскладке текст отображается не тем шрифтом, который выставлен

Проблема возникает из-за криво русифицированных шрифтов. Исправление NLS в реестре (на c_1251.nls) при этом неконструктивно.

Исправление русификации шрифта с помощью программы FontForge

  1. Запускаем FontForge. Загружаем в него «некорректный» шрифт (пропускаем все запросы). Проверяем: если в списке присутствует русский символ «А» (в прямоугольнике; чёрный на белом) и, при его выделении, под меню показывает текст 1040 (0x410) U+0410 "....." CYRILLIC CAPITAL LETTER A, тогда шрифт и правда русифицирован, просто не хватает указания кодовых страниц (из-за этого он и не работает как надо), их мы добавим в пункте 2.
@MVoz
MVoz / Windows WiFi HotSpot
Created March 30, 2018 04:10 — forked from madhurjain/Windows WiFi HotSpot
Create a WiFi HotSpot to share your Internet connection using this tiny batch script. Put each line in a separate .bat file
Create and Start Hotspot
netsh wlan set hostednetwork mode=allow ssid=MyHotspot key=MyPassword
Start Hotspot
netsh wlan start hostednetwork
Stop Hotspot
netsh wlan stop hostednetwork

MsBuild exploration for C++

Three key files

The following three XMLs are key, and I recommend to import them always to take benefit to pre-defined Visual Studio tasks.

  • $(VCTargetsPath)\Microsoft.Cpp.default.props
  • $(VCTargetsPath)\Microsoft.Cpp.props
  • $(VCTargetsPath)\Microsoft.Cpp.targets

How to write your own build script by using benefit from MSBuild environment variables configuration corresponding specified platform (C++)

The following XML enables to resolve this challenge. SetBuildDefaultEnvironmentVariables is key of this.

<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="ManualBuild" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <PlatformToolset>v140</PlatformToolset> <!-- (Optional) only if want to explicitly specify platform toolset version -->
 8.1 
@MVoz
MVoz / cl.bat
Created April 1, 2018 17:52 — forked from retorillo/cl.bat
My commandline compiler and linkers settings for Windows x64
@"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\cl.exe" %*
@MVoz
MVoz / Windows C Compiler.ps1
Created April 1, 2018 17:53 — forked from retorillo/Windows C Compiler.ps1
Minimal PowerShell Script for Windows C Compiler (Requires Windows 10 SDK & Visual Studio 2015 Community)
$sdkver = "10.0.14393.0"
$sdkdir = "${env:ProgramFiles(x86)}\Windows Kits\10"
$sdkincdir = "$sdkdir\Include\$sdkver"
$sdklibdir = "$sdkdir\Lib\$sdkver"
$vcdir = "${env:ProgramFiles(x86)}\Microsoft Visual Studio 14.0\VC"
$env:path += ";$vcdir\bin\amd64;$sdkdir\bin\amd64"
$env:include += ";$vcdir\include" `
+ ";$sdkincdir\shared;$sdkincdir\ucrt;$sdkincdir\um;$sdkincdir\winrt"
$env:lib += ";$vcdir\lib\amd64;$sdklibdir\ucrt\x64;$sdklibdir\um\x64"
$env:libpath += "$vcdir\lib\amd64"
@echo off
setlocal
for /F %%a IN ('echo %1^|findstr /R ^[0-9][0-9]*$') DO set arg1num=%%a
IF "%1"=="%arg1num%" (
doskey /history | findstr /N /R .* | findstr /B %1: > %TEMP%\__history.tmp
FOR /F "delims=: tokens=1*" %%a IN (%TEMP%\__history.tmp) DO @echo %%b
) ELSE (
IF "%1"=="" (
doskey /history | findstr /N /R .*
) ELSE (
@MVoz
MVoz / vs_env_vars_win32.txt
Created April 2, 2018 03:50 — forked from teeks99/vs_env_vars_win32.txt
Visual Studio 2017 Command Prompt Variables
On Windows 7 - 32 Bit Install
C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Visual Studio 2017\Visual Studio Tools
Developer Command Prompt for VS 2017
Runs: %comspec% /k "C:\Program Files\Microsoft Visual Studio\2017\Community\Common7\Tools\VsDevCmd.bat"
Sets: PROCESSOR_ARCHITECTURE=x86
x64 Native Tools Command Prompt for VS 2017 (cl.exe doesn't run!)
Runs: %comspec% /k "C:\Program Files\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
@MVoz
MVoz / Git_mergetool_commands
Created April 5, 2018 08:47 — forked from RohanBhanderi/Git_mergetool_commands
Git Mergetool and difftool with Beyond Compare 4
//Git Mergetool and difftool with Beyond Compare 4
//For Windows
//IF running this command in git bash then escape $ with \
git config --global diff.tool bc4
git config --global difftool.bc4.cmd "\"C:/Program Files (x86)/Beyond Compare 4/BCompare.exe\" \"\$LOCAL\" \"\$REMOTE\""
git config --global difftool.prompt false
git config --global merge.tool bc4
git config --global mergetool.bc4.cmd "\"C:/Program Files (x86)/Beyond Compare 4/BCompare.exe\" \"\$LOCAL\" \"\$REMOTE\" \"\$BASE\" \"\$MERGED\""
git config --global mergetool.bc4.trustExitCode true
@MVoz
MVoz / dll2lib.md
Created April 19, 2018 19:39 — forked from azadkuh/dll2lib.md
extract the *.lib from a *.dll in Win32

extract *.lib from *.dll

do the following steps:

1. exports

extract the functions and classes in *.dll by:
$> dumpbin.exe /exports libsample.dll /out:libsample.def

2. function names