Skip to content

Instantly share code, notes, and snippets.


Serge Ovanesyan sovanesyan

View GitHub Profile
View .circleci
- restore_cache:
- recorder-{{ .Branch }}
- /caches/app.tar
- run:
name: Load Docker image layer cache
command: |
set +o pipefail
docker load -i /caches/app.tar | true
View gist:ec9d5b8743dde5d76ad2
var logger = new ILogger();
// Shortcut with just a message
logger.Error("Something bad happened");
// Shortcut for type
logger.Error(entry => entry.Message("Too many Cordova plugins used")
View gist:8351453
// на пръв поглед един блок
public SqlExpressionVisitor() {
modelDef = typeof(T).GetModelDefinition();
PrefixFieldWithTableName = false;
WhereStatementWithoutWhereString = false;
// ясно разделение между заглавие и съдържание
public SqlExpressionVisitor()
sovanesyan / gist:3180872
Created Jul 26, 2012
Nuget Package Add Import and Errors
View gist:3180872
# Need to load MSBuild assembly if it's not loaded yet.
Add-Type -AssemblyName 'Microsoft.Build, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
# Grab the loaded MSBuild project for the project
$msbuild = [Microsoft.Build.Evaluation.ProjectCollection]::GlobalProjectCollection.GetLoadedProjects($project.FullName) | Select-Object -First 1
# Make the path to the targets file relative.
$projectUri = new-object Uri('file://' + $project.FullName)
$targetUri = new-object Uri('file://' + $targetsFile)
$relativePath = $projectUri.MakeRelativeUri($targetUri).ToString().Replace([System.IO.Path]::AltDirectorySeparatorChar, [System.IO.Path]::DirectorySeparatorChar)
$existsCondition = "Exists('" + $relativePath + "')"
View gist:2300096
public interface IUnitOfWork
void Delete(object entity);
void SaveChanges();
void ClearChanges();
void Add(object entity);
sovanesyan / gist:2036680
Created Mar 14, 2012
Execute OpenAccess validation
View gist:2036680
//Create a FluentMetadataSource and retrieve the MetadataContainer from it.
Source source = new Source();
MetadataContainer model = source.GetModel();
//We are passing in false in order to specify no resolution actions should be added.
//A resolution action is a proposed by the rule fix for the problem and pops up in the designer.
MetaModelValidation validation = new MetaModelValidation(false);
//Specify the custom validation rule provider
validation.ValidationRuleProvider = new SitefinityValidationProvider();
View gist:616555
XmlMetadataSource source = XmlMetadataSource.FromAssemblyResource("Northwind.rlinq");
var model = source.GetModel();
var productType = model.PersistentTypes.FirstOrDefault(x => x.Name == "Product");
productType.OptimisticConcurrencyControlStrategy = OptimisticConcurrencyControlStrategy.Timestamp;
//Making sure there is no cached database.
Database.Get("NorthwindEntityDiagrams", new BackendConfiguration() { Backend = "mssql" }, model).Dispose();
//initialize the database with the modified metadata
View x
/* This is a template command. */
name: "kino",
/*icon: "",
homepage: "",
author: {name: "Your Name", email: ""},
license: "GPL",
description: "A short description of your command",
help: "How to use your command",