Skip to content

Instantly share code, notes, and snippets.

View LuffyAnshul's full-sized avatar

ANSHUL VARSHAV BORAWAKE LuffyAnshul

View GitHub Profile
@LuffyAnshul
LuffyAnshul / CivilAppSplashScreen
Last active February 5, 2021 07:51
Civil App Splash Screen
import React, {useState, useEffect} from 'react';
import {
ActivityIndicator,
View,
StyleSheet,
Image
} from 'react-native';
import AsyncStorage from '@react-native-async-storage/async-storage';
@LuffyAnshul
LuffyAnshul / AddSubCategoryScreen
Last active April 1, 2021 14:18
Civil App Add Sub- Category
import React from 'react';
import { View, Text, StyleSheet, SafeAreaView, TouchableOpacity } from 'react-native';
import { TextInput } from 'react-native-paper';
import SearchableDropdown from 'react-native-searchable-dropdown';
import { openDatabase } from 'react-native-sqlite-storage';
const db = openDatabase({ name: 'SQLite.db', location: 'default', createFromLocation: '~SQLite.db' });
export default class AddCategoryScreen extends React.Component {
@LuffyAnshul
LuffyAnshul / CivilAppViewSub-CategoryScreen
Created April 1, 2021 14:38
Civil App View Sub-Categories
import React from 'react';
import { View, LogBox, Text, StyleSheet, SafeAreaView, FlatList, RefreshControl, TouchableOpacity } from 'react-native';
import { Chip } from 'react-native-paper';
import { openDatabase } from 'react-native-sqlite-storage';
import renderSubCategory from '../components/renderSubCategory';
const db = openDatabase({ name: 'SQLite.db', location: 'default', createFromLocation: '~SQLite.db' });
// Disable FlatList Render Warning for categories display
@LuffyAnshul
LuffyAnshul / SQLQuery
Created April 1, 2021 14:41
SQLQuery
ExecuteQuery = (sql, params = []) => new Promise((resolve, reject) => {
db.transaction((trans) => {
trans.executeSql(sql, params, (trans, results) => {
resolve(results);
},
(error) => {
reject(error);
});
});
});
@LuffyAnshul
LuffyAnshul / WildFireTrackerApp
Created April 1, 2021 17:13
WildFire Tracker App JS File
function App() {
const [eventData, setEventData] = useState([]);
const [loading, setLoading] = useState(false);
useEffect(() => {
const fetchEvents = async() => {
setLoading(true);
const res = await fetch('https://eonet.sci.gsfc.nasa.gov/api/v2.1/events');
const { events } = await res.json();
@LuffyAnshul
LuffyAnshul / WildFireTrackerMap
Created April 1, 2021 17:17
WildFire Tracker Map JS File
const API_KEY = 'YOUR_API_KEY';
const Map = ({ eventData, center, zoom }) => {
const [locationInfo, setLocationInfo] = useState(null);
const markers = eventData.map(ev => {
if(ev.categories[0].id === 8) {
return <LocationMarker
lat={ev.geometries[0].coordinates[1]}
@LuffyAnshul
LuffyAnshul / WildFireTrackerLocationMarker
Created April 1, 2021 17:24
WildFire Tracker Location Marker JS
import { Icon } from '@iconify/react';
import locationIcon from '@iconify/icons-mdi/fire-alert';
const LocationMarker = ({ lat, lng, onClick }) => {
return (
<div className="location-marker" onClick={onClick}>
<Icon icon={locationIcon} className="location-icon" />
</div>
)
}
@LuffyAnshul
LuffyAnshul / buildGradleKeyStore
Created April 2, 2021 10:22
build Gradle Key Store
android {
....
signingConfigs {
release {
storeFile file('your_key_name.keystore')
storePassword 'your_key_store_password'
keyAlias 'your_key_alias'
keyPassword 'your_key_file_alias_password'
}
}
@LuffyAnshul
LuffyAnshul / buildGradleKeyStoreSecure
Last active December 10, 2022 06:38
build Gradle Key Store Secure
signingConfigs {
release {
storeFile file('your_key_name.keystore')
storePassword System.console().readLine("\nKeystore password:")
keyAlias System.console().readLine("\nAlias: ")
keyPassword System.console().readLine("\nAlias password: ")
}
}
@LuffyAnshul
LuffyAnshul / releaseConfigCommand
Created April 2, 2021 10:24
Release Configuration Command
react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle
--assets-dest android/app/src/main/res/