Skip to content

Instantly share code, notes, and snippets.

@Sa1Gur
Sa1Gur / script.js
Created April 11, 2022 07:24
script.js
import http from 'k6/http';
import { check, sleep } from 'k6';
export const options = {
stages: [
{ duration: '1s', target: 100 },
{ duration: '30s', target: 20 },
{ duration: '1m30s', target: 10 },
{ duration: '20s', target: 0 },
],
@Sa1Gur
Sa1Gur / k6IdentityServer.js
Last active April 11, 2022 07:20
k6IdentityServer.js
import http from 'k6/http';
/**
* Authenticate using OAuth against IdentityServer
* @function
* @param {string} identityServerUrl - IdentityServer url to authenticate against
* @param {string} clientId - Generated by IdentityServer automatically
* @param {string} scope - Space-separated list of scopes
* @param {string|object} resource - Either a resource ID (as string) or an object containing username and password
*/
public class MyMaterialEntryRenderer : MaterialEntryRenderer
{
protected override void OnElementChanged(ElementChangedEventArgs<Entry> e)
{
base.OnElementChanged(e);
TintCustomization(Control, e.NewElement as MyMaterialEntry);
}
protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)
protected override void OnElementChanged(ElementChangedEventArgs<Entry> e)
{
base.OnElementChanged(e);
if (Control == null || e.NewElement == null) return;
if (e.NewElement is MyMaterialEntry customEntry)
{
EditText.SetHighlightColor(color: customEntry.MyHighlightColor.ToAndroid());
public static readonly BindableProperty MyHighlightColorProperty = BindableProperty.Create(nameof(MyHighlightColor), typeof(Color), typeof(MyMaterialEntry));
public static readonly BindableProperty MyHandleColorProperty = BindableProperty.Create(nameof(MyHandleColor), typeof(Color), typeof(MyMaterialEntry));
public static readonly BindableProperty MyTintColorProperty = BindableProperty.Create(nameof(MyTintColor), typeof(Color), typeof(MyMaterialEntry));
public Color MyHighlightColor
{
get => (Color)GetValue(MyHighlightColorProperty);
set => SetValue(MyHighlightColorProperty, value);
public class MyMaterialEntry : Entry
{
}
@Sa1Gur
Sa1Gur / MaterialEntriesFinalState.xaml
Created December 2, 2019 14:04
Material Entries Final State
<StackLayout Visual="Material">
<Label Text="Customized" />
<materialentry:MyMaterialEntry Text="Text" TextColor="White" PlaceholderColor="Green" BackgroundColor="YellowGreen" MyHighlightColor="Orange" MyHandleColor="Red" />
<materialentry:MyMaterialEntry Placeholder="Placeholder" TextColor="White" PlaceholderColor="Green" BackgroundColor="YellowGreen" MyHighlightColor="Orange" MyHandleColor="BlueViolet" />
</StackLayout>
@Sa1Gur
Sa1Gur / MaterialEntriesInitialState.xaml
Created December 2, 2019 13:28
Material Entries initial state
<StackLayout Visual="Material">
<Label Text="Default" />
<Entry Text="Text" TextColor="White" PlaceholderColor="Green" BackgroundColor="YellowGreen" />
<Entry Placeholder="Placeholder" TextColor="White" PlaceholderColor="Green" BackgroundColor="YellowGreen" />
</StackLayout>
...
namespace In2TeamsSplitter.Models
{
[Table("teammates")]
public class TeamMateItem : INotifyPropertyChanged
{
...
public Command RemoveCommand => new Command(Remove);
private void Remove()
...
namespace In2TeamsSplitter.ViewModels
{
class TeamMatesViewModel : INotifyPropertyChanged
{
...
public TeamMatesViewModel()
{
AddNewTeamMateCommand = new Command(() => AddNewTeamMate());
...