This file contains hidden or 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
| # Get editor completions based on the config schema | |
| "$schema" = 'https://starship.rs/config-schema.json' | |
| format = """ | |
| $username\ | |
| $hostname\ | |
| $localip\ | |
| $shlvl\ | |
| $singularity\ | |
| $kubernetes\ |
This file contains hidden or 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
| function useDebounced(value, timeout) { | |
| let [debouncedValue, setDebouncedValue] = useState(value) | |
| useEffect(() => { | |
| let timeoutId = setTimeout(() => { | |
| setDebouncedValue(value) | |
| }, timeout) | |
| return () => { | |
| clearTimeout(timeoutId) |
This file contains hidden or 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
| private LocalDateTime getLocalZonedDateTime() { | |
| Instant instant = Instant.now(); | |
| ZonedDateTime zonedDateTime = instant.atZone(ZoneId.of(ZoneId.SHORT_IDS.get("ECT"))); | |
| return zonedDateTime.toLocalDateTime(); | |
| } | |
| private LocalDateTime getCurrentUTCDateTime() { | |
| return OffsetDateTime.now(ZoneOffset.UTC).toLocalDateTime(); | |
| } |
This file contains hidden or 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 java.util.stream.Stream; | |
| class StreamOddNumberUnder100 { | |
| public static void main(String[] args) { | |
| Stream<Integer> oddNumberUnder100 = | |
| Stream.iterate(1, | |
| i -> i < 100, | |
| i -> i+2 |
This file contains hidden or 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 java.time.LocalDateTime; | |
| import java.time.ZoneId; | |
| import java.time.ZoneOffset; | |
| import java.time.ZonedDateTime; | |
| public class DateTimeConvertTest { | |
| public static void main(String[] args) { |