Skip to content

Instantly share code, notes, and snippets.

View KozzyKoder's full-sized avatar

Vladimir Pestov KozzyKoder

  • Booking.com
  • Amsterdam, Netherlands
View GitHub Profile
template common_templates {
pdAlertBody = `{
"service_key": "{{.Notification.Vars.service_key}}",
<<bunch of fields>>
}`
pdActionAck = `{
"service_key": "{{.Notification.Vars.service_key}}",
<<bunch of fields>>
$pd_service_key_for_team1 = 1234
$pd_service_key_for_team2 = 5678
$pd_service_key_for_team3 = 9012
template common_notifications {
pdAlertBody = `{
"service_key": "{{.Get "service_key" }}",
<<bunch of fields>>
}`
$combined_path = Join-Path (Get-Item -Path ".\" -Verbose).FullName COMBINED.sql;
get-childitem | where {$_.extension -eq ".sql"} | Sort-Object $ToNatural | ForEach-Object { Add-Content $combined_path ("SELECT '" + $_.name + "';`n") -Encoding UTF8; Get-Content $_ | Add-Content $combined_path -Encoding UTF8; }
@KozzyKoder
KozzyKoder / NHinerbate.cfg.xml
Created March 3, 2014 16:27
NNibernate-Postgres config
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
<session-factory>
<property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
<property name="dialect">NHibernate.Dialect.PostgreSQLDialect</property>
<property name="connection.driver_class">NHibernate.Driver.NpgsqlDriver</property>
<property name="connection.connection_string_name">TravelRoutesDatabase</property>
<property name="proxyfactory.factory_class">NHibernate.Bytecode.DefaultProxyFactoryFactory, NHibernate</property>
<mapping assembly="DataAccess"/>
</session-factory>
@KozzyKoder
KozzyKoder / MappingConventions.cs
Created February 27, 2014 06:31
Mongodb useful mapping conventions
public class MappingConventions
{
public static void Initialize()
{
var __conventionPack = new ConventionPack()
{
new IgnoreIfNullConvention(true),
new NamedIdMemberConvention("Id"),
new CamelCaseElementNameConvention(),
new NamedExtraElementsMemberConvention("ExtraElements"),