Skip to content

Commit 3d1eb68

Browse files
Merge branch 'devmalik7:main' into main
2 parents 03cdbb0 + baa5347 commit 3d1eb68

File tree

4,243 files changed

+326367
-86
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

4,243 files changed

+326367
-86
lines changed

.github/workflows/update-index.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Auto Update INDEX.md
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
types: [closed]
9+
branches:
10+
- main
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
20+
- name: Set up Python
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: "3.x"
24+
25+
- name: Run index generator
26+
run: |
27+
python update_index.py
28+
29+
- name: Commit & Push changes
30+
run: |
31+
git config user.name "GitHub Action"
32+
git config user.email "actions@github.com"
33+
git add INDEX.md
34+
git diff --quiet && echo "No changes to commit" || git commit -m "🤖 Auto update INDEX.md"
35+
git push

C/prime_checker/README.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Prime Number Checker
2+
3+
A C program to check if a number is prime or not.
4+
5+
## What it does
6+
7+
Takes a number as input and tells you whether it's prime or not. Pretty straightforward.
8+
9+
## How to compile
10+
11+
```bash
12+
gcc prime_checker.c -o prime_checker -lm
13+
```
14+
15+
The `-lm` flag is needed for the math library.
16+
17+
## Usage
18+
19+
```bash
20+
./prime_checker
21+
```
22+
23+
Then just enter a number when it asks.
24+
25+
## Examples
26+
27+
```
28+
Prime Number Checker
29+
Enter a number: 17
30+
17 is Prime
31+
```
32+
33+
```
34+
Prime Number Checker
35+
Enter a number: 24
36+
24 is Not Prime
37+
```
38+
39+
## How it works
40+
41+
The program checks divisibility up to the square root of the number. If nothing divides it evenly, it's prime. Numbers less than 2 aren't considered prime.
42+
43+
## Test it with these
44+
45+
Some primes to try: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97
46+
47+
Some non-primes: 4, 6, 8, 9, 10, 12, 15, 16, 18, 20, 21, 24, 25, 27, 28, 30
48+

C/prime_checker/prime_checker.c

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#include <stdio.h>
2+
#include <stdbool.h>
3+
#include <math.h>
4+
5+
bool isPrime(int num) {
6+
if (num <= 1) return false;
7+
if (num == 2) return true;
8+
if (num % 2 == 0) return false;
9+
10+
int limit = (int)sqrt(num);
11+
for (int i = 3; i <= limit; i += 2) {
12+
if (num % i == 0) return false;
13+
}
14+
15+
return true;
16+
}
17+
18+
int main() {
19+
int number;
20+
21+
printf("Prime Number Checker\n");
22+
printf("Enter a number: ");
23+
24+
if (scanf("%d", &number) != 1) {
25+
printf("Invalid input!\n");
26+
return 1;
27+
}
28+
29+
if (isPrime(number)) {
30+
printf("%d is Prime\n", number);
31+
} else {
32+
printf("%d is Not Prime\n", number);
33+
}
34+
35+
return 0;
36+
}
37+

INDEX.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# 📘 Code Script Index
2+
A central list of all scripts and mini-projects organized by language.
3+
---
4+
5+
## 📂 Android Studio Script
6+
7+
| Project | Author |
8+
|----------|---------|
9+
| _No projects yet_ | - |
10+
11+
## 📂 C
12+
13+
| Project | Author |
14+
|----------|---------|
15+
| _No projects yet_ | - |
16+
17+
## 📂 Java
18+
19+
| Project | Author |
20+
|----------|---------|
21+
| MotivationalQuote | @unknown |
22+
| RandomPasswordGenerator in java | @unknown |
23+
| Resizerr | @unknown |
24+
| Text summarizer | @unknown |
25+
26+
## 📂 Javascript
27+
28+
| Project | Author |
29+
|----------|---------|
30+
| Bulk Image Resizer | @Dhanush |
31+
| Dice Rolling Simulator | @Kaustubh |
32+
| Random_Joke_Generator | @MichałSzkil |
33+
34+
## 📂 OpenCv
35+
36+
| Project | Author |
37+
|----------|---------|
38+
| _No projects yet_ | - |
39+
40+
## 🐍 Python
41+
42+
| Project | Author |
43+
|----------|---------|
44+
| Currency Convertor | @19-ayushi |
45+
| File_Encrytion_Decryption | @haragam22 |
46+
| ImageResizerCompressor | @ArindamShukla |
47+
| News Headline Scraper | @19-ayushi |
48+
| QRcode_Scanner | @DhanashreePetare |
49+
| Random Motivational Qoute generator | @NehalKhan |
50+
| Screenshot_Capture_Tool | @Ashwil-Colaco |
51+
| Speed test Script | @NehalKhan |
52+
| TextSummarizer | @eleensmathew |
53+
| bulk_ImageResizer | @mukkss |
54+
| duplicate_file_detector | @Ashutosh-agarwal2004 |
55+
| face_detector | @dehobitto |
56+
| password_generator | @harsimran-kaur190 |
57+
| random_joke_generator | @Deepansha |
58+
| screenshot_automation_bot | @BharateshKharvi |
59+
| sign language | @PartyakshSaini |
60+
| youtube_playlist_downloader | @BharateshKharvi |
61+
62+
## 📂 Reactjs
63+
64+
| Project | Author |
65+
|----------|---------|
66+
| _No projects yet_ | - |
67+
68+
## 🎨 WebDev
69+
70+
| Project | Author |
71+
|----------|---------|
72+
| DigitalClock | @Kaustubh |
73+
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
import javax.swing.*;
2+
import javax.swing.border.LineBorder;
3+
4+
import java.awt.*;
5+
6+
public class RandomQuoteGenerator {
7+
8+
private String[] quotes = {
9+
"Life isn’t about getting and having, it’s about giving and being. - Kevin Kruse",
10+
"Whatever the mind of man can conceive and believe, it can achieve. - Napoleon Hill",
11+
"The only way to do great work is to love what you do. - Steve Jobs"
12+
};
13+
14+
public String getRandomQuote() {
15+
int randomIndex = (int) (Math.random() * quotes.length);
16+
return quotes[randomIndex];
17+
}
18+
19+
public static void main(String[] args) {
20+
RandomQuoteGenerator generator = new RandomQuoteGenerator();
21+
22+
// Create JFrame
23+
JFrame frame = new JFrame("Seep");
24+
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
25+
frame.setSize(1920, 1080);
26+
frame.setResizable(false);
27+
frame.setLayout(new BorderLayout());
28+
29+
// Load image
30+
ImageIcon image = new ImageIcon("Seep.png");
31+
JLabel imageLabel = new JLabel(image);
32+
imageLabel.setHorizontalAlignment(JLabel.CENTER);
33+
imageLabel.setVerticalAlignment(JLabel.CENTER);
34+
imageLabel.setLayout(new BorderLayout()); // enable overlay of quote
35+
36+
// Quote label (white text on black background)
37+
JLabel quoteLabel = new JLabel(generator.getRandomQuote(), SwingConstants.CENTER);
38+
quoteLabel.setFont(new Font("Arial", Font.BOLD, 16));
39+
quoteLabel.setForeground(Color.WHITE);
40+
quoteLabel.setBackground(Color.BLACK);
41+
quoteLabel.setOpaque(true);
42+
quoteLabel.setHorizontalAlignment(SwingConstants.CENTER);
43+
quoteLabel.setVerticalAlignment(SwingConstants.CENTER);
44+
45+
// Overlay quote on image
46+
imageLabel.add(quoteLabel, BorderLayout.CENTER);
47+
48+
// Create top panel for two buttons
49+
JPanel topPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 10, 10));
50+
topPanel.setOpaque(true);
51+
topPanel.setBackground(Color.BLACK); // transparent so image shows behind
52+
53+
JButton button1 = new JButton("Fetch Quote from API");
54+
button1.setFont(new Font("Arial", Font.PLAIN, 16));
55+
button1.setBackground(new Color(30, 30, 30));
56+
button1.setForeground(Color.WHITE);
57+
button1.setFocusPainted(false);
58+
59+
JButton fullscreenbutton = new JButton("Fullscreen");
60+
fullscreenbutton.setFont(new Font("Arial", Font.PLAIN, 16));
61+
fullscreenbutton.setBackground(new Color(30, 30, 30));
62+
fullscreenbutton.setForeground(Color.WHITE);
63+
fullscreenbutton.setFocusPainted(false);
64+
65+
GraphicsDevice device = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
66+
67+
boolean[] isFullScreen = {false}; // use array to allow modification in lambda
68+
69+
fullscreenbutton.addActionListener(e -> {
70+
if (!isFullScreen[0]) {
71+
frame.dispose();
72+
frame.setUndecorated(true);
73+
device.setFullScreenWindow(frame);
74+
frame.setVisible(true);
75+
isFullScreen[0] = true;
76+
} else {
77+
device.setFullScreenWindow(null);
78+
frame.dispose();
79+
frame.setUndecorated(false);
80+
frame.setExtendedState(JFrame.NORMAL);
81+
frame.setSize(1920, 1080);
82+
frame.setVisible(true);
83+
isFullScreen[0] = false;
84+
}
85+
});
86+
87+
88+
topPanel.add(button1);
89+
topPanel.add(fullscreenbutton);
90+
91+
// Create bottom "New Quote" button
92+
JButton newQuoteButton = new JButton("New Quote");
93+
newQuoteButton.setFont(new Font("Arial", Font.PLAIN, 18));
94+
newQuoteButton.setFocusPainted(false);
95+
newQuoteButton.setBackground(new Color(30, 30, 30)); // dark gray
96+
newQuoteButton.setForeground(Color.WHITE);
97+
newQuoteButton.setBorder(BorderFactory.createEmptyBorder(10, 20, 10, 20));
98+
newQuoteButton.setPreferredSize(new Dimension(200, 60));
99+
newQuoteButton.addActionListener(e -> quoteLabel.setText(generator.getRandomQuote()));
100+
101+
// Main panel to hold image + bottom button
102+
JPanel mainPanel = new JPanel(new BorderLayout());
103+
mainPanel.add(imageLabel, BorderLayout.CENTER);
104+
mainPanel.add(newQuoteButton, BorderLayout.SOUTH);
105+
106+
// Add panels to frame
107+
frame.add(topPanel, BorderLayout.NORTH);
108+
frame.add(mainPanel, BorderLayout.CENTER);
109+
110+
// Show window
111+
frame.setVisible(true);
112+
113+
// Auto-update quote every 5 seconds
114+
new Timer(5000, e -> quoteLabel.setText(generator.getRandomQuote())).start();
115+
// Make button1 disappear after 5 seconds
116+
Timer hideTimer = new Timer(5000, e -> button1.setVisible(false));
117+
hideTimer.setRepeats(false); // only hide once
118+
hideTimer.start();
119+
120+
// Make button1 visible again when the mouse moves
121+
frame.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
122+
@Override
123+
public void mouseMoved(java.awt.event.MouseEvent e) {
124+
button1.setVisible(true);
125+
// Restart the hide timer
126+
hideTimer.restart();
127+
}
128+
});
129+
130+
Timer hideTimer2 = new Timer(5000, e -> fullscreenbutton.setVisible(false));
131+
hideTimer2.setRepeats(false); // only hide once
132+
hideTimer2.start();
133+
134+
frame.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
135+
@Override
136+
public void mouseMoved(java.awt.event.MouseEvent e) {
137+
fullscreenbutton.setVisible(true);
138+
// Restart the hide timer
139+
hideTimer2.restart();
140+
}
141+
});
142+
143+
144+
}
145+
}
File renamed without changes.
File renamed without changes.

Java/Java/RandomPasswordGenerator in java/RandomPasswordGenerator.java renamed to Java /RandomPasswordGenerator in java/RandomPasswordGenerator.java

File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)