Skip to content

Instantly share code, notes, and snippets.

View arunpt's full-sized avatar
☢️
Active

W4RR10R arunpt

☢️
Active
View GitHub Profile
@arunpt
arunpt / scan.ino
Created September 23, 2024 07:05
ESP 8266 i2c Scanner
// https://gist.github.com/walidamriou/1e759043d66340f9c76c7d13b6abf55e
#include <Arduino.h>
#include <Wire.h>
void setup()
{
Wire.begin();
Serial.begin(9600);
while (!Serial);
@arunpt
arunpt / hum_and_temp.ino
Last active August 29, 2024 16:17
esp32 + DHT11 and I2C OLED
// https://github.com/adafruit/Adafruit_SH110x
// https://github.com/adafruit/Adafruit-GFX-Library
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SH110X.h>
#include "DHT.h"
#define i2c_Address 0x3c
# Telegram auto file forwarding using pyrogram
# pip3 install pyrogram
from pyrogram import Client, filters
FROM = [-10012345, -10012345]
TO = -100133
PYRO_SESSION = ""
API_ID = 1234
API_HASH = "abcd1234edfghijkl"
const axios = require('axios');
const cheerio = require('cheerio');
const Asena = require('../events');
const {MessageType} = require('@adiwajshing/baileys');
Asena.addCommand({pattern: 'covid', fromMe: false}, (async (message, match) => {
const url = 'https://dashboard.kerala.gov.in/';
axios(url).then(async (response) => {
let html = response.data;
@arunpt
arunpt / kick.py
Created September 29, 2020 15:25
Kick deleted accounts from a group (pyrogram)
count = 0
async for member in client.iter_chat_members("cwpsupport"):
if member.user.is_deleted:
await client.kick_chat_member("cwpsupport", member.user.id)
count = count + 1
print(f"Kicked {count} deleted accounts")
import requests
session = requests.Session()
headers = {
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.80 Safari/537.36",
}
prog_hash = "0876c3e0ffeb11ea93fe33a0b5128807"
api_url = f"https://prod.media.jio.com/apis/common/v3/metamore/get/" + prog_hash
response = session.get(api_url, headers=headers, cookies=session.cookies)
data = response.json()
print(data)
1 - CREATE TABLE Employee (E_id INT NOT NULL, Ename VARCHAR(20) NOT NULL, job VARCHAR(20) NOT NULL, designation VARCHAR(30) NOT NULL, salary INT NOT NULL, joining_date VARCHAR(15) NOT NULL);
INSERT INTO Employee (E_id, Ename, job, designation, salary, joining_date ) VALUES (1, "Arun 1", "Job name 1", "des 1", 40000, "17-09-2020"),
(2, "Arun 2", "Job name 2", "des 2", 30000, "10-09-2020"),
(3, "Arun 3", "Job name 3", "des 3", 40000, "06-08-2020"),
(4, "Arun 4", "Job name 4", "des 4", 25000, "1-03-2020");
2 - SELECT MAX(salary), AVG(salary) FROM Employee;
3 - SELECT Ename FROM Employee;
@arunpt
arunpt / ls.cpp
Last active August 19, 2020 04:56
#include<iostream.h>
class LS {
public: void linear_search();
};
void main() {
LS obj;
obj.linear_search();
@arunpt
arunpt / sinsertion.cpp
Created August 7, 2020 12:07
Insertion sort
#include <iostream>
using namespace std;
int arr_len;
int values, i, sorted;
int sort(int[], int);
int main() {
cout << "Enter the length of the array: ";
cin >> arr_len;
int arr[arr_len];
// Linear Searching
#include <iostream>
using namespace std;
int main()
{
int size,i,ser;
cout << "Enter the size of the array: ";
cin >> size;
int arr[size];