Skip to content

Instantly share code, notes, and snippets.

View parthjdabhi's full-sized avatar
🎯
Focusing

Parth Dabhi parthjdabhi

🎯
Focusing
View GitHub Profile
@Skyyo
Skyyo / ImageCompressor.kt
Created October 28, 2021 07:11
#compression #image_compression #optimization
object ImageCompressor {
/**
* @param context the application environment
* @param imageUri the input image uri. usually "content://..."
* @param imageFile file where the image was saved. For "photo from camera" scenarios. If it's
* null - we're creating the File inside the createFileAndCompress()
* @param compressFormat the output image file format
* @param maxWidth the output image max width
* @param maxHeight the output image max height
@lslv1243
lslv1243 / image_editor.dart
Created August 12, 2021 14:28
Flutter Image Editor
import 'dart:async';
import 'dart:typed_data';
import 'dart:ui';
const _BYTES_PER_PIXEL = 4;
class ImageEditor {
final int imageWidth;
final int imageHeight;
final ByteData _byteData;
@lslv1243
lslv1243 / positioned_overlay_entry.dart
Created July 28, 2021 19:45
Can be used to enable touch events to happen in a Positioned widget which is outside of the stack boundaries.
class PositionedOverlayEntry extends StatefulWidget {
final OverlayState overlay;
final Widget child;
final double? left;
final double? top;
final double? right;
final double? bottom;
final double? width;
final double? height;
@danielwetan
danielwetan / nodejs-cicd-github-actions.md
Last active July 22, 2024 15:13
Deploy Node.js to VPS using Github Actions

Deploy Node.js to VPS using Github Actions

Steps to deploy Node.js to VPS using PM2 and Github Actions

1. Clone repo to VPS folder

@darrarski
darrarski / App.swift
Created April 7, 2021 15:56
Lazy navigation in SwiftUI - animations issue
// Based on "Lazy navigation in SwiftUI" blogpost by Majid Jabrayilov
// Blogpost url: https://swiftwithmajid.com/2021/01/27/lazy-navigation-in-swiftui/
// This gist shows an issue with using conditional NavigationLinks.
// When using StackNavigationViewStyle push animations are not present.
import SwiftUI
@main
struct LazyNavApp: App {
var body: some Scene {
@mrousavy
mrousavy / MEMOIZE.md
Last active June 28, 2024 17:29
Memoize!!! 💾 - a react (native) performance guide
In computing, memoization or memoisation
is an optimization technique used primarily
to speed up computer programs by storing
the results of expensive function calls and  
returning the cached result when the same
inputs occur again.                                         
                                                     — wikipedia
@ZanderZhan
ZanderZhan / ImageUtil.kt
Last active January 10, 2022 09:33
ImageWorker
import android.Manifest
import android.content.Context
import android.content.Intent
import android.content.pm.PackageManager
import android.graphics.Bitmap
import android.media.MediaScannerConnection
import android.net.Uri
import android.os.Build
@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
@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
@agrcrobles
agrcrobles / Setup my mac.md
Last active March 30, 2023 05:03
Setup my mac for react native on android