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
// COPYRIGHT 2020 MIT Open Source - Anthony Dreessen | |
// This file is basically a slightly modified StackOverflow answer | |
// and should be owned by nobody- honestly it should be a part of React itself | |
// full license at the bottom | |
import { useEffect, useMemo, useRef } from "react"; | |
export const usePrevious = (value: any, initialValue: any) => { | |
const ref = useRef(initialValue); | |
useEffect(() => { |
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
Hello! | |
Found chip PN532 | |
Firmware ver. 1.6 | |
Waiting for an ISO14443A Card ... | |
Found an ISO14443A card | |
UID Length: 7 bytes | |
UID Value: 0x04 0xE5 0xDA 0x01 0x40 0x3A 0x03 | |
Seems to be an NTAG2xx tag (7 byte UID) | |
PAGE 00: 04 E5 DA B3 .⸮ڳ |
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 from "react" | |
import { View, Text } from "react-native" | |
import { ActivityIndicator } from "react-native-paper" | |
import Theme from "src/lib/Theme" | |
interface Props { | |
loading: boolean | |
} | |
export const LoadingScreen: React.FC<Props> = (props) => { |
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 moment from "moment" | |
import React, { useEffect, useState } from "react" | |
import { AppState } from "react-native" | |
import CodePush from "react-native-code-push" | |
import ContextStack from "src/app/ContextStack" | |
import { ErrorBoundary } from "src/app/ErrorBoundary" | |
import RootNavigator from "src/app/RootNavigator" | |
import { LoadingScreen } from "src/shared/LoadingScreen" | |
const MIN_BACKGROUND_DURATION_IN_MIN = 30 |
This file has been truncated, but you can view the full file.
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
-- Logs begin at Sun 2021-01-17 22:10:27 UTC, end at Wed 2021-02-10 01:59:10 UTC. -- | |
Jan 17 22:10:27 ubuntu-s-1vcpu-1gb-lon1-01 java[17293]: 2021-01-17 22:10:27.643 ERROR 17293 --- [o-8080-exec-178] c.p.c.ExceptionHandlerController : Uncaught exception... | |
Jan 17 22:10:27 ubuntu-s-1vcpu-1gb-lon1-01 java[17293]: java.lang.NullPointerException: null | |
Jan 17 22:44:22 ubuntu-s-1vcpu-1gb-lon1-01 java[17293]: 2021-01-17 22:44:22.541 ERROR 17293 --- [o-8080-exec-183] c.p.c.ExceptionHandlerController : Uncaught exception... | |
Jan 17 22:44:22 ubuntu-s-1vcpu-1gb-lon1-01 java[17293]: java.lang.NullPointerException: null | |
Jan 18 00:59:08 ubuntu-s-1vcpu-1gb-lon1-01 java[17293]: 2021-01-18 00:59:08.409 ERROR 17293 --- [o-8080-exec-184] c.p.c.ExceptionHandlerController : Uncaught exception... | |
Jan 18 00:59:08 ubuntu-s-1vcpu-1gb-lon1-01 java[17293]: java.lang.NullPointerException: null | |
Jan 18 01:29:56 ubuntu-s-1vcpu-1gb-lon1-01 java[17293]: 2021-01-18 01:29:56.483 ERROR 17293 --- [o-8080-exec-182] c.p.c.Exc |
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
spring.datasource.url=jdbc:postgresql://dbname.db.elephantsql.com:5432/db_user_name | |
spring.datasource.username=db_user_name | |
spring.datasource.password=password |
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
./gradlew bootJar | |
scp build/libs/myapp.jar username@ip_address: | |
ssh -t username@ip_address 'sudo /bin/systemctl restart myapp' |
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
# Here, spring.jpa.hibernate.ddl-auto can be none, update, create, create-drop, refer to the Hibernate documentation for details | |
# https://spring.io/guides/gs/accessing-data-mysql/ | |
spring.jpa.hibernate.ddl-auto=none | |
# Connection details | |
spring.datasource.url=jdbc:postgresql://localhost:5432/db_name | |
spring.datasource.username=username | |
spring.datasource.password=password |
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
plugins { | |
//... | |
id "org.flywaydb.flyway" version "6.3.1" | |
} | |
dependencies { | |
//... | |
implementation 'org.springframework.boot:spring-boot-starter-data-jpa' | |
implementation 'org.flywaydb:flyway-core' | |
runtimeOnly 'org.postgresql:postgresql' |
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
[Unit] | |
Description=My Java Application | |
After=syslog.target | |
[Service] | |
Environment="MY_DATABASE_PASSWORD=<database_password>" | |
User=<droplet_username> | |
ExecStart=/usr/bin/java -Xmx256m -Dspring.profiles.active=<profile> -jar /home/<droplet_username>/myapp.jar | |
SuccessExitStatus=143 |
NewerOlder