Skip to content

Instantly share code, notes, and snippets.

View parthjdabhi's full-sized avatar
🎯
Focusing

Parth Dabhi parthjdabhi

🎯
Focusing
View GitHub Profile
@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
@mrousavy
mrousavy / MEMOIZE.md
Last active May 5, 2025 12:07
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
@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 {
@danielwetan
danielwetan / nodejs-cicd-github-actions.md
Last active April 25, 2025 16:39
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

@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;
@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;
@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