Skip to content

Instantly share code, notes, and snippets.

View alexkuznetsov's full-sized avatar
🏢
Working from office

Alexander Kuznetsov alexkuznetsov

🏢
Working from office
View GitHub Profile
@alexkuznetsov
alexkuznetsov / InvariantDecimalModelBinder.cs
Last active September 28, 2021 16:13 — forked from mustafadagdelen/InvariantDecimalModelBinder.cs
Dotnet core decimal model binder problem fix
using System;
using System.Globalization;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc.ModelBinding;
using Microsoft.AspNetCore.Mvc.ModelBinding.Binders;
namespace BA.ECommerce.Client.Utility
{
public class InvariantDecimalModelBinderProvider : IModelBinderProvider
{
package kz.gov.pki.kalkan.pkix.checker;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.math.BigInteger;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.security.cert.CertPathBuilder;
@alexkuznetsov
alexkuznetsov / gist:2f674d39f469d5501d34f0a66b20214d
Created November 11, 2016 03:21 — forked from dalenewman/gist:6377911
A T-SQL stored procedure for moving an index from one file group to another. The original script was found at http://blogs.msdn.com/b/ramoji/archive/2008/09/26/how-to-move-existing-indexes-from-one-filegroup-to-another.aspx and updated according to responses found on the same page.
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MoveIndexToFileGroup]') AND type in (N'P', N'PC'))
BEGIN
DROP PROCEDURE [dbo].[MoveIndexToFileGroup]
END
GO
CREATE PROC [dbo].[MoveIndexToFileGroup] (
@DBName sysname,
@SchemaName sysname = 'dbo',
@ObjectNameList Varchar(Max),
@alexkuznetsov
alexkuznetsov / Program.cs
Created November 3, 2016 05:01
Self-installed windows service
using System;
using System.Configuration.Install;
using System.Reflection;
using System.ServiceProcess;
namespace WinServiceHost
{
static class Program
{
static void Main(string[] args)
package cz.novoj.spring.security.aop;
import cz.novoj.spring.security.annotation.RulesRelation;
import cz.novoj.spring.security.annotation.RulesRelation.BooleanOperation;
import org.springframework.core.annotation.AnnotationUtils;
import org.springframework.security.access.ConfigAttribute;
import org.springframework.security.access.method.AbstractMethodSecurityMetadataSource;
import org.springframework.security.access.prepost.*;
import org.springframework.util.Assert;
import org.springframework.util.ClassUtils;
# ======================================================================
#
# @link http://wuhrr.wordpress.com/2010/01/13/adding-confirmation-to-bash/#comment-3540
#
# Function: confirm
# Asks the user to confirm an action, If the user does not answer yes,
# then the script will immediately exit.
#
# Parameters:
# $@ - The confirmation message