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
import re | |
import urllib.request | |
import os | |
def readFileFromUrl(url): | |
try: | |
request = urllib.request.urlopen(url) | |
result = request.read().decode('utf-8') | |
return result | |
except: |
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
Remove all deleted files from git stage: | |
git rm $(git ls-files --deleted) | |
Update all subrepos in folder | |
find . -maxdepth 1 -type d -exec sh -c '(cd {} && git pull)' ';' | |
find . -maxdepth 1 -type d -exec sh -c '(cd {} && git checkout develop && git pull)' ';' | |
Clean remote and local git: | |
1. git remote prune --dry-run origin //-dry-run shows remore branched to be deleted without deleting | |
2. Delete all local branches that was merged by pattern |
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
REM Скрипт для разблокировки файлов, скачанных из сети. Разблокирует все файлы в текущей директории и подкаталогах. | |
FOR /R %%F IN (*.*) DO echo.>"%%F":Zone.Identifier |
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 ConsoleShutdown | |
{ | |
[DllImport("kernel32.dll")] | |
private static extern bool SetConsoleCtrlHandler(ControlEventHandler e, bool add); | |
public enum ConsoleEvent | |
{ | |
CTRL_C = 0, // From wincom.h | |
CTRL_BREAK = 1, | |
CTRL_CLOSE = 2, |
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
internal static class PtrExtensions | |
{ | |
public static IEnumerable<T> GetArrayOfStruct<T>(this IntPtr ptrToStructArr, int arrSize) | |
{ | |
var output = new List<T>(arrSize); | |
var sizeInBytes = Marshal.SizeOf(typeof(T)); | |
for (var i = 0; i < arrSize; i++) | |
{ | |
#if x64 | |
var ptrToStruct = new IntPtr(ptrToStructArr.ToInt64() + i*sizeInBytes); |
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
<?xml version="1.0" encoding="utf-8"?> | |
<configuration> | |
<configSections> | |
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" /> | |
</configSections> | |
<log4net configSource="Log.config" /> | |
<appSettings> | |
<add key="log4net.Internal.Debug" value="true" /> |