Skip to content

Instantly share code, notes, and snippets.

Cédric Luthi 0xced

Block or report user

Report or block 0xced

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View On Windows (scoop list)
7zip 19.00
aria2 1.35.0-1
azuredatastudio 1.18.0 [extras]
cacert 2020-01-01
captura 8.0.0 [extras]
cmder 1.3.14
curl 7.70.0
ditto 3.22.88.0 [extras]
dnspy 6.1.4 [extras]
docfx 2.54
@0xced
0xced / Answer to StackOverflow-60230760.md
Last active Feb 18, 2020
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
View Answer to StackOverflow-60230760.md

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 Jan 27, 2020
[Work In Progress] Backport of the IBSegueAction feature for iOS < 13
View IBSegueActionBackport.h
//
// ⚠️ 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 Jan 23, 2020
Sample Podfile with common workarounds: disable warnings for pods, using a branch, deleting deployment target from pods project, deleting swift files
View Podfile
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 Oct 17, 2019
NuGet with native dynamic libraries [dylib] [dll] [so]
View NuGet with native dynamic libraries.txt
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 Sep 24, 2019
Diagnosing issues when building Nerdle.AutoConfig on Travis CI
View Yak Shaving.md

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 Apr 21, 2020
Building a .NET Core single exe for Linux on macOS or Windows
View netcore single exe.md

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
Display exceptions with a TaskDialog or a MessageBox
View DisplayException.cs
// 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 Mar 7, 2019
Working without a nib blog posts by Jeff Johnson (@lapcatsoftware)
View Working without a nib.md
  • [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 Feb 25, 2020
Embed native e_sqlite3.dll or SQLite.Interop.dll with Costura without having to manually copy any dll
View NativeSQLiteWithCostura.csproj
<!-- 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>
You can’t perform that action at this time.