Skip to content

Instantly share code, notes, and snippets.

View detroitpro's full-sized avatar
☠️

Eric Polerecky detroitpro

☠️
View GitHub Profile
@detroitpro
detroitpro / CommandChain.cs
Created December 9, 2016 22:12
Need help rebuilding commands and executing them. Ideas?
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq.Expressions;
using System.Threading.Tasks;
using FluentAssertions;
using NUnit.Framework;
namespace Commander
@detroitpro
detroitpro / ioc.cs
Last active November 14, 2016 19:25
PerWebRequest using external container
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Xml.Linq;
public class Register
{
public Register(){
//These two registrations provide the same functionality.
node {
stage('Preparation') {
//git checkout goes here
}
stage('Build') {
try {
bat 'build Default BuildSolution'
} catch (e) {
throw e
}
@detroitpro
detroitpro / redirect.xml
Created August 12, 2016 14:20
redirect azure web app to https (remove http)
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<!-- ADD YOUR RULES HERE -->
<rule name="Redirect_to_https" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="off" ignoreCase="true" />
@for (int i = 0; i < Model.DisplayRows; i++)
{
var skip = (i == 0) ? i : i * 3;
<div class="row-fluid">
@foreach (var product in Model.StoreProducts.Skip(skip).Take(3))
{
<div class="span4 leaf-container" style="margin-bottom: 20px; min-height: 215px;
border: 1px solid #DDD">
<img class="on-sale-strap" src="https://mtgshops.blob.core.windows.net/site/onSale.png" />
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false)]
public class CvvAttribute : DataTypeAttribute
{
public CvvAttribute()
: base("cvv")
{
}
public override string FormatErrorMessage(string name)
{
@detroitpro
detroitpro / gist:df88e20e508118269ee2
Created March 8, 2015 05:47
Xamarin Forms Parallax Scrolling
public class DemoPage : ContentPage
{
public DemoPage ()
{
var image = new Image () {
Source = "http://eric.polerecky.com/images/abstract-1.jpg",
VerticalOptions = LayoutOptions.Start,
Scale = 3,
AnchorY = 0
};
@detroitpro
detroitpro / gist:6311c18cd44c53cc7d3e
Created January 20, 2015 02:38
ReactiveObject can't be stored in Akavache?
/// <summary>
/// ReactiveObject can't be stored in Akavache?
/// </summary>
public class ReactiveItem //: ReactiveObject
{
public string Name { get; set; }
public override string ToString ()
{
return string.Format ("[ReactiveItem: Name={0}]", Name);
@detroitpro
detroitpro / gist:5a279fd7d3f1326f6ca7
Last active August 29, 2015 14:13
Xamarin Forms 1.3 Context Action XAML
<ViewCell>
<ViewCell.ContextActions>
<MenuItem Command="{Binding MoreCommand}" Text="More" />
<MenuItem Command="{Binding DeleteCommand}" Text="Delete" IsDestructive="True" />
</ViewCell.ContextActions>
</ViewCell>
@detroitpro
detroitpro / gist:c0701f4b306177c6b80b
Created January 14, 2015 19:39
Xamarin Forms 1.3 Context Action
//------ Creating Contact Action 1 Start --------//
var moreAction = new MenuItem { Text = "More" };
moreAction.SetBinding (MenuItem.CommandParameterProperty, new Binding ("."));
moreAction.Clicked += async (sender, e) => {
await Task.Run (() => {
var mi = ((MenuItem)sender);
Debug.WriteLine ("More Context Action clicked: " + mi.CommandParameter);
});
};
ContextActions.Add (moreAction);