Skip to content

Instantly share code, notes, and snippets.

View jatovar's full-sized avatar
😁
<3

Jorge Tovar jatovar

😁
<3
View GitHub Profile
@frankhale
frankhale / Foo.cs
Created May 14, 2020 20:01
Map single object to list of objects in AutoMapper
using AutoMapper;
using System.Collections.Generic;
namespace AutoMapperSandbox
{
public class SingleObjectToListConverter<T> : ITypeConverter<T, List<T>>
{
public List<T> Convert(T source, List<T> destination, ResolutionContext context)
{
return new List<T>() { source };
@M-Yankov
M-Yankov / App.Config
Created September 18, 2019 22:26
A sample C# .NET CORE app using PredicateBuilder.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<connectionStrings>
<add name="LocalDb" connectionString="Data Source=LENOVO-G710;Initial Catalog=PredicateBuilder;Integrated Security=True" providerName=""/>
</connectionStrings>
</configuration>
@alfeugds
alfeugds / CurrencyConverter.cs
Last active July 13, 2023 06:01
Xamarin Forms Currency Mask for Entry fields
using System;
using System.Globalization;
using System.Text.RegularExpressions;
using Xamarin.Forms;
namespace MyProject.Util
{
/// <summary>
/// Converter for using in Entry fields for masked input of currency.
/// <para>The binded property must be of type decimal, and must invoke the PropertyChangedEventArgs event whenever the value is changed, so that the desired mask behavior is kept.</para>
@jessejiang0214
jessejiang0214 / CustomAllViewCellRendereriOS.cs
Created January 25, 2016 05:30
Disable Xamarin Forms ListView select item HightLight color
using System;
using Xamarin.Forms;
using Xamarin.Forms.Platform.iOS;
[assembly: ExportRenderer (typeof(ViewCell), typeof(MyAPP.iOS.CustomAllViewCellRendereriOS))]
namespace MyAPP.iOS
{
public class CustomAllViewCellRendereriOS : ViewCellRenderer
{
public override UIKit.UITableViewCell GetCell (Cell item, UIKit.UITableViewCell reusableCell, UIKit.UITableView tv)
@bradmontgomery
bradmontgomery / dummy-web-server.py
Last active March 31, 2025 12:04
a minimal http server in python. Responds to GET, HEAD, POST requests, but will fail on anything else.
#!/usr/bin/env python
"""
Very simple HTTP server in python (Updated for Python 3.7)
Usage:
./dummy-web-server.py -h
./dummy-web-server.py -l localhost -p 8000
Send a GET request: