Skip to content

Instantly share code, notes, and snippets.

View dsplaisted's full-sized avatar

Daniel Plaisted dsplaisted

View GitHub Profile
@dsplaisted
dsplaisted / AsyncPortableTask.cs
Created July 8, 2012 05:36
Portable task wrappers
// An implementation of IPortableTask which wraps an actual Task.
// This has to go in a project targeting a platform or platforms which support Task and async/await
using System;
using System.Threading.Tasks;
namespace PortableTasks
{
public class AsyncPortableTask : IPortableTask
{
@dsplaisted
dsplaisted / gist:3852741
Created October 8, 2012 14:12
Zip C# Solution
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Ionic.Zip;
using System.IO;
namespace ProjectZipper
{
class Program
@dsplaisted
dsplaisted / HttpClient and platform specific APIs.md
Last active December 19, 2015 18:38
Portable Facebook C# SDK, HttpClient, and platform specific APIs

(This is in response to this conversation on Twitter.)

I don't recommend using dynamic or reflection to call platform-specific APIs in most cases. Generally, create an abstraction and then implement it in a platform-specific API. The nice thing about our portable HttpClient package is that we do that for you so you pretty much don't have to worry about it.

WriteStreamBuffering can be disabled on WP8 (but not WP7). When using the latest RC of portable HttpClient 2.2 on WP8, we will disable it automatically for you under certain conditions. I believe those conditions are that you've disabled automatic redirection and authentication. @theesj can confirm that.

Here are some blog posts about calling platform-specific APIs from PCLs:

@dsplaisted
dsplaisted / PCLs and NuGet lib folders.md
Last active March 25, 2016 17:10
Portable Class Libraries and NuGet lib folders

(This is in response to the conversation started by this tweet asking why the portable HttpClient package has platform-specific library folders in addition to the portable folder.)

Sometimes in a portable library you want to be able to call APIs that aren't portable. The functionality may be exposed differently on different platforms, or you may want to "light up" and take advantage of functionality on platforms where it's available. Here are some blog posts about how to do this:

Also, see my [PCL Storag

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:local="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView
android:text="Filename"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@dsplaisted
dsplaisted / gist:11199894
Last active August 29, 2015 14:00
Miguel de Icaza answers questions on the .NET Foundation, Moonlight, and OSS licensing

Miguel de Icaza answers questions on the .NET Foundation, Moonlight, and OSS licensing

Source: .NET Community & Open Source discussion at Build 2014.

17:15

Q: What would the .NET Foundation look like if it’s successful in one or two years?

Miguel: I think that what we want is to energize the existing .NET community. So there’s a lot of .NET developers. We want to talk about things, we want to energize them. We want to create a very healthy ecosystem around the .NET platform, and Mono of course, of software that people use.

"Regardless of gender, all of us have been sexist before and will probably be again, as sexism, like racism, is unconscious and related to the values we internalize in our societies growing up. If someone tells you you are being sexist or racist, it is not a slur against your character, but an opportunity to learn more about yourself and others. We should all be interested in continuing to read, learn and share with those around us." - Leigh Alexander
[Coding Like a Girl](https://medium.com/@sailorhg/coding-like-a-girl-595b90791cce) - sailor mercury
[No skin thick enough: The daily harassment of women in the game industry](http://www.polygon.com/2014/7/22/5926193/women-gaming-harassment) - Brianna Wu
[But WHAT CAN BE DONE: Dos and Don’ts To Combat Online Sexism](http://leighalexander.net/but-what-can-be-done-dos-and-donts-to-combat-online-sexism/) - Leigh Alexander
[On the Wadhwa Within, and Leaving](https://medium.com/@kelseyinnis/on-the-wadhwa-within-and-leaving-4694d02111e0)
[Geek Feminism Wiki](http://ge
@dsplaisted
dsplaisted / Evolve2014Links.md
Last active August 29, 2015 14:07
Links from Xamarin Evolve 2014 session: Target all the Platforms with this One Awesome Trick
@dsplaisted
dsplaisted / gist:bed0942222ae24a56ea7
Created September 24, 2015 00:41
cinst scriptcs failure
C:\WINDOWS\system32>cinst scriptcs -pre -source https://www.myget.org/F/scriptcsnightly/
Chocolatey v0.9.9.8
Installing the following packages:
scriptcs
By installing you accept licenses for the packages.
scriptcs v0.15.0-nightly-150908
The package scriptcs wants to run 'chocolateyInstall.ps1'.
Note: If you don't run this script, the installation will fail.
Note: To confirm automatically next time, use '-y' or consider setting

Below are the links from my lightning talk at .NET Unboxed on "How to be more inclusive in tech". I also gave this talk at .NET Fringe 2016, and the recording is now available (unfortunately due to technical difficulties I had to go without my slides).