Skip to content

Instantly share code, notes, and snippets.

View LuffyAnshul's full-sized avatar

ANSHUL VARSHAV BORAWAKE LuffyAnshul

View GitHub Profile
import { TestIds, RewardedAd, RewardedAdEventType } from '@react-native-firebase/admob';
....
showRewardAd = () => {
// Create a new instance
const rewardAd = RewardedAd.createForAdRequest(TestIds.REWARDED);
// Add event handlers
rewardAd.onAdEvent((type, error) => {
@LuffyAnshul
LuffyAnshul / Admob_App.js
Last active June 6, 2021 05:21
Interstitial ADs
import { InterstitialAd, TestIds, AdEventType} from '@react-native-firebase/admob';
...
showInterstitialAd = () => {
// Create a new instance
const interstitialAd = InterstitialAd.createForAdRequest(TestIds.INTERSTITIAL);
// Add event handlers
interstitialAd.onAdEvent((type, error) => {
<SignatureCapture
style={styles.signature}
ref={sign}
onSaveEvent={_onSaveEvent}
onDragEvent={_onDragEvent}
showNativeButtons={false}
showTitleLabel={false}
viewMode={'portrait'}
/>
<View style={{flexDirection: 'row'}}>
const sign = createRef();
const saveSign = () => {
sign.current.saveImage();
};
const resetSign = () => {
sign.current.resetImage();
};
const _onSaveEvent = (result) => {
//result.encoded - for the base64 encoded png
//result.pathName - for the file path name
alert('Signature Captured Successfully');
console.log(result.encoded);
};
const _onDragEvent = () => {
// This callback will be called when the user enters signature
console.log('dragged');
@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/
@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 / 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 / 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 / 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]}