Skip to content

Instantly share code, notes, and snippets.

View maghi711's full-sized avatar

Mahesh J maghi711

  • Bangalore, India
View GitHub Profile
@maghi711
maghi711 / intellijIdeaMacShortcuts.txt
Last active August 5, 2024 07:48
Intellij idea mac shortcuts
SHIFT, CMD and Return for providing a contextual code
CTRL + SPACE provide drop down options
SHIFT + F6 to rename a project
OPTION + CMD + V for extracting a expression to a variable
OPTION + CMD + M for extracting a list of statements to a new method
import java.util.concurrent.CountDownLatch;
public class CountDownLatchForProgramTermination {
public static void main(String[] args) {
CountDownLatch latch = new CountDownLatch(1);
try {
final Worker worker = new Worker(latch);
System.out.println(getThreadName() + "\tWaiting");
worker.work();
@maghi711
maghi711 / grokking_to_leetcode.md
Created July 4, 2023 17:06 — forked from tykurtz/grokking_to_leetcode.md
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

@maghi711
maghi711 / IPRangeChecker.java
Created January 14, 2021 13:51 — forked from madan712/IPRangeChecker.java
Java program to check IP address range. This is a simple java program to check IP address range. Here we provide a IP address to check whether it lies between start and end IP address.
import java.net.InetAddress;
import java.net.UnknownHostException;
public class IPRangeChecker {
public static long ipToLong(InetAddress ip) {
byte[] octets = ip.getAddress();
long result = 0;
for (byte octet : octets) {
result <<= 8;
@maghi711
maghi711 / Free O'Reilly Books.md
Created September 26, 2019 09:52 — forked from augbog/Free O'Reilly Books.md
Free O'Reilly Books

Free O'Reilly books and convenient script to just download them.

Thanks /u/FallenAege/ and /u/ShPavel/ from this Reddit post

How to use:

  1. Take the download.sh file and put it into a directory where you want the files to be saved.
  2. cd into the directory and make sure that it has executable permissions (chmod +x download.sh should do it)
  3. Run ./download.sh and wee there it goes. Also if you do not want all the files, just simply comment the ones you do not want.
@maghi711
maghi711 / interviewitems.MD
Created April 3, 2018 14:35 — forked from KWMalik/interviewitems.MD
My answers to over 100 Google interview questions

##Google Interview Questions: Product Marketing Manager

  • Why do you want to join Google? -- Because I want to create tools for others to learn, for free. I didn't have a lot of money when growing up so I didn't get access to the same books, computers and resources that others had which caused money, I want to help ensure that others can learn on the same playing field regardless of their families wealth status or location.
  • What do you know about Google’s product and technology? -- A lot actually, I am a beta tester for numerous products, I use most of the Google tools such as: Search, Gmaill, Drive, Reader, Calendar, G+, YouTube, Web Master Tools, Keyword tools, Analytics etc.
  • If you are Product Manager for Google’s Adwords, how do you plan to market this?
  • What would you say during an AdWords or AdSense product seminar?
  • Who are Google’s competitors, and how does Google compete with them? -- Google competes on numerous fields: --- Search: Baidu, Bing, Duck Duck Go
@maghi711
maghi711 / HelloWorldSwingStyle
Created July 5, 2017 12:49
How to Write a Hello World in Swing using JDK 1.8
public class HelloWorldSwingStyle {
public static void main( String[] args ) {
JOptionPane.showMessageDialog(null, "Hello World");
}
}