Skip to content

Instantly share code, notes, and snippets.

View dbeattie71's full-sized avatar

Derek Beattie dbeattie71

  • Nebraska
  • 20:44 (UTC -05:00)
View GitHub Profile
@dbeattie71
dbeattie71 / NewMacConfig.md
Created April 23, 2016 16:58 — forked from offsky/NewMacConfig.md
Setup new mac for web development (Updated for Yosemite)
@dbeattie71
dbeattie71 / Android Lollipop Widget Tinting Guide
Created April 18, 2016 17:29 — forked from seanKenkeremath/Android Lollipop Widget Tinting Guide
How base colors in Lollipop apply to different UI elements
Unless specified otherwise, all of the below tinting applies to both Lollipop and pre-Lollipop using AppCompat v21. To use the support version of these attributes, remove the android namespace. For instance, "android:colorControlNormal" becomes "colorControlNormal". These attributes will be propagated to their corresponding attributes within the android namespace for devices running Lollipop. Any exceptions to this will be noted by including the "android:" prefix.
All Clickable Views:
-----------
* ripple effect (Lollipop only) -- "colorControlHighlight"
Status Bar:
------------
* background (Lollipop only) - "colorPrimaryDark"
@dbeattie71
dbeattie71 / Test Collections.md
Created April 6, 2016 00:14 — forked from enjin/Test Collections.md
Using test collections in xUnit.net v2

Test collections are the test grouping mechanism in xUnit.net v2. They serve two purposes:

  1. They delineate the "parallelism" boundary; that is, tests in the same collection will not be run in parallel against each other;
  2. They offer collection-wide fixtures through the use of ICollectionFixture<TFixtureType>.

The simplest way to use test collections is simply by name. Put two classes into the same named collection, and they can derive benefit #1 above:

[Collection("MyCollection")]
public class TestClass1
@dbeattie71
dbeattie71 / apk.ps1
Created March 4, 2016 20:39 — forked from postb99/apk.ps1
Powershell script to generate APK for Google Play
Param(
[string]$projectPath=$(throw "projectPath is required (full path to .csproj file)"),
[string]$packageName=$(throw "packageName is required"),
[string]$configurationDirName=$(throw "configurationDirName is required"),
[string]$keyAlias=$(throw "keyAlias is required (keystore key alias)")
)
# Parameters are defined at first line of powershell script.
# Thanks to http://docs.xamarin.com/guides/android/deployment%2C_testing%2C_and_metrics/publishing_an_application/part_1_-_preparing_an_application_for_release for this script
# Parameters :
@dbeattie71
dbeattie71 / gist:6b99cf59702ebaad177b
Created February 11, 2016 21:16 — forked from brendanzagaeski/gist:9378181
Xamarin.Android.Support vs. Mono.Android.Support: use Xamarin.Android.Support
Recommendation: use the Xamarin.Android.Support.* components instead of the Mono.Android.Support.* libraries
As discussed on [1], the Xamarin.Android.Support.* components are now recommended over the Mono.Android.Support.* libraries. One reason for this is that the Xamarin.Android.Support components can be updated more frequently to keep pace with new releases from Google. Eventually, the Mono.Android.Support will be removed from Xamarin.Android. All new code should use the Xamarin.Android.Support libraries.
[1] https://bugzilla.xamarin.com/show_bug.cgi?id=15205
## Xamarin.Android.Support components in binding projects
At the moment, there's a limitation with using Xamarin.Android.Support components in Xamarin.Android Java binding projects. Specifically, the bindings projects do not yet "know" how to automatically reference the `.jar` files used by the components. This leads to error messages like:
@dbeattie71
dbeattie71 / NotificationTypes.cs
Created January 29, 2016 02:51
NotificationTypes
{
"result": [
{
"type_name": "forum_thread_reply",
"icon": "ic_forum_grey600_18dp",
"text": "Forum Reply",
"subtext": "%user% - %description%",
"type": 8
},
{
using System;
using System.Collections.Generic;
using System.Linq;
using Android.OS;
using Android.Runtime;
using Android.Support.V4.App;
using Android.Support.V4.View;
using Android.Views;
using Cirrious.CrossCore;
using Java.Lang;
private TextView htmlTextView;
private SpannableStringBuilder htmlSpannable;
@Override
public void onCreate(Bundle savedInstanceState) {
// ...
// first parse the html
// replace getHtmlCode() with whatever generates/fetches your html
@dbeattie71
dbeattie71 / FixedFragmentStatePagerAdapter.cs
Created December 8, 2015 17:03
Fixed fragment state pagers
//From here:
//https://github.com/adamsp/FragmentStatePagerIssueExample/blob/master/app/src/main/java/com/example/fragmentstatepagerissueexample/app/FixedFragmentStatePagerAdapter.java
using System;
using System.Collections.Generic;
using System.Linq;
using Android.OS;
using Android.Runtime;
using Android.Support.V4.App;
using Android.Support.V4.View;
public static class BundleExtensions
{
const string SERIALIZED_KEY = "__JSONSERIALIZED__";
static List<IMapItem> typesMapping;
//TODO: put in order of preference (cf string/charseq , serializable/parcelable, ...) because the for loop will stop at the first recognized type
static BundleExtensions() {
typesMapping = new List<IMapItem>{
new TypeMap<IBinder> ((b, i, v) => b.PutBinder(i, v), (b, i) => b.GetBinder(i)),