Skip to content

Instantly share code, notes, and snippets.

View ChaseFlorell's full-sized avatar
🇨🇦

Chase Florell ChaseFlorell

🇨🇦
View GitHub Profile
@ChaseFlorell
ChaseFlorell / uriSchemeWithHyperlinkFallback.js
Last active February 21, 2023 11:22
Ever want to launch a mobile app from within the browser, but ensure that the browser still redirects the user to the link if the app isn't installed? This took some fiddling around, but when the "ah ha" moment hit, the solution is really quite simple.
// tries to execute the uri:scheme
function uriSchemeWithHyperlinkFallback(uri, href) {
// set up a timer and start it
var start = new Date().getTime(),
end,
elapsed;
// attempt to redirect to the uri:scheme
// the lovely thing about javascript is that it's single threadded.
// if this WORKS, it'll stutter for a split second, causing the timer to be off
public ActionResult LogOn(LogOnModel model, string returnUrl)
{
// check if a valid user was selected
var user = GetuserByname(model.UserName);
if (user.ToList().Count != 1)
{
ModelState.AddModelError("Username", "Username is invalid");
}
@ChaseFlorell
ChaseFlorell / _readme.md
Last active December 24, 2015 06:09
New Idea for Contact Cards. For some time now I've been aggravated by the concept of contact cards. As I look through my Address Book, I'm overwhelmed by the inaccuracies in there

#New Idea for Contact Cards

##Rational

For some time now I've been aggravated by the concept of contact cards. As I look through my Address Book, I'm overwhelmed by the inaccuracies in there, even though I'm pretty diligent in ensuring it is up to date. There is no way of communicating an update to your info without a mass email to everyone in your address book, or sending it out over some form of social media. Beyond that, if there's someone who is not in your address book, you probably don't have a way of informing them of your contact update.

I also don't like the fact that once someone has my card, there's no way to take it back. It's a bit of a problem if someone gets your information

I love the idea of QR codes that contain embedded vCard information, and the fact that it's possible to update the information while NOT changing the QR Code. The problem remains however that once someone inserts the vCard into their address book, the only way to update it is manually.

@ChaseFlorell
ChaseFlorell / DbConnectionProvider.cs
Last active March 9, 2016 05:59
Sqlite issues with Xamarin, Mono.Data.Sqlite, and System.Data
using System;
using Mono.Data.Sqlite;
namespace OurApplication.AppCore.Data.Sqlite
{
public class DbConnectionProvider : IDbConnectionProvider
{
private readonly string _connectionString;
public DbConnectionProvider(string sqliteDatabasePath, string databaseName)
@ChaseFlorell
ChaseFlorell / 01-Update-Windows.ps1
Last active December 12, 2019 16:58
Boxstarter Installation Scripts
# http://boxstarter.org/package/url?
#####################
# BEGIN CONFIGURATION
#####################
#region Initial Windows Config
Install-WindowsUpdate -AcceptEula
Update-ExecutionPolicy Unrestricted
@ChaseFlorell
ChaseFlorell / DrawerToggler.cs
Last active December 31, 2015 06:39
Navigation Drawer Example
// THIS IS THE DRAWER TOGGLER CLASS THAT HANDLES THE TOGGLING.
public class ActionBarDrawerEventArgs : EventArgs
{
public View DrawerView { get; set; }
public float SlideOffset { get; set; }
public int NewState { get; set; }
}
public delegate void ActionBarDrawerChangedEventHandler(object s, ActionBarDrawerEventArgs e);
@ChaseFlorell
ChaseFlorell / Cirrious.MvvmCross.ExternalAnnotations.xml
Last active August 29, 2015 13:57
Place this file beside the `Cirrious.MvvmCross.dll` file in each of the `lib` directories. Doing so will enable you to [alt] + [enter] (resharper) on an AutoProperty, and get the additional option "To property with change notification".
<?xml version="1.0" encoding="utf-8"?>
<assembly name="Cirrious.MvvmCross">
<member name="M:Cirrious.MvvmCross.ViewModels.MvxNotifyPropertyChanged.RaisePropertyChanged``1(System.Linq.Expressions.Expression{System.Func{``0}})">
<attribute ctor="M:JetBrains.Annotations.NotifyPropertyChangedInvocatorAttribute.#ctor" />
</member>
</assembly>
<!-- https://github.com/MvvmCross/MvvmCross/blob/v3.1/Cirrious/Cirrious.MvvmCross/ViewModels/MvxNotifyPropertyChanged.cs#L40 -->
'use strict';
myApp.directive('backButton', function () {
return {
restrict: 'E',
link: function (scope, element, attrs) {
element.bind('click', goBack);
function goBack() {
'use strict';
/*
*usage: <markdown ng:model="box.content"></markdown>
*/
myApp.directive('markdown', function ($compile) {
var nextId = 0;
//Make converter only once to save a bit of load each time - thanks to ajoslin
var converter = new Markdown.Converter();
@ChaseFlorell
ChaseFlorell / FragmentActivityBase.cs
Last active August 29, 2015 13:58
Simple way to Show a Fragment from within an MvxFragmentActivity
using System;
using Cirrious.CrossCore;
using Cirrious.MvvmCross.Droid.Fragging;
using Cirrious.MvvmCross.Droid.Fragging.Fragments;
using Cirrious.MvvmCross.ViewModels;
namespace $NAMESPACE$
{
public class FragmentActivityBase : MvxFragmentActivity
{