Skip to content

Instantly share code, notes, and snippets.

View joshayoung's full-sized avatar

Josh Young joshayoung

View GitHub Profile
@joshayoung
joshayoung / ThousandsSeparator.kt
Last active July 15, 2025 22:23
Mobile Dev Campus Mini Challenges: Thousands Separator
package com.joshayoung.mobiledevcampusminichallenges
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
@joshayoung
joshayoung / xamarin.forms-android-comparison.md
Created December 14, 2021 13:07 — forked from paynerb/xamarin.forms-android-comparison.md
A comparison of the Xamarin.Forms and Android development ecosystems

Xamarin.Forms to Android Comparison

Android Xamarin.Forms
Android Studio Rider, Visual Studio
Kotlin, Java C#
Gradle .NET SDK, NuGet
OkHttp, Retrofit, Volley RestSharp, HttpClient
Moshi Json.NET
Activity ContentPage
@joshayoung
joshayoung / StubVoid.cs
Last active October 26, 2021 12:48
Stub a Void Method with NSubstitute
[Fact]
public void Refresh_Called_CalledPullNotesOnCollection()
{
this.collection.Configure().When(d => d.PullNotes()).DoNotCallBase();
var sut = new NoteCollectionViewModel(this.collection);
sut.Refresh();
this.collection.Configure().Received().PullNotes();
}
private void ButtonClickedEvent(object sender, EventArgs e)
{
var myViewModel = (MyViewModel)((BindableObject) sender).BindingContext;
// The rest of the code.
}
<Entry Placeholder="First Name" x:Name="firstName" />
<Entry
BackgroundColor="LightGray"
IsEnabled="False"
Placeholder="Last Name">
<Entry.Triggers>
<!-- Enabled this field after 'firstName' is longer than three characters -->
<DataTrigger
Binding="{Binding Source={x:Reference firstName}, Path=Text.Length}"
TargetType="Entry"
<Entry Placeholder="Test Value">
<Entry.Triggers>
<Trigger TargetType="Entry" Property="Text" Value="Change When This Value">
<!-- The 'Entry' field will get these values when the text in the Entry matches the 'Value' above -->
<Setter Property="BackgroundColor" Value="Tomato" />
<Setter Property="Scale" Value="2" />
<Setter Property="TextColor" Value="White" />
</Trigger>
</Entry.Triggers>
if (!(((VisualElement)sender).BindingContext is ViewModel ViewModel)) return;
@joshayoung
joshayoung / README.md
Created April 1, 2021 12:14 — forked from deviantony/README.md
Portainer admin password in a docker-compose environment

Portainer compose deployment with admin password preset

This file aims to explain how to deploy Portainer inside a compose file with the admin password already set.

Generate the admin password

For this example, we'll use the password superpassword.

Use the following command to generate a hash for the password:

@joshayoung
joshayoung / rails http status codes
Created November 20, 2020 14:41 — forked from mlanett/rails http status codes
HTTP status code symbols for Rails
HTTP status code symbols for Rails
Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings.
Status Code Symbol
1xx Informational
100 :continue
101 :switching_protocols
102 :processing