Skip to content

Instantly share code, notes, and snippets.

View detroitpro's full-sized avatar
☠️

Eric Polerecky detroitpro

☠️
View GitHub Profile
@detroitpro
detroitpro / Application
Last active August 29, 2015 14:12
Xamarin Forms 1.3.1 Navigation.
namespace Mumsee.Mobile.Core.ViewModels
{
public class AppBootstrapper : ReactiveObject //, IScreen
{
// The Router holds the ViewModels for the back stack. Because it's
// in this object, it will be serialized automatically.
//public RoutingState Router { get; protected set; }
public AppBootstrapper ()
{
@detroitpro
detroitpro / no limit query
Created November 9, 2014 17:18
SugarCRM default query
SELECT accounts.* ,
accounts_cstm.tax_jurisdiction_code_c,
accounts_cstm.sap_business_partner_c,
accounts_cstm.price_group_c,
accounts_cstm.payment_terms_c,
accounts_cstm.customer_group_c,
accounts_cstm.tax_exempt_c,
accounts_cstm.price_list_c ,
LTRIM(RTRIM(CONCAT(IFNULL(jt0.first_name,''),' ',IFNULL(jt0.last_name,'')))) modified_by_name ,
jt0.created_by modified_by_name_owner ,
@detroitpro
detroitpro / gist:4b2f7585d25ab37f2e59
Created August 11, 2014 01:55
NancyFx fake temp data
protected override void ApplicationStartup(IWindsorContainer container, IPipelines pipelines)
{
pipelines.BeforeRequest += (ctx) =>
{
if (ctx.Request.Session["TempMessage"] != null && !string.IsNullOrEmpty(ctx.Request.Session["TempMessage"] as string))
{
ctx.ViewBag.TempMessage = ctx.Request.Session["TempMessage"];
ctx.ViewBag.TempType = ctx.Request.Session["TempType"];
ctx.Request.Session.DeleteAll();
}
@detroitpro
detroitpro / Renderer
Created June 6, 2014 04:46
Segmented Render for Xamarin.Forms.
public class SegmentedControlRenderer : NativeRenderer
{
protected override void OnModelSet(VisualElement model)
{
base.OnModelSet (model);
SegmentedControlView segmentedControlView = (SegmentedControlView)this.Model;
var native = new UISegmentedControl ();
native.Frame = new RectangleF (20, 20, 280, 40);
@detroitpro
detroitpro / gist:eadddec2911b03a442ac
Created May 31, 2014 19:32
Can I disable master in Xamarin.Forms MasterDetailPage
public static Page GetMainPage()
{
var masterDetailPage = new MasterDetailPage ();
masterDetailPage.Master = new MenuPage (masterDetailPage);
if(User.IsNotAuthenticated){
//HERE IS WHERE I WOULD LIKE TO DISABLE THE MASTER
masterDetailPage.Detail = new NavigationPage (new LoginPage ()) { };
//This does not do anything.
container.Register(Classes.FromAssemblyInThisApplication()
.BasedOn<UserControl>()
.Configure(x => x.LifestyleTransient()));
@detroitpro
detroitpro / gist:9296248
Created March 1, 2014 20:02
NancyFx fake asset piplelien
protected override void ApplicationStartup(IWindsorContainer container, IPipelines pipelines)
{
pipelines.BeforeRequest += (ctx) =>
{
ctx.ViewBag.Styles = Bundle.Css().RenderNamed("bundled");
ctx.ViewBag.Scripts = Bundle.JavaScript().RenderNamed("vendor-scripts");
return null;
};
@detroitpro
detroitpro / gist:8928899
Created February 11, 2014 03:40
ASP.NET Identity IUser*Store Implementations for ASP.NET MVC5 OWIN
Tugberk Ugurlu has an implementation for RavenDB: AspNet.Identity.RavenDB
https://github.com/tugberkugurlu/AspNet.Identity.RavenDB
Daniel Wertheim has an implementation for CouchDB / Cloudant
https://github.com/danielwertheim/mycouch.aspnet.identity
InspectorIT has an implementation for MongoDB: MongoDB.AspNet.Identity
https://github.com/InspectorIT/MongoDB.AspNet.Identity
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false)]
public class CvvAttribute : DataTypeAttribute
{
public CvvAttribute()
: base("cvv")
{
}
public override string FormatErrorMessage(string name)
{
@detroitpro
detroitpro / gist:2582766
Created May 3, 2012 03:14
node-bamboo-campfire-deps
C:\Projects> mkdir nodeboocamp
Directory: C:\Projects
Mode LastWriteTime Length Name
---- ------------- ------ ----
d---- 5/2/2012 11:10 PM nodeboocamp