Skip to content

Instantly share code, notes, and snippets.

@Jasper7
Jasper7 / AdTrackingService.cs
Last active February 19, 2021 15:45
[Xamarin][iOS] Request AppTracking transparency permission for iOS 14+
//Dont forgot register service
//[assembly: Xamarin.Forms.Dependency(typeof(YourNameSpace.iOS.Services.AdTrackingService))]
public class AdTrackingService : ITrackingService
{
public void RequestAppTracking()
{
ATTrackingManager.RequestTrackingAuthorization(OnCompleteRequest);
}
@SIDOVSKY
SIDOVSKY / ADB over WiFi.md
Last active February 15, 2021 22:15
Find connected devices and establish ADB over WiFi with the selected one

PLATFORM

In order for these scripts to work adb must be reachable in the shell. If it's not then add adb location to PATH. On Windows you may also place adb.exe, AdbWinApi.dll, AdbWinUsbApi.dll to the same folder with the script.

On MacOS to open the script with double click it should be saved with .command extension.

Example:

@rotorgames
rotorgames / SmartObservableCollection.cs
Created December 16, 2020 18:38
Smart ObservableCollection
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Linq;
namespace Example
{
public class SmartObservableCollection<T> : ObservableCollection<T>
{
@JimmyPun610
JimmyPun610 / SwipeDownToCloseXamarinFormPage.md
Last active May 4, 2023 09:20
Xamarin Form swipe to close page behaviour

To Implement swipe down to close behavior, we should attach the behavior to a view.

In XAML

<ContentView x:Name="ViewToMove">
   <ContentView.Behaviors>
     <behavior:SwipeDownToClosePopupPage  CloseAction="ClosePage" ParentView="{x:Reference ViewToMove}"/>  
   </ContentView.Behaviors>
</ContentView>
@KirillAshikhmin
KirillAshikhmin / RelayCommand.cs
Created January 22, 2019 09:27
Task RelayCommand for Xamarin.Forms
using System;
using System.Threading.Tasks;
using System.Windows.Input;
using Xamarin.Forms;
using Xamarin.Forms.Internals;
namespace Project.Helpers
{
public class RelayCommand : ICommand {
readonly Func<Task> _tsk;
@fomvasss
fomvasss / Шпаргалка по Markdown.md
Created October 26, 2018 22:39
Шпаргалка по Markdown
@vorozhba
vorozhba / Как удалить commit в Github.txt
Last active May 5, 2024 16:45
Как удалить commit в Github
1. Получаем хэш-код коммита, к которому хотим вернуться.
2. Заходим в папку репозитория и пишем в консоль:
$ git reset --hard a3775a5485af0af20375cedf46112db5f813322a
$ git push --force

Note

Apple will reject apps that are using private url schemes (Ugh, Apple....) if they are pretty much obvius. Some apps are rejected and others are not, so, be aware of this issue before implementing any of those URL's in your app as a feature.

Updates

  • [UPDATE 4] iOS 10 update: apparently settings now can be reached using App-Pref instead of prefs
  • [UPDATE 3] For now you just can use url schemes to open your apps's settings with Swift 3.0 (Xcode 8). I'll keep you informed when OS preferences can be reached
  • [UPDATE 2] The openURL() method of UIApplication is now deprecated. You should use application(_:open:options:) instead
  • [UPDATE 1] Not yet tested in iOS 10. It will fail because of policies changes in URL scheme handling.
@adamawolf
adamawolf / Apple_mobile_device_types.txt
Last active May 6, 2024 09:56
List of Apple's mobile device codes types a.k.a. machine ids (e.g. `iPhone1,1`, `Watch1,1`, etc.) and their matching product names
i386 : iPhone Simulator
x86_64 : iPhone Simulator
arm64 : iPhone Simulator
iPhone1,1 : iPhone
iPhone1,2 : iPhone 3G
iPhone2,1 : iPhone 3GS
iPhone3,1 : iPhone 4
iPhone3,2 : iPhone 4 GSM Rev A
iPhone3,3 : iPhone 4 CDMA
iPhone4,1 : iPhone 4S