Skip to content

Instantly share code, notes, and snippets.

View cetorres's full-sized avatar
📱

Carlos Eugenio Torres cetorres

📱
View GitHub Profile
@cetorres
cetorres / tinydb_oci_storage.py
Last active August 8, 2023 23:03
Python TinyDB OCI custom storage
import json
import os
import oci
from tinydb import Storage
'''
OCIStorage is custom Storage for TinyDB to allow
store JSON DB files in OCI Object Storage service.
Create a TinyDB instance using the following example:
@cetorres
cetorres / bun_solidjs.txt
Created July 18, 2022 16:55
Bun + SolidJS
npx degit solidjs/templates/ts mySolidTest
cd mySolidTest
rm pnpm-lock.yaml
bun install
bun start
@cetorres
cetorres / DetectiPhoneX.dart
Created October 9, 2019 16:51
Detect iPhone X or greater in Flutter / Dart
class DetectiPhoneXOrGreater {
static bool isiPhoneXOrGreater(context) {
if (Platform.isAndroid) {
return false;
}
else if (Platform.isIOS) {
double height = MediaQuery.of(context).size.height;
if (height >= 812.0) return true;
}
return false;
@cetorres
cetorres / DebugMode.dart
Created October 9, 2019 16:47
Detect debug mode in Flutter / Dart
class DebugMode {
static bool get isInDebugMode {
bool inDebugMode = false;
assert(inDebugMode = true);
return inDebugMode;
}
}
@cetorres
cetorres / main_page.dart
Created September 28, 2019 16:37
Push notifications with Firebase Cloud Messaging and Flutter
import 'package:flutter/material.dart';
import '../utils/util.dart';
import '../controllers/push_notifications.dart';
class MainPage extends StatefulWidget {
@override
_MainPageState createState() => _MainPageState();
}
class _MainPageState extends State<MainPage> {