Skip to content

Instantly share code, notes, and snippets.

View zhenguet's full-sized avatar
🧐
hmmm...

Zheng UET zhenguet

🧐
hmmm...
  • HaiPhong, VietNam
View GitHub Profile
# Resolve react_native_pods.rb with node to allow for hoisting
require Pod::Executable.execute_command('node', ['-p',
'require.resolve(
"react-native/scripts/react_native_pods.rb",
{paths: [process.argv[1]]},
)', __dir__]).strip
platform :ios, 13.4
prepare_react_native_project!
@zhenguet
zhenguet / android\src\main\java\com\rnmaps\maps\MapModule.java
Last active September 26, 2023 10:32
add isMarkerWithinScreen to react-native-maps@1.7.1
package com.rnmaps.maps;
import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.Point;
import android.location.Address;
import android.location.Geocoder;
import android.net.Uri;
import android.util.Base64;
import android.util.DisplayMetrics;
@zhenguet
zhenguet / BarcodeMask.tsx
Created August 3, 2023 08:44 — forked from nartc/BarcodeMask.tsx
ReactNative Camera Barcode Mask (from react-native-barcode-mask) rewritten using Hooks and Reanimated
import React, { FC, memo } from 'react';
import { LayoutChangeEvent, StyleSheet, View, ViewStyle } from 'react-native';
import Animated, { Easing } from 'react-native-reanimated';
const { Value, Clock, block, cond, set, startClock, timing, eq } = Animated;
type DimensionUnit = string | number;
type EdgePosition = 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight';
interface Props {
@zhenguet
zhenguet / NumInWords.tsx
Last active December 20, 2022 08:48
Code js/ts convert number to word (VietNamese)
// more info https://stackoverflow.com/a/30524915/14745811
const arr = x => Array.from(x);
const num = x => Number(x) || 0;
const str = x => String(x);
const isEmpty = xs => xs.length === 0;
const take = n => xs => xs.slice(0, n);
const drop = n => xs => xs.slice(n);
const reverse = xs => xs.slice(0).reverse();
const comp = f => g => x => f(g(x));
@zhenguet
zhenguet / data.js
Last active February 22, 2022 01:28
Journey
export const Cartrip = [
{
TripInfoID: 33798,
driver: "347722874183",
CarID: 646,
Speed: 4.0,
Lt: 20.800825,
Ln: 106.903534,
Oil: 427,
Acc: "Bật",