This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class FooAgg | |
{ | |
private readonly FooState _state; | |
// Used only for hydrate the object | |
public FooAgg(FooState state) | |
{ | |
_state = state; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Verifying that +emersonsoares is my blockchain ID. https://onename.com/emersonsoares |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
exitWithMessageOnError () { | |
if [ ! $? -eq 0 ]; then | |
echo $1 | |
exit 1 | |
fi | |
} | |
hash git 2>/dev/null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SessionManager | |
{ | |
private static Configuration _nhConfiguration; | |
private static ISessionFactory _sessionFactory; | |
public static void BuildSessionFactory(DatabaseClient provider, SessionContext sessionContext, | |
string connectionString, Dictionary<string, List<string>> assembliesWithNamespaces) | |
{ | |
_nhConfiguration = new Configuration(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace Accelera.Domain.Common.Pagination | |
{ | |
public class PagedEnumerable<T> : IPagedEnumerable<T> | |
{ | |
public PagedEnumerable() | |
{ } | |
public static PagedEnumerable<T> GetPage(IQueryable<T> allItems, int pageIndex, int itemsPerPage) | |
{ | |
pageIndex -= 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git config --global alias.cowsay '!git commit -m "`fortune | cowsay -f tux`"' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function ($) { | |
$.tabify = function (menuContainerClass, tabClass) { | |
function showTab(tab) { | |
var anyTab = false; | |
$(tabClass).each(function (index, item) { | |
$('#' + item.id).hide(); | |
if ('#' + item.id === tab) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public enum MessageType | |
{ | |
Error, | |
Success, | |
Info | |
} | |
public static class MessageHtmlHelper | |
{ | |
public static MvcHtmlString Message(this HtmlHelper html, MessageType type, dynamic text) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class NHibernateUnitOfWork : IUnitOfWork<ISession> | |
{ | |
private readonly ISession _session; | |
private readonly ITransaction _transaction; | |
public ISession Context { get { return _session; } } | |
public NHibernateUnitOfWork(ISession session) | |
{ | |
_session = session; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Install-Package NodaTime | |
public static bool Has18YearsOld(DateTime birthday) | |
{ | |
var bday = new LocalDate(birthday.Year, birthday.Month, birthday.Day); | |
var today = new LocalDate(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day); | |
var period = Period.Between(bday, today, PeriodUnits.Years); |