This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, {Component} from 'react' | |
import { | |
Dimensions, | |
TextInput, | |
Animated, | |
Keyboard, | |
Platform, | |
KeyboardAvoidingView, | |
StyleSheet | |
} from 'react-native'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try { | |
//Time formatter input | |
String dataTime = "2018-01-18 11:59:59"; | |
String dateTimePattern = "yyyy-MM-dd HH:mm:ss"; | |
ZoneId zoneUTC = ZoneId.of("Z"); | |
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern(dateTimePattern).withZone(zoneUTC); | |
//Get default zone and zone rules | |
ZoneId zoneCurrent = ZoneId.systemDefault(); | |
ZoneRules rules = zoneCurrent.getRules(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try { | |
//Time formatter input | |
String dataTime = "2018-07-18 11:59:59"; | |
String dateTimePattern = "yyyy-MM-dd HH:mm:ss"; | |
ZoneId zoneUTC = ZoneId.of("Z"); | |
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern(dateTimePattern).withZone(zoneUTC); | |
ZonedDateTime zonedDateTime = ZonedDateTime.parse(dataTime, dateTimeFormatter); | |
//Convert UTC Time to Local time | |
zonedDateTime = zonedDateTime.toOffsetDateTime().atZoneSameInstant(ZoneId.systemDefault()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try { | |
ZonedDateTime localTime = ZonedDateTime.now(ZoneId.systemDefault()); | |
// Convert Local Time to UTC | |
OffsetDateTime utcTime = localTime.toOffsetDateTime().withOffsetSameInstant(ZoneOffset.UTC); | |
System.out.println("Local:" + localTime); | |
System.out.println("--> UTCTime:" + utcTime); | |
} catch (Exception e) { | |
e.printStackTrace(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rm -rf $TMPDIR/react-* && rm -rf $TMPDIR/metro-* && rm -rf $TMPDIR/haste-* && watchman watch-del-all && npm cache clean --force && npm cache verify && rm -rf ios/build && rm -rf node_modules/ && npm i |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { StyleSheet } from 'react-native' | |
export default StyleSheet.create({ | |
container: { | |
flexDirection: 'row', | |
flex: 1, | |
alignItems: 'center', | |
justifyContent: 'center', | |
}, | |
center: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"BUILD_ENVIRONMENT":"staging", | |
"NEED_RESET_CACHE":false | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var address, ifaces = require('os').networkInterfaces() | |
for (var dev in ifaces) { | |
ifaces[dev].filter((details) => details.family === 'IPv4' && details.internal === false ? address = details.address : undefined) | |
if(address) break | |
} | |
console.log(address) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
const fs = require('fs') | |
const path = require('path') | |
var currDir = path.dirname(fs.realpathSync(__filename)) | |
var env = process.env.NODE_ENV | |
const fileExists = filePath => { | |
try { | |
return fs.statSync(filePath).isFile() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
const fs = require('fs') | |
try { | |
console.log('Fix Start') | |
var rootDir = process.cwd() | |
// @nhancv: Preparing path | |
var androidSettingGradleFile = `${rootDir}/android/settings.gradle` | |
var androidSettingGradleFileData = fs.readFileSync(androidSettingGradleFile, 'utf8') |