Skip to content

Instantly share code, notes, and snippets.

View parthjdabhi's full-sized avatar
🎯
Focusing

Parth Dabhi parthjdabhi

🎯
Focusing
View GitHub Profile
extension UIHostingController {
convenience public init(rootView: Content, ignoreSafeArea: Bool) {
self.init(rootView: rootView)
if ignoreSafeArea {
disableSafeArea()
}
}
func disableSafeArea() {
@yusufceylan
yusufceylan / OpenCameraAndSavePhoto.kt
Last active February 6, 2023 03:18
Take photo from camera and save it to gallery
// Take photo from camera and save it to public gallery
// Before Q and After Q implementations
// Answer riginally taken from this SO answer
// https://stackoverflow.com/a/59482148/5695091
private val REQUEST_TAKE_PHOTO = 101
private val REQUEST_PICK_PHOTO = 102
private var photoURI : Uri? = null
@mobilinked
mobilinked / gist:9b6086b3760bcf1e5432932dad0813c0
Last active February 9, 2024 13:03
SwiftUI - prevent auto dismiss the sheet by drag down
//
// Created by https://quickplan.app on 2020/11/8.
//
import SwiftUI
/// Control if allow to dismiss the sheet by the user actions
/// - Drag down on the sheet on iPhone and iPad
/// - Tap outside the sheet on iPad
/// No impact to dismiss programatically (by calling "presentationMode.wrappedValue.dismiss()")
import SwiftUI
import os
@main
struct ios14DemoApp: App {
@StateObject var notificationCenter = NotificationCenter()
@UIApplicationDelegateAdaptor private var appDelegate: AppDelegate
var body: some Scene {
WindowGroup {
@jonathanpalma
jonathanpalma / KeychainStorage.js
Last active October 28, 2024 06:46
How to persis redux store using redux-persist and react-native-keychain
import AsyncStorage from '@react-native-community/async-storage';
import {
setGenericPassword,
getGenericPassword,
resetGenericPassword,
} from 'react-native-keychain';
const KeychainStorage = {
async getAllKeys(cb) {
try {
@CaiJingLong
CaiJingLong / build_ios.sh
Created April 9, 2020 03:10
build ios shell by @AlexVincent525
# remove iOS bitcode
flutter build ios
cd build/ios/iphoneos/Runner.app/Frameworks
cd App.framework
xcrun bitcode_strip -r app -o app
cd ..
cd Flutter.framework
xcrun bitcode_strip -r Flutter -o Flutter
cd ../../../../../../
@CaiJingLong
CaiJingLong / build_android.sh
Last active August 12, 2022 10:15
在mac上 使用ndk r21b 编译 ffmpeg 4.3.1 的so
#!/bin/bash
NDK=/Volumes/Samsung-T5/sdk/android-ndk-r21b
TOOLCHAIN=$NDK/toolchains/llvm/prebuilt/darwin-x86_64
API=21
function build_android() {
cd ffmpeg-4.3.1
echo "Compiling FFmpeg for $CPU"
./configure \
@Mike-Gough
Mike-Gough / README.md
Last active June 12, 2024 23:48
Setup new React Native project with Typescript and Storyboard

React Native App Creation Recipe

This is a step-by-step guide to create React Native app.

You will get an application which has;

  • TypeScript
  • Linting
  • Formatting
  • Testing
@pschmidtboeing
pschmidtboeing / iOS_watchOS_device_types.txt
Last active February 3, 2021 13:05 — forked from adamawolf/Apple_mobile_device_types.txt
List of iOS and Watch OS device codes types a.k.a. machine ids (e.g. iPhone1,1) and their matching product names
i386 : iOS Simulator 32-bit
x86_64 : iOS Simulator 64-bit
iPhone1,1 : iPhone 1st Gen
iPhone1,2 : iPhone 3G 2nd Gen
iPhone2,1 : iPhone 3GS 3rd Gen
iPhone3,1 : iPhone 4
iPhone3,2 : iPhone 4 (GSM) Rev A
iPhone3,3 : iPhone 4 (CDMA)
iPhone4,1 : iPhone 4s