Skip to content

Instantly share code, notes, and snippets.

Avatar

Brian Meeker CuriousCurmudgeon

View GitHub Profile
View MapViewModels.cs
var tiles = await _tileService.LoadTilesAsync();
var tileViewModels = Mapper.Map<IList<TileViewModel>>(tiles);
View CreateMap.cs
Mapper.CreateMap<Tile, TileViewModel>()
.ConstructUsingServiceLocator();
View Register.cs
Mvx.RegisterType<TileViewModel, TileViewModel>();
View AutoMapperProfile.cs
// Tell AutoMapper to resolve dependencies using MvvmCross's service locator.
Mapper.Configuration.ConstructServicesUsing(Mvx.Resolve);
View TileViewModel.cs
public class TileViewModel : MvxViewModel
{
private readonly ITileService _tileService;
public TileViewModel(ITileService tileService)
{
_tileService = tileService;
}
private string _color;
View bootstrap_chef.bash
#!/usr/bin/env bash
# call like this on the target server:
# NODENAME='foo' CHEF_ENV='production' RUNLIST='["role[foo]","recipe[bar]"]' CHEFREPO='git@example.com:repo.git' bash <( curl -L https://raw.github.com/gist/1026628 )
# You will need to ensure that the ssh key is already set up on the server.
set -e
export CHEF_DIR="${HOME}/chef"
sudo rm -rf $CHEF_DIR
mkdir -p "$CHEF_DIR"
You can’t perform that action at this time.