Skip to content

Instantly share code, notes, and snippets.

View KingKongCoderr's full-sized avatar

nandeesh KingKongCoderr

View GitHub Profile
@tykurtz
tykurtz / grokking_to_leetcode.md
Last active November 3, 2025 19:16
Grokking the coding interview equivalent leetcode problems

GROKKING NOTES

I liked the way Grokking the coding interview organized problems into learnable patterns. However, the course is expensive and the majority of the time the problems are copy-pasted from leetcode. As the explanations on leetcode are usually just as good, the course really boils down to being a glorified curated list of leetcode problems.

So below I made a list of leetcode problems that are as close to grokking problems as possible.

Pattern: Sliding Window

# -*- coding: utf-8 -*-
""" Deletes all tweets below a certain retweet threshold.
"""
import tweepy
from datetime import datetime
# Constants
CONSUMER_KEY = ''
@manuelvicnt
manuelvicnt / AnAndroidApp.kt
Last active January 1, 2023 17:05
Hilt and AssistedInject working together in Hilt v2.28-alpha times - ViewModel version
// IMPORTANT! READ THIS FIRST
// Assisted Injection doesn't work with @HiltViewModel or @ViewModelInject
// Read more about the issue here: https://github.com/google/dagger/issues/2287
//
//
// AssistedInject and Hilt working together in v2.28-alpha times
// Example of a ViewModel using AssistedInject injected in a Fragment by Hilt
// As AssistedInject isn't part of Dagger yet, we cannot use in
// conjuction with @ViewModelInject
@stleamist
stleamist / PageView.swift
Created May 19, 2020 11:08
A representation of UIPageViewController in SwiftUI.
import SwiftUI
struct PageView<Page: View>: UIViewControllerRepresentable {
var pages: [Page]
@Binding var currentPage: Int
func makeUIViewController(context: Context) -> UIPageViewController {
let pageViewController = UIPageViewController(transitionStyle: .scroll, navigationOrientation: .horizontal)
@shekibobo
shekibobo / loadProperties.gradle
Created April 22, 2019 15:18
Load properties from a given file within the project.
def propertiesFrom(filename) {
def properties = new Properties()
def file = rootProject.file(filename)
if (file.exists()) {
properties.load(new FileInputStream(file))
} else {
System.out.println("[WARNING] Properties file ${filename} not found. Returning empty properties.")
}
return properties
}
@shekibobo
shekibobo / ViewGroupExt.kt
Last active April 22, 2019 15:14
Fill a ViewGroup with items using a given layout. Easy to replace, reuses child views if possible.
/**
Copyright 2019 Joshua Kovach
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@aboodmufti
aboodmufti / TabViewController.swift
Last active January 25, 2024 11:35
How to customize iOS tab icon colors (2 ways)
override func viewDidLoad() {
super.viewDidLoad()
//change text under icon
UITabBarItem.appearance().setTitleTextAttributes([NSForegroundColorAttributeName: UIColor.init(netHex: 0x000000)], forState: .Normal)
UITabBarItem.appearance().setTitleTextAttributes([NSForegroundColorAttributeName: UIColor.init(netHex: 0xffffff)], forState: .Selected)
//store every image in a variable
let homeUnselectedImage: UIImage = UIImage(named: "home_grey")!.imageWithRenderingMode(UIImageRenderingMode.AlwaysOriginal)
let homeSelectedImage: UIImage = UIImage(named: "home_white")!.imageWithRenderingMode(UIImageRenderingMode.AlwaysOriginal)
@inancsevinc
inancsevinc / TestRSA.java
Created July 10, 2012 09:30
Junit for RSA encryption/decryption
import static org.junit.Assert.*;
import java.math.BigInteger;
import java.security.Key;
import java.security.KeyFactory;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.PrivateKey;
import java.security.PublicKey;
import java.security.spec.RSAPrivateKeySpec;