Skip to content

Instantly share code, notes, and snippets.

View 0xced's full-sized avatar

Cédric Luthi 0xced

View GitHub Profile
Package Id Version Commands
-------------------------------------------------------------------------------------------
alias 0.1.3 assemblyalias
cake.tool 1.3.0 dotnet-cake
codecov.tool 1.13.0 codecov
csharprepl 0.3.4 csharprepl
diffenginetray 8.3.0 DiffEngineTray
docfx 3.0.0-beta1-1050-g0d0102792b docfx
dotnet-ef 6.0.0 dotnet-ef
dotnet-project-licenses 2.3.6 dotnet-project-licenses
@0xced
0xced / Answer to StackOverflow-60230760.md
Last active February 18, 2020 20:56
Answer to "No depthData with iPhone X, iPhone XS is fine" https://stackoverflow.com/questions/60230760/no-depthdata-with-iphone-x-iphone-xs-is-fine as a gist since my answer was deleted on the grounds that a link to some other code is not an answer

I recently worked on a project where I had to access the depth data on an iPhone X. I forked the ALCameraViewController project and created a depth branch. You can clone my repository and checkout the depth branch. Then run the demo app and take a picture with the camera.

Put a breakpoint on line 148 of the CameraView.swift file and check if photo.depthData is nil in the photoOutput(_, didFinishProcessingPhoto, error) callback. For me it was never nil on an iPhone X.

If it's not nil then you can compare the code and understand the difference. It it's nil then it's probably a bug in iOS itself and I'd suggest you to update to the latest iOS version.

@0xced
0xced / IBSegueActionBackport.h
Created January 27, 2020 10:20
[Work In Progress] Backport of the IBSegueAction feature for iOS < 13
//
// ⚠️ WORK IN PROGRESS, NOT FUNCTIONAL ⚠️
// Backport of the IBSegueAction feature for iOS < 13
// See https://sarunw.com/posts/better-dependency-injection-for-storyboards-in-ios13/ and https://useyourloaf.com/blog/better-storyboards-with-xcode-11/
//
@import Foundation;
BOOL XCDBackportIBSegueAction(void);
@0xced
0xced / Podfile
Created January 23, 2020 11:48
Sample Podfile with common workarounds: disable warnings for pods, using a branch, deleting deployment target from pods project, deleting swift files
platform :ios, '12.0'
target 'MyApp' do
inhibit_all_warnings!
pod 'libextobjc/EXTKeyPathCoding', '0.6'
pod 'libextobjc/EXTScope', '0.6'
pod 'Mantle', '~> 2.1'
pod 'RSParser', :git => 'https://github.com/0xced/RSParser', :branch => 'nsarray'
end
@0xced
0xced / NuGet with native dynamic libraries.txt
Created October 17, 2019 12:31
NuGet with native dynamic libraries [dylib] [dll] [so]
https://stackoverflow.com/questions/38728583/how-to-create-nuget-package-for-native-c/57616597#57616597
--> https://digitalhouseblog.wordpress.com/2019/08/22/how-to-make-a-nuget-package-for-c/
https://dev.to/jeikabu/loading-native-libraries-in-c-fh6
--> https://docs.microsoft.com/en-us/windows/win32/dlls/dynamic-link-library-search-order
--> https://rendered-obsolete.github.io/2018/08/15/nupkg-with-native.html (broken link on dev.to)
--> https://natemcmaster.com/blog/2018/07/25/netcore-plugins/
https://stackoverflow.com/questions/49270527/can-you-dynamically-load-cross-platform-native-unmanaged-dlls-libs-in-net-core/52286519#52286519
@0xced
0xced / Yak Shaving.md
Last active September 24, 2019 12:33
Diagnosing issues when building Nerdle.AutoConfig on Travis CI

I'm submitting a [pull request][17] to Nerdle.AutoConfig and [Build #103][1] fails with this error:

Installing Mono
E: Unable to locate package referenceassemblies-pcl
The command "sudo apt-get install -qq mono-complete mono-vbnc fsharp nuget referenceassemblies-pcl" failed and exited with 100 during .

Your build has been stopped.
@0xced
0xced / netcore single exe.md
Last active November 16, 2022 15:14
Building a .NET Core single exe for Linux on macOS or Windows

Building a .NET Core single exe for Linux on macOS or Windows

Run the .NET Core SDK docker image and share your working directory containing your .csproj file at /home in the container.

On Linux/macOS:

docker run --interactive --tty --rm --volume "$(pwd):/home" mcr.microsoft.com/dotnet/core/sdk:2.2 /bin/bash

On Windows:

@0xced
0xced / DisplayException.cs
Created May 1, 2019 07:46
Display exceptions with a TaskDialog or a MessageBox
// For setting up unhandled exceptions handlers: https://stackoverflow.com/questions/5762526/how-can-i-make-something-that-catches-all-unhandled-exceptions-in-a-winforms-a
// Using Ookii.Dialogs: https://www.nuget.org/packages?q=Ookii.Dialogs
static void DisplayException(Exception exception)
{
var baseException = exception.GetBaseException();
var title = @"Error: " + baseException.GetType().Name;
var message = baseException.Message;
if (TaskDialog.OSSupportsTaskDialogs)
{
using (var dialog = new TaskDialog())
@0xced
0xced / Working without a nib.md
Created March 7, 2019 19:02
Working without a nib blog posts by Jeff Johnson (@lapcatsoftware)
  • [Working without a nib, Part 1][1]
  • [Working without a nib, Part 2: Also Also Wik][2]
  • [Working without a nib, Part 5: No, 3!][3]
  • [Working without a nib, Part 4: setAppleMenu][4]
  • [Working without a nib, Part 5: Open Recent menu][5]
  • [Working without a nib, Part 6: Working without a xib][6]
  • [Working without a nib, Part 7: The empire strikes back][7]
  • [Working without a nib, Part 8: The nib awakens][8]
  • [Working without a nib, Part 9: Shipping without a nib][9]
  • [Working without a nib, Part 10: Mac Main Menu][10]
@0xced
0xced / NativeSQLiteWithCostura.csproj
Last active January 19, 2023 20:21
Embed native e_sqlite3.dll or SQLite.Interop.dll with Costura without having to manually copy any dll
<!-- Useful when bundling an app using Microsoft.EntityFrameworkCore.Sqlite, which depends on SQLitePCLRaw.bundle_green, which depends on SQLitePCLRaw.lib.e_sqlite3.v110_xp (having native Windows dlls) -->
<ItemGroup>
<EmbeddedResource Include="$(NugetPackageRoot)\sqlitepclraw.lib.e_sqlite3.v110_xp\1.1.13\runtimes\win-x86\native\e_sqlite3.dll">
<Link>costura32\e_sqlite3.dll</Link>
</EmbeddedResource>
<EmbeddedResource Include="$(NugetPackageRoot)\sqlitepclraw.lib.e_sqlite3.v110_xp\1.1.13\runtimes\win-x64\native\e_sqlite3.dll">
<Link>costura64\e_sqlite3.dll</Link>
</EmbeddedResource>
</ItemGroup>