Skip to content

Instantly share code, notes, and snippets.

View hupptechnologies's full-sized avatar
💭
React Native | Angular | VueJS | ReactJS | Flutter

Hupp Technologies hupptechnologies

💭
React Native | Angular | VueJS | ReactJS | Flutter
View GitHub Profile
@hupptechnologies
hupptechnologies / NodeJSClusterUsage.js
Last active July 27, 2023 06:12
Utilizing Node.js Cluster for Maximum CPU Efficiency
const cluster = require('cluster');
const http = require('http');
const numCPUs = require('os').cpus().length;
if (cluster.isMaster) {
// Master process creates worker processes
for (let i = 0; i < numCPUs; i++) {
cluster.fork();
}
@hupptechnologies
hupptechnologies / ImageView.js
Created May 30, 2020 09:52
Pinch to zoom gesture in React Native
import React from "react"
import PropTypes from "prop-types";
import { Animated } from "react-native"
import { PinchGestureHandler, State } from "react-native-gesture-handler"
export default function ImageView(props) {
const scale = new Animated.Value(1)
const onZoomEvent = Animated.event([
{