Skip to content

Instantly share code, notes, and snippets.

View pocheptsov's full-sized avatar

slava pocheptsov pocheptsov

View GitHub Profile
# Git .gitignore file template by pocheptsov.com idea via Abdullin.com
# Syntax http://www.kernel.org/pub/software/scm/git/docs/gitignore.html
# Snippet http://gist.github.com/446133
# Visual Studio
*.suo
*.user
*.cache
# Direcories
#region
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Web.Mvc;
using System.Web.Routing;
using JazzMeeting.Reporting;
using JazzMeeting.Utils.Extensions;
using Lokad.Reflection;
using Norm;
using Norm.Responses;
using Norm.Collections;
using Norm.Linq;
public class MongoSession {
private string _connectionString;
public MongoSession() {
@pocheptsov
pocheptsov / gist:6165586
Created August 6, 2013 15:34
List all jQuery event bindings on element
//where el - jQuery object
//var el = $(document);
$._data(el[0]).events
@pocheptsov
pocheptsov / run-sql-scripts.csx
Created September 5, 2013 19:25
Run sql scripts from directory, where script filename has a convention - [int number]_any_nam_after.sql ordered by [int number], execution break in case of any exception. ScriptCs format was used as a script language.
//#r "System.Data"
//uncomment previous lines to debug in VS
using System;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
@pocheptsov
pocheptsov / Program.cs
Created May 28, 2015 21:19
Face detection and uploading source file to Rekognition service from C# .NET Async
using System;
using System.Collections.Generic;
using System.IO;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
namespace HelloWorldRekognition
@pocheptsov
pocheptsov / SoapExtensionRegistration.cs
Created July 30, 2015 20:22
Register SoapExtension in a code
public static void RegisterSoapExtension(Type type, int priority, PriorityGroup group)
{
if (!type.IsSubclassOf(typeof(SoapExtension)))
{
throw new ArgumentException("Type must be derived from SoapException.", nameof(type));
}
if (priority < 1)
{
throw new ArgumentOutOfRangeException(nameof(priority), priority, "Priority must be greater or equal to 1.");
@pocheptsov
pocheptsov / bzr-to-git.sh
Created August 12, 2015 19:38
Migrating from bazaar to git
# optionally create plugins directory
mkdir $HOME/.bazaar/plugins
# clone plugin repository
cd $HOME/.bazaar/plugins
bzr branch lp:bzr-fastimport fastimport
# clone dependency repo
bzr branch lp:python-fastimport python_fastimport
python setup.py install
@pocheptsov
pocheptsov / XUnitConsoleRunner.cs
Last active September 3, 2015 19:13
xUnit Console Runner
using System;
using System.Linq;
using System.Reflection;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using Xunit;
namespace TestsRunner
{
public class Program
[user]
email = [email]@gmail.com
name = slava pocheptsov
[push]
default = simple
[core]
symlinks = false
[color]
diff = auto
status = auto