Skip to content

Instantly share code, notes, and snippets.

Chase Florell ChaseFlorell

View GitHub Profile
ChaseFlorell / .gitconfig
Last active Apr 15, 2019
Customized Git Config
View .gitconfig
autoStash = true
co = checkout
st = status -s
stats = shortlog -sn --no-merges
lg = log --decorate --pretty=format:%h%x09%an%x09%ad%x09%s --no-merges
cleanup = "!git fetch --all && git branch --merged | grep -v '\\*\\|master\\|develop\\|development\\|dev\\|vnext' | xargs -n 1 git branch -d"
new = checkout -b
alias = config --get-regexp ^alias\\. # List all aliases.
ChaseFlorell / example.xaml
Created Mar 3, 2019
trying to adjust FlexLayout.Basis on orientation changed
View example.xaml
<DataTrigger TargetType="Grid" Binding="{Binding CurrentOrientation, Source={x:Static Device.Info}}" Value="{x:Static internals:DeviceOrientation.Portrait}" >
<Setter Property="FlexLayout.Basis" Value="50%" />
<DataTrigger TargetType="Grid" Binding="{Binding CurrentOrientation, Source={x:Static Device.Info}}" Value="{x:Static internals:DeviceOrientation.Landscape}" >
<Setter Property="FlexLayout.Basis" Value="33%" />
View fast-find-powershell-profile.ps1
Set-Alias less "C:\Program Files\Git\usr\bin\less.exe"
function f($text, $files="*.*")
findstr /spin $text $files | less
View PropertyCopy.cs
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Reflection;
namespace MiscUtil.Reflection
/// <summary>
/// Non-generic class allowing properties to be copied from one instance
/// to another existing instance of a potentially different type.
ChaseFlorell / Progress.cs
Created Apr 26, 2017
How to run two processes simultaneously.
View Progress.cs
using System;
using System.Threading;
using System.Threading.Tasks;
namespace Utils
public static class Progress
public static Task ProgressDots(CancellationToken token)
ChaseFlorell / listview.cs.xaml
Created Apr 21, 2017
my idea of a xamarin forms listview
View listview.cs.xaml
<ListView SeparatorWidth="2"
PullToRefreshCommand="{Binding Fetch}"
ItemTappedCommand="{Binding Navigate}">
<ViewCellItemStyle State="Normal" BackgroundColor="White" SeparatorColor="Red" />
<ViewCellItemStyle State="Pressed" BackgroundColor="Grey" SeparatorColor="Blue" />
<ViewCellItemStyle State="LongPressed" BackgroundColor="Green" SeparatorColor="Pink" />
ChaseFlorell / FontData.cs
Created Apr 18, 2017
Build a formatted string for Xamarin Forms
View FontData.cs
using System;
using System.Linq;
using Xamarin.Forms;
namespace Helpers
public class FontData
public double FontSize { get; set; }
public FontAttributes FontAttributes { get; set; }
ChaseFlorell / TouchableBoxViewRenderer_Droid.cs
Created Nov 16, 2016
Xamarin Forms Android Ripple Effect
View TouchableBoxViewRenderer_Droid.cs
public class TouchableBoxViewRenderer_Droid : BoxRenderer
protected override void OnElementChanged(ElementChangedEventArgs<BoxView> e)
if (e.NewElement == null) return;
var attrs = new[] {Android.Resource.Attribute.SelectableItemBackground};
var ta = Context.ObtainStyledAttributes(attrs);
ChaseFlorell / Localize.cs
Created Aug 31, 2016
Xamarin Forms Localization
View Localize.cs
// iOS
public class Localize : ILocalize
private static CultureInfo _currentCulture;
public CultureInfo GetCurrentCultureInfo()
if (_currentCulture != null)
ChaseFlorell / android-ndk.ps1
Created Jun 9, 2016
Install the Android NDK as part of your PowerShell build. Xamarin Android
View android-ndk.ps1
$path ='C:\Android\android-ndk'
$ndk = 'android-ndk-r11c'
$fullPath = Join-Path $path $ndk
if(!(Test-Path $fullPath)){
New-Item $path -Force -ItemType directory
(New-Object Net.WebClient).DownloadFile("$", "C:\Temp\$")
(new-object -com shell.application).namespace("$path").CopyHere((new-object -com shell.application).namespace("C:\Temp\$").Items(),16)
$regPath = 'HKCU:\Software\Novell\Mono for Android'
$regKey = 'AndroidNdkDirectory'
$regValue = $fullPath
You can’t perform that action at this time.