Commands | Description |
---|---|
git config --list |
Prints all your git configuration settings |
git config --list --show-origin |
Prints all git configuration settings along with file name and path to git configuration files. You would see which configuration is set where? |
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
private static void convertToLocalDateWithDateFormatter() { | |
String strDate = "06/12/2015"; | |
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd/MM/yyyy"); | |
LocalDate date = LocalDate.parse(strDate,formatter); | |
System.out.println(date); | |
} |
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
public static void usingCollectionsSortNoComparator() { | |
List<Integer> input = Arrays.asList(34,12,67,8,91,54,24); | |
Collections.sort(input); | |
System.out.print("Sorted List:"); | |
input.forEach(num -> System.out.print(num+" ")); | |
} |
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
public static void usingCollectionsSortWithComparator() { | |
List<Integer> input = Arrays.asList(34,12,67,8,91,54,24); | |
Collections.sort(input,(num1,num2) -> num2-num1); | |
System.out.print("Sorted List:"); | |
input.forEach(num -> System.out.print(num+" ")); | |
} |
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
public static void usingListSortWithStrings() { | |
List<String> input = Arrays.asList("Horse","Cat","Elephant","Giraffe"); | |
input.sort((str1,str2) -> str1.compareTo(str2)); | |
System.out.print("Sorted List:"); | |
input.forEach(num -> System.out.print(num+" ")); | |
} |
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
public static void usingStreamSort() { | |
List<Integer> input = Arrays.asList(34,12,67,8,91,54,24); | |
Stream<Integer> inputStream = input.stream(); | |
Stream<Integer> sortedStream = inputStream.sorted(); | |
List<Integer> output = sortedStream.collect(Collectors.toList()); | |
System.out.print("Sorted List:"); | |
output.forEach(num -> System.out.print(num+" ")); | |
} |
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
List<Student> input = new ArrayList<Student>(); | |
input.add(new Student("Bill",76)); | |
input.add(new Student("Jane",94)); | |
input.add(new Student("George",68)); | |
input.sort((s1,s2) -> s1.getMarks() - s2.getMarks()); | |
System.out.print("Sorted List:"); | |
input.forEach(s -> System.out.print(s.getName()+" ")); |
Use one of the below listed methods to change your default shell.
You should already have more then one shell installed on your system in order to switch to another shell. Use the below commands to check the installed shells and current default shell on your system:
1. List all Installed Shells : cat /etc/shells
There are number of ways you can install Oh-My-Posh. But commonly you install Oh-My-Posh either from PSGallery by using PowerShell's 'Install-Module' command or with Oh-My-Posh supplied platform-specific install instructions like 'Winget' on their website. Hence you can choose to run any one of the following.
winget install JanDeDobbeleer.OhMyPosh -s winget
My 'Jandedobbeleer Theme' json config for Oh-my-posh on Windows PowerShell
AllUsersAllHosts - C:\Windows\System32\WindowsPowerShell\v1.0\profile.ps1
AllUsersCurrentHost - C:\Windows\System32\WindowsPowerShell\v1.0\Microsoft.PowerShell_profile.ps1