Skip to content

Instantly share code, notes, and snippets.

View rutvik110's full-sized avatar
🎵
Humming

Rutvik Tak rutvik110

🎵
Humming
View GitHub Profile
#pragma glslify: range = require('glsl-range');
void main () {
// Your incoming value
float x = 25.0;
// Map value to 0..1 domain
// (no need if x is already in 0..1 range)
float min = 10.0;
float max = 100.0;
@rutvik110
rutvik110 / image_size_data.dart
Created June 23, 2022 12:58 — forked from dnfield/image_size_data.dart
Image size parsing in Dart
import 'dart:typed_data';
import 'package:meta/meta.dart';
/// Image formats supported by Flutter.
enum ImageFormat {
/// A Portable Network Graphics format image.
png,
/// A JPEG format image.
///
class JsonParserIsolate {
final String input;
JsonParserIsolate(this.input);
Future parseJson({Function(String)? onError}) async {
final completer = Completer();
var port = ReceivePort();
var errorPort = ReceivePort();
@rutvik110
rutvik110 / main.dart
Created April 19, 2021 18:23 — forked from rydmike/main.dart
A Flutter long press context menu. Wrap a child with LongPressPopupMenu and it pops up at press location with its PopupMenuItem:s
// BSD 3-Clause License
//
// Copyright (c) 2021, Mike Rydstrom (Rydmike)
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.