Skip to content

Instantly share code, notes, and snippets.

View lnaie's full-sized avatar
🏠

Lucian Naie lnaie

🏠
View GitHub Profile
@lnaie
lnaie / try-catch.ts
Created March 21, 2025 10:46 — forked from t3dotgg/try-catch.ts
Theo's preferred way of handling try/catch in TypeScript
// Types for the result object with discriminated union
type Success<T> = {
data: T;
error: null;
};
type Failure<E> = {
data: null;
error: E;
};
@lnaie
lnaie / Database.cs
Created July 29, 2017 20:52 — forked from matpag/Database.cs
Xamarin Forms SQLite database upgrade strategy
using ProjectTest.MyModels;
using SQLite.Net;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
namespace ProjectTest.Database