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);
## 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