Skip to content

Instantly share code, notes, and snippets.

View tarasn's full-sized avatar
🎯
Focusing

Taras Naumtsev tarasn

🎯
Focusing
View GitHub Profile
@tarasn
tarasn / boilerplate.build
Last active December 22, 2015 15:39
Ms build bopilerplate
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Run">
<PropertyGroup>
<MyMessage>MSBuild Rocks!</MyMessage>
<MyMessage2>MSBuild Rocks 222222!</MyMessage2>
</PropertyGroup>
<ItemGroup>
@tarasn
tarasn / gist:6240834
Created August 15, 2013 13:33
Setup VS 2010 environment
call "%VS100COMNTOOLS%vsvars32.bat"
using System.Drawing;
using System.Windows.Forms;
namespace MyTrayApp
{
public class SysTrayApp : Form
{
[STAThread]
public static void Main()
{
using System.Reflection;
using FluentNHibernate;
using FluentNHibernate.Cfg.Db;
using NHibernate;
using NHibernate.Cfg;
using NHibernate.Tool.hbm2ddl;
namespace NHibernateExperiments.Fluent
{
public class InMemoryDatabaseFluent
@tarasn
tarasn / CastelWindsorRegistration.cs
Created August 11, 2013 14:02
Castle Windsor registration examples
using System;
using System.Linq;
using Castle.MicroKernel.Registration;
using Castle.Windsor;
namespace ConsoleApplication6
{
class Program
{
using System;
using Castle.MicroKernel.Registration;
using Castle.Windsor;
namespace CollectionResolverForGenericInterface
{
internal class Program
{
private static void Main(string[] args)
{
using System.Collections.Generic;
using System.IO;
using OfficeOpenXml; // (EPPLus - http://epplus.codeplex.com/)
namespace OfficeReports
{
public static class DumpToExcel
{
public static void Dump<T>(IEnumerable<T> data, string outputFilename)
{
@tarasn
tarasn / gist:5458177
Created April 25, 2013 07:52
Check if MS SQL DB in use
SELECT * FROM sys.sysprocesses WHERE dbid = DB_ID('YourDBName')
@tarasn
tarasn / decorators-usage.py
Created April 8, 2013 14:46
Python decarators usage example how to print <b><i>Hello</i></b> using decorators
def makebold(fn):
def wrapped(s):
return "<b>" + fn(s) + "</b>"
return wrapped
def makeitalic(fn):
def wrapped(s):
@tarasn
tarasn / app.config.xml
Created February 20, 2013 12:13
Setting need to be added to app.config to use default proxy (that IE uses) for accessing Internet
<?xml version="1.0"?>
<configuration>
<system.net>
<defaultProxy enabled="true" useDefaultCredentials="true"></defaultProxy>
</system.net>
</configuration>