Skip to content

Instantly share code, notes, and snippets.

View ArnisL's full-sized avatar
🦊

Arnis Lapsa ArnisL

🦊
View GitHub Profile
@ArnisL
ArnisL / gist:9125108
Created February 20, 2014 23:00
custom oh-my-zsh af-magic theme
# af-magic.zsh-theme
#
# Author: Andy Fleming
# URL: http://andyfleming.com/
# Repo: https://github.com/andyfleming/oh-my-zsh
# Direct Link: https://github.com/andyfleming/oh-my-zsh/blob/master/themes/af-magic.zsh-theme
#
# Created on: June 19, 2012
# Last modified on: June 20, 2012
@ArnisL
ArnisL / gist:9125183
Created February 20, 2014 23:04
patched vimux
if exists("g:loaded_vimux") || &cp
finish
endif
let g:loaded_vimux = 1
command VimuxRunLastCommand :call VimuxRunLastCommand()
command VimuxCloseRunner :call VimuxCloseRunner()
command VimuxInspectRunner :call VimuxInspectRunner()
command VimuxScrollUpInspect :call VimuxScrollUpInspect()
command VimuxScrollDownInspect :call VimuxScrollDownInspect()
/// <summary>
/// Validates that record is found in Aleph by GetDigitalObjectFromAleph method
/// or user has processed it.
/// Filters records which were not found in Aleph by GetDigitalObjectFromAleph method
/// and not processed by user.
/// </summary>
/// <param name="codeTableCode">The code table code.</param>
/// <param name="value">The value.</param>
/// <param name="elementId">The element id.</param>
/// <param name="elementName">Name of the element.</param>
protected override void ExecuteInContext(IUnitOfWorkContext context, RegisterNewAffairCmd cmd)
{
var affair=Affair.RegisterAffair(cmd.AffairId, cmd.Name, cmd.Location);
//how to save it? :/
context.
_repository.Save(affair);
context.Accept();
}
namespace Web.Bootstrap {
using CommandHandlers;
using Microsoft.Practices.ServiceLocation;
using MvcExtensions;
using Ncqrs;
using Ncqrs.Commanding.ServiceModel;
using Ncqrs.Config.StructureMap;
using Ncqrs.Domain;
using Ncqrs.Domain.Storage;
using Ncqrs.Eventing.ServiceModel.Bus;
namespace Interreg.Config{
using System;
using System.IO;
using Domain;
using FluentNHibernate.Automapping;
using FluentNHibernate.Cfg;
using FluentNHibernate.Cfg.Db;
using FluentNHibernate.Conventions.Helpers;
using NHibernate;
using NHibernate.Context;
namespace Interreg.Web.Bootstrap{
using System;
using Config;
using Microsoft.Practices.ServiceLocation;
using MvcExtensions;
using NHibernate;
using NHibernate.Context;
using StructureMap;
public class NHibernateTask:BootstrapperTask{
private readonly IContainer _container;
namespace MyProject.Web.Binders{
using System.Web.Mvc;
using Domain;
public class RootBinder<TRoot,TRepository>:DefaultModelBinder
where TRepository:IRepository<TRoot> where TRoot:IRoot{
private readonly TRepository _repository;
public RootBinder(TRepository repository){
Guard.AgainstNull(repository);
_repository=repository;
}
namespace MyProject.Web.Binders{
using System.Web.Mvc;
using Domain;
public class RootBinder<TRoot,TRepository>:DefaultModelBinder
where TRepository:IRepository<TRoot> where TRoot:IRoot{
private readonly TRepository _repository;
public RootBinder(TRepository repository){
Guard.AgainstNull(repository);
_repository=repository;
}
if ((sTemp.IndexOf(".") == -1) && (sTemp.Length >= 1) &&
(sTemp.ToUpper().IndexOf("N") == -1) && (sTemp.IndexOf("-") == -1))
{
invRow.AT13 = true;
}
else
{
invRow.AT13 = false;
}
sTemp =