To do custom error pages in Nancy you must implement an IStatusCodeHandler. This class must provide 2 methods. HandlesStatusCode is a bool that basically should tell Nancy if this class will handle the status code. If this returns true then this class will be responsible for handling the request.

Continue reading

Capturing client side errors in my opinion is really good. For starters you can troubleshoot your client side implementation, but you can also make sure a js change did not break certain pages.

Below is a really simple, yet effective way to capture errors. Eventually you may want to implement something more advanced, but this will get you out of the gate.
Continue reading

One of the things that I often see in our industry is the culture of access control. Security measures are put into place, because you wish to restrict access to a certain thing. Systems like HRIS need such restrictions, as private information should not be publicly available to the company. However often systems that don’t need security controls put into place end up having them.

Most people understand where they fall in the business, and the authority delegated to them.
Continue reading

The standard way to get/set SharedPreferences in Xamarin is with the following code.

Get Preference:

1
2
3

var shared = con.GetSharedPreferences(_preferenceName, FileCreationMode.WorldReadable);
var value = shared.All.Where(x => x.Key == key).FirstOrDefault().Value;

Set Preference:

1
2
3
4
5

var shared = con.GetSharedPreferences("PreferenceName", FileCreationMode.WorldWriteable);
var edit = shared.Edit();
edit.PutString(key, val);
edit.Commit();

The main issue I have/had with this is you often have to know what will be returned, and what type you need to save as. Usually this isn’t difficult, but it adds an un-needed level of complexity.

The other major issues I have with this, is that it is quite verbose, and unnecessary. The code duplication here can be quite high.
Continue reading

  • page 1 of 1

Tommy "TerribleDev" Parnell

Hi, my name is Tommy. I work very hard to deliver quality content, free. If I helped you please consider donating.


Software Engineer II


Boston Area