Skip to content

Instantly share code, notes, and snippets.

View DidahDx's full-sized avatar
:octocat:

Daniel Didah DidahDx

:octocat:
  • Nairobi, Kenya
View GitHub Profile
@DidahDx
DidahDx / LargeFileSplit.java
Created May 29, 2025 16:47 — forked from keith0591/LargeFileSplit.java
Java code to split a large file by size or by into a specified number of files.
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;
@DidahDx
DidahDx / LongestSubstringKDistinct.java
Created May 22, 2022 12:29 — forked from Schachte/LongestSubstringKDistinct.java
Sliding Window Maximum Sum Subarray
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);
@DidahDx
DidahDx / androidProcessDeath.sh
Last active December 12, 2021 09:15
Process death android shell commands
#!/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
@DidahDx
DidahDx / Customize apk name
Created August 2, 2021 06:40
Customize Android apk names
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
## 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