Skip to content

Instantly share code, notes, and snippets.

// AutoMapper will scan the assemblies passed in for Profile instances and add each to the configuration
Mapper.Initialize(config =>
config.AddProfiles(new[]
{
// Marker types for assemblies
// Only one type from assembly
typeof (BusinessMappingProfile),
typeof (ClassFromSomeOtherAssemblyWithMappings)
}));
return cats.Map<List<CatDTO>>();
@andriybuday
andriybuday / input-chosen-ember-component.js
Last active August 19, 2017 09:08
Integrating Chosen jQuery component with EmberJs and Bootstrap. This code works with Ember 1.2.0, jQuery 2.0.3, TwitterBootstrap 3.0 and Chosen 1.0.0.
App.InputChosenComponent = Ember.Component.extend({
init: function () {
this._super();
},
// settings
labelClass: 'col-sm-2',
label: 'Date',
inputContainerClass: 'col-sm-2',
inputClass: '',
public class Car {
protected String BrandName;
public void Go() {
System.out.println("I'm " + BrandName + " and I'm on my way...");
}
}
public class MercedesCar extends Car {
public MercedesCar() {
BrandName = "Mercedes";
public class CarDecorator extends Car {
protected Car decoratedCar;
public CarDecorator(Car car) {
decoratedCar = car;
}
@Override
public void Go() {
decoratedCar.Go();
}
}
public class AmbulanceCar extends CarDecorator {
public AmbulanceCar(Car car) {
super(car);
}
@Override
public void Go() {
super.Go();
System.out.println("...beep-beep-beep-...");
}
}
Car doctorsDream = new AmbulanceCar(new MercedesCar());
doctorsDream.Go();
#!/bin/bash
CurrentPath=$(pwd)
# a directory where two repositories will get fetched to
SynchLocation="/C/git-synch/"
# bundle file location - typicly on a media that transfers the file (like USB-stick)
BundleLocation="/E/bundlefile.bundle"
# remote location and alias name for repository A
RemoteA="https://github.com/LocationOfRepoA.git"
RepoA="RepoA"
# remote location and alias name for repository B
#!/bin/bash
db_set () {
echo "$1,$2" >> database
}
db_get () {
grep "^$1," database | sed -e "s/^$1,//" || tail -n 1
}
a += b;
b = a - b;
a -= b;