Skip to content

Instantly share code, notes, and snippets.

View 1UC1F3R616's full-sized avatar
:shipit:
Attention is All You Need

Kush Choudhary 1UC1F3R616

:shipit:
Attention is All You Need
View GitHub Profile
```
Category: Energy Efficiency Practices
Energy Efficient Cooler
Carbon Savings: Using an energy-efficient cooler can save around 0.2 kg of CO₂ per hour of operation compared to a standard cooler.
Reduce Electricity Usage
Carbon Savings: Reducing electricity usage by 1 kWh can save approximately 0.5 kg of CO₂.
EV Vehicle Adoption
Carbon Savings: Switching from a conventional car to an electric vehicle (EV) can save around 2.5 kg of CO₂ per liter of gasoline avoided.
Solar Panel Installation
Carbon Savings: Installing solar panels can save about 0.7 kg of CO₂ per kWh of electricity generated from solar energy.
@1UC1F3R616
1UC1F3R616 / java.md
Last active June 22, 2024 21:34
A Guide to Java: Crystal Clear Level M (K>L>M) | Not for Learning from Beginning | Maintaining some concepts only

Classpath

  • Think of the classpath as a roadmap that tells the Java Virtual Machine (JVM) where to look for the .class files (compiled Java code) and libraries (.jar files) that your program needs to run. It's essentially a list of directories and files that the JVM searches through to find the classes and resources your code references.
  • How is it Set?
    • Environment Variable: You can set the CLASSPATH environment variable to list the directories and JAR files you want to include.
    • Command Line: When running a Java program (java command), you can use the -cp or -classpath option to specify the classpath directly.
    • Manifest Files: JAR files can contain a manifest file that specifies the classpath for the classes inside the JAR.
    • Build Tools: Build tools like Maven or Gradle automatically manage the classpath for your project, making it easier to build and run your code.

java -cp /path/to/my/project:/path/to/library.jar MyMainClass This command tells the JVM to look for classes in /path/to/m

@1UC1F3R616
1UC1F3R616 / spring-boot.md
Last active June 14, 2024 18:37
A Guide to Spring Boot: Crystal Clear Level K (K>L>M) | For native Java concepts refer java.md

Understanding Origins

  • First came servlet then came Spring then came Spring Boot.
  • Java Servlets are Java programs that run on a web server. They handle http requests but are very basic in nature.
  • Spring uses Servlet under the hood but much more mature, a framework. Still it needs a server setup like tomcat. It had DI, AOP, Web MVC etc. Spring is more then just web, u can make a CLI with it.
  • Spring Boot has it's embedded server as well and much more. It's "convention over configuration" approach and eliminate a lot of boilerplate code and configuration. It has autoconfiguration (It automatically configures many common components based on your project dependencies) and starter dependencies (pre-packaged dependencies that quickly add functionalities like web, data, security, etc) and Actuator.
  • Servlets provided the foundation for Java web development.
  • Spring Framework added powerful features and tools for building enterprise applications.
  • Spring Boot simplified Spring development
@1UC1F3R616
1UC1F3R616 / K8.md
Created May 15, 2024 11:48
Kuberenetes
Resource Type Purpose Minimal YAML Example
Pod The smallest and simplest Kubernetes object. Represents a single instance of a running process in a cluster. yaml<br>apiVersion: v1<br>kind: Pod<br>metadata:<br> name: my-pod<br>spec:<br> containers:<br> - name: my-container<br> image: nginx<br>
Deployment Provides declarative updates for Pods and ReplicaSets. ```yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-deployment
spec:
replicas: 3
selector:
matchLabels:
app: myapp
template:
met
Component Functionality Where Used Examples
API Gateway Manages all client requests, provides a single point of entry, handles routing, authentication, rate-limiting, and API metering. The first point of entry between users and backend services. Kong, Amazon API Gateway, Apigee
Load Balancer Distributes incoming network traffic across multiple servers to ensure no single server bears too much demand. In front of server clusters to distr
@1UC1F3R616
1UC1F3R616 / I DON'T LIKE DSA.md
Last active April 13, 2024 06:55
I DON'T LIKE DSA NOT ANYMORE - From being a DSA kid in first year of college to no DSA plz I grew up just like that. I have many DSA cheatsheets, hoping this remains last.

Four Sections - Move to 4th, then do 1st and 2nd and 3rd.

Frequently asked DS

Data Structure Operations Time Complexity Frequently Asked Algorithms Popularity (out of 5)
Arrays Access: O(1), Search: O(n), Insertion/Deletion (end): O(1), Insertion/Deletion (start/middle): O(n) Sorting, Searching, Two Pointer Technique 5
Strings Access: O(1), Search: O(n) Substring Search, Palindromes, String Manipulation 4
Linked Lists Search: O(n), Insertion/Deletion: O(1) at known position Reversal, Cycle Detection, Merge Sort
@1UC1F3R616
1UC1F3R616 / go_cheat_sheet.md
Last active April 13, 2024 19:37
Yet Another Go Cheat Sheet
Framework/Library Description Use Cases ORM Support Popularity (out of 5)
net/http Part of the Go standard library, provides HTTP client and server implementations. Building HTTP servers with minimal dependencies. No (Use standalone ORMs like GORM, SQLBoiler, or Ent) 5
Gin A HTTP web framework that features a Martini-like API but with better performance. Rapid development of RE
@1UC1F3R616
1UC1F3R616 / django.md
Last active April 2, 2024 10:39
Yet another cheat sheet
from django.db.models import Model, DateTimeField, CharField

class BlogPost(Model):
    title = CharField(max_length=100)
    content = CharField(max_length=1000)
    created_at = DateTimeField(auto_now_add=True)

class Comment(Model):
    comment_text = CharField(max_length=500)

Behavioural Subject

import { Injectable } from '@angular/core';
import { BehaviorSubject } from 'rxjs';

@Injectable({
  providedIn: 'root'
})
export class ThemeService {
@1UC1F3R616
1UC1F3R616 / LK89NP7.txt
Created January 3, 2024 20:35
What is LK89NP7
What is LK89NP7?
LK89NP7 is an embed by 1UC1F3R616 (visit github.com/1UC1F3R616) for more.
More on LK89NP7: This embed is by Kushal Choudhary.