Skip to content

Instantly share code, notes, and snippets.

View abelevtsov's full-sized avatar
🏠
Working from home

Aleksandr Belevtsov abelevtsov

🏠
Working from home
  • SpeakerGuru OÜ
  • Tallinn, Estonia
View GitHub Profile
@abelevtsov
abelevtsov / bounce_acct.conf
Last active March 20, 2023 12:46
port25 PowerMTA bounce accounting with send to MongoDB
[DEFAULT]
[headers]
headers = type,timeLogged,timeQueued,orig,rcpt,orcpt,dsnAction,dsnStatus,dsnDiag,dsnMta,bounceCat,srcType,srcMta,dlvType,dlvSourceIp,dlvDestinationIp,dlvEsmtpAvailable,dlvSize,vmta,jobId,envId,queue,vmtaPool
[mongo]
host = 127.0.0.1
port = 27017
queueName = pmta-events
using System;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using Microsoft.Xrm.Sdk;
using Microsoft.Xrm.Sdk.Query;
namespace Microsoft.Xrm.Sdk.Ext
{
@abelevtsov
abelevtsov / IncrementBuildVersion.cs
Created April 15, 2018 20:02 — forked from yourpalmark/IncrementBuildVersion.cs
Unity: Post-process script that increments revision number of iPhone and Android builds. Uses CFBundleShortVersionString as well as CFBundleVersion. CFBundleShortVersionString (Version) is set to {Major}.{Minor}.{Build}. CFBundleVersion (Build) is set to {Revision}. Revision is the auto-incremented value on every build.
/**
* Copyright 2012 Calvin Rien
* (http://the.darktable.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@abelevtsov
abelevtsov / duffs_device
Last active March 12, 2019 14:57
Greenberg's Duff's Device array processing speedup
let iterations = Math.floor(values.length / 8);
let leftover = values.length % 8;
let i = 0;
if (leftover > 0) {
do {
process(values[i++]);
} while (--leftover > 0);
}
package ru.open;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
public class Main {
public static void main(String[] args) throws IOException {
String domain = "DOMAIN";
@abelevtsov
abelevtsov / gist:477e383bd328252c1fe32e4b6101c927
Created July 15, 2017 11:44 — forked from econchick/gist:4666413
Python implementation of Dijkstra's Algorithm
from collections import defaultdict
class Graph:
def __init__(self):
self.nodes = set()
self.edges = defaultdict(list)
self.distances = {}
def add_node(self, value):
self.nodes.add(value)
$environment = $OctopusParameters["Octopus.Environment.Name"]
$buildPath = $OctopusParameters["BuildPath"]
$apiuri = $OctopusParameters["PluginRegistrationServiceUrl"]
Write-Output "Publish Plugins to $environment"
$start_time = Get-Date
$mergedPluginAssemblyPath = "$buildPath\Sk.Crm.Plugins.dll"
$mergedPluginAssemblyPath = $mergedPluginAssemblyPath -replace "\\", "\\"
@abelevtsov
abelevtsov / CredentialManager.cs
Created October 25, 2016 10:44 — forked from meziantou/CredentialManager.cs
Using the Windows Credential API (CredRead, CredWrite, CredDelete, CredEnumerate)
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Runtime.InteropServices;
using System.Text;
using Microsoft.Win32.SafeHandles;
public static class CredentialManager
{
public static Credential ReadCredential(string applicationName)
@abelevtsov
abelevtsov / RegExp search templates.txt
Created July 20, 2016 07:54
Visual Studio regular expression search templates
[a-z]\.Attributes\.Contains\(\".+\"\) &&
public abstract class PluginBase<T> : CrmPluginBase<T> where T : Entity
{
private IWindsorContainer ioc;
protected PluginBase()
: this(null, null)
{
}
protected PluginBase(string unsecure, string secure)