Skip to content

Instantly share code, notes, and snippets.

View bjorncoltof's full-sized avatar
:octocat:
Learning new stuffs...

Björn Coltof bjorncoltof

:octocat:
Learning new stuffs...
  • @bjorn_coltof
  • Amsterdam
View GitHub Profile
@bjorncoltof
bjorncoltof / designer.html
Last active October 6, 2015 13:22
designer
<link rel="import" href="../ace-element/ace-element.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;
@bjorncoltof
bjorncoltof / datacache-using
Created September 5, 2014 13:24
datacache-using
using (var cacheFactory = new DataCacheFactory())
{
_cache = cacheFactory.GetDefaultCache();
}
@bjorncoltof
bjorncoltof / datacache-no-using
Last active August 29, 2015 14:06
datacache-no-using
_cacheFactory = new DataCacheFactory();
_cache = _cacheFactory.GetDefaultCache();
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- the theme applied to the application or activity -->
<style name="AppTheme"
parent="@style/Theme.AppCompat.Light">
<item name="android:actionBarStyle">@style/AppActionBar</item>
<!-- Support library compatibility -->
<item name="actionBarStyle">@style/AppActionBar</item>
</style>
@bjorncoltof
bjorncoltof / gist:10597719
Created April 13, 2014 19:07
StylablePagerTabStrip (initial)
public class StylablePagerTabStrip : Android.Support.V4.View.PagerTabStrip
{
public StylablePagerTabStrip(Context context, IAttributeSet attrs)
: base(context, attrs)
{
}
}
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.view.ViewPager
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:custom="http://schemas.android.com/apk/res/xamarin.stylable"
android:id="@+id/viewPager"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<XamarinStylableTabStrip.StylablePagerTabStrip
android:id="@+id/pagerTabStrip"
android:layout_width="match_parent"
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name="StylablePagerTabStrip">
<attr name="indicatorColor" format="reference|color" />
</declare-styleable>
</resources>
public StylablePagerTabStrip(Context context, IAttributeSet attrs)
: base(context, attrs)
{
var styledAttributes = context.ObtainStyledAttributes(attrs, Resource.Styleable.StylablePagerTabStrip);
// Style 1
for (var i = 0; i < styledAttributes.IndexCount; ++i)
{
var index = styledAttributes.GetIndex(i);
switch (index)
@bjorncoltof
bjorncoltof / gist:9931332
Created April 2, 2014 10:03
X.509 chain failure for servicebus.windows.net
Exception while receiving message StackTrace follows
caused by an exception of type Microsoft.ServiceBus.Messaging.MessagingCommunicationException:
The X.509 certificate CN=servicebus.windows.net is not in the trusted people store. The X.509 certificate CN=servicebus.windows.net chain building failed. The certificate that was used has a trust chain that cannot be verified. Replace the certificate or change the certificateValidationMode. A certificate chain could not be built to a trusted root authority.
at Microsoft.ServiceBus.Common.AsyncResult.End[TAsyncResult](IAsyncResult result)
at Microsoft.ServiceBus.Messaging.MessageReceiver.EndReceive(IAsyncResult result)
at NipoSoftware.Utilities.Azure.Implementation.SubscriptionClientWrapper.EndReceive(IAsyncResult result) in c:\workspaces\Callisto\DotNetProg\NipoSoftware.Utilities.Azure\Implementation\SubscriptionClientWrapper.cs:line 47
at NipoSoftware.Utilities.Azure.Implementation.AzureInterviewNotificationReader.EndReceive(IAsync
@bjorncoltof
bjorncoltof / gist:9891282
Created March 31, 2014 12:32
OnCreate with GenericFragmentPagerAdapter
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
// Set our view from the "main" layout resource
SetContentView(Resource.Layout.Main);
var adapter =
new GenericFragmentPagerAdapter(SupportFragmentManager,
new FragmentOne(), new FragmentTwo(), new FragmentThree());