Skip to content

Instantly share code, notes, and snippets.

View farukaf's full-sized avatar
more coffee = more code

Faruk farukaf

more coffee = more code
View GitHub Profile
@farukaf
farukaf / DistanceBetweenPoints.cs
Last active October 14, 2020 12:19
Calculate Distance Between Two Points in Three Dimensions C#
class Program
{
static void Main(string[] args)
{
var p1 = new Vector3()
{
X = 6,
Y = 4,
Z = -3
};
@farukaf
farukaf / Login.xaml
Created September 17, 2020 14:31
Xamarin Code Behind - Login Example - With ActivityIndicator
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:d="http://xamarin.com/schemas/2014/forms/design"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Shell.NavBarIsVisible="False"
Title="Login"
Visual="Material"
BackgroundColor="{StaticResource StrongBGColor}"
@farukaf
farukaf / UnitTestCalculoFechamentoFatura.cs
Last active October 7, 2020 14:07
Class and TestCases for Calc of the invoice next closing day
[TestClass]
public class UnitTestCalculoFechamentoFatura
{
[TestMethod]
[DataRow("2020-08-31", null, "2020-09-30")]
[DataRow("2020-10-31", "2020-11-30", "2020-12-31")]
[DataRow("2020-01-31", null, "2020-02-29")]
[DataRow("2020-12-31", "2021-01-31", "2021-02-28")]
[DataRow("2020-12-30", "2021-01-30", "2021-02-28")]
[DataRow("2020-12-30", "2021-02-28", "2021-03-30")]
@farukaf
farukaf / ContentPageGridOK.xaml
Created December 5, 2020 14:06
Xamarin Problemas de Grid e Sobreposição no iOS
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:d="http://xamarin.com/schemas/2014/forms/design"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Shell.NavBarIsVisible="True"
BackgroundColor="{StaticResource StrongBGColor}"
xmlns:vm="clr-namespace:DriverPerformance.ViewModels"
Title="{Binding Title}"
@farukaf
farukaf / DeviceLog.csv
Last active December 12, 2020 21:01
Xamarin iOs Freeze on Deploy Log Files
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
Time;Device Name;Type;PID;Tag;Message
Dec 7 16:47:56;iPad;Warning;1337;splashboardd;"Could not load the "Icon-60.png" image referenced from a nib in the bundle with identifier "com.netspeed.tanaconta"
Dec 7 16:48:43;iPad;Error;1266;notification_proxy;0x1f081000 -[MNPLockdownConnection receiveMessage]: lockdown_receive_message error!
Dec 7 16:48:43;iPad;Error;1;com.apple.xpc.launchd;assertion failed: 13G36: launchd + 85529 [083E000D-4C31-3B98-A2C4-6FADB4D1940F]: 0x3
Dec 7 16:48:43;iPad;Notice;0;kernel;xpcproxy[1405] Container: /private/var/mobile/Containers/Data/Application/ADAD2877-14DD-46F4-8A33-4AF59B20CCC0 (sandbox)
Dec 7 16:48:42;iPad;Error;1340;amfid;SecTrustEvaluate [leaf IssuerCommonName SubjectCommonName]
Dec 7 16:48:42;iPad;Error;1202;securityd;secTaskDiagnoseEntitlements MISSING keychain entitlements: no stored taskRef found
Dec 7 16:48:42;iPad;Error;1202;securityd;secTaskDiagnoseEntitlements MISSING keychain entitlements: no stored taskRef found
Dec 7 16:48:42;iPad;Error;1340;amfid;SecTrus
@farukaf
farukaf / APPNullableDatePicker.cs
Last active May 29, 2021 16:08
Nullable DatePicker Xamarin - Update from jrgcubano
using System;
using System.Collections.Generic;
using System.Text;
using Xamarin.Forms;
namespace NullableDateAPP.Controls
{
public class NullableDatePicker : DatePicker
{
public NullableDatePicker() : base()
@farukaf
farukaf / SwitchSingleMultiUser
Created August 2, 2021 17:28
Switch SQL Server SingleUser/MultiUser to cut open connections
USE DBNAME
GO
ALTER DATABASE DBNAME SET SINGLE_USER WITH ROLLBACK IMMEDIATE
GO
ALTER DATABASE DBNAME SET MULTI_USER WITH ROLLBACK IMMEDIATE