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 org.apache.commons.io.IOUtils; | |
| import java.io.File; | |
| import java.io.FileOutputStream; | |
| import java.io.IOException; | |
| import java.io.InputStream; | |
| import java.nio.file.Files; | |
| import java.util.ArrayList; | |
| import java.util.List; |
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.*; | |
| class LongestSubstringKDistinct { | |
| public static int findLength(String str, int k) { | |
| int windowStart = 0, maxLength = 0; | |
| Map<Character, Integer> charFrequencyMap = new HashMap<>(); | |
| for (int windowEnd = 0; windowEnd < str.length(); windowEnd++) { | |
| char rightChar = str.charAt(windowEnd); | |
| charFrequencyMap.put(rightChar, charFrequencyMap.getOrDefault(rightChar, 0) + 1); |
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
| #!/bin/bash | |
| # You should have adb installed in your machine | |
| adb shell | |
| ps -A # show all process details | |
| ps -A | grep com.example.app # show the App(com.example.app) process details | |
| am kill com.example.app # used to kill the process | |
| # https://www.youtube.com/watch?v=l4uD0swZVsM&t=316s |
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
| android{ | |
| // Customize your APK name here | |
| applicationVariants.all { variant -> | |
| def appName | |
| //Check if an applicationName property is supplied; if not use the name of the parent project. | |
| if (project.hasProperty("applicationName")) { | |
| appName = applicationName | |
| } else { | |
| appName = parent.name |
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
| ## How to hide API keys from github ## | |
| 1. If you have already pushed commits with sensitive data, follow this guide to remove the sensitive info while | |
| retaining your commits: https://help.github.com/articles/remove-sensitive-data/ | |
| 2. In the terminal, create a config.js file and open it up: | |
| touch config.js | |
| atom config.js |