Skip to content

Instantly share code, notes, and snippets.

View parthjdabhi's full-sized avatar
🎯
Focusing

Parth Dabhi parthjdabhi

🎯
Focusing
View GitHub Profile
@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 \
@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 ../../../../../../
@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 {
import SwiftUI
import os
@main
struct ios14DemoApp: App {
@StateObject var notificationCenter = NotificationCenter()
@UIApplicationDelegateAdaptor private var appDelegate: AppDelegate
var body: some Scene {
WindowGroup {
@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()")
@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
extension UIHostingController {
convenience public init(rootView: Content, ignoreSafeArea: Bool) {
self.init(rootView: rootView)
if ignoreSafeArea {
disableSafeArea()
}
}
func disableSafeArea() {
@agrcrobles
agrcrobles / Setup my mac.md
Last active March 30, 2023 05:03
Setup my mac for react native on android
@igreenwood
igreenwood / ImageUtil.kt
Last active January 10, 2022 09:33
How to create down-scaled image file before image upload
import android.annotation.TargetApi
import android.content.ContentUris
import android.content.Context
import android.database.Cursor
import android.graphics.Bitmap
import android.graphics.Bitmap.createBitmap
import android.graphics.BitmapFactory
import android.graphics.Matrix
import android.net.Uri
import android.opengl.GLES10
@shmehdi01
shmehdi01 / KotlinExtensionUtils.kt
Last active May 1, 2023 22:26
Kotlin Extension Utils
import android.animation.*
import android.app.Activity
import android.content.*
import android.content.Context.CLIPBOARD_SERVICE
import android.content.pm.PackageManager
import android.content.res.ColorStateList
import android.graphics.Color
import android.graphics.Typeface
import android.net.Uri
import android.provider.Settings