Skip to content

Instantly share code, notes, and snippets.

View iam-mhaseeb's full-sized avatar
🧑‍💻
Passionate Software Engineer

Muhammad Haseeb iam-mhaseeb

🧑‍💻
Passionate Software Engineer
View GitHub Profile
@iam-mhaseeb
iam-mhaseeb / resume_parser.py
Created February 11, 2023 05:48
The simplest resume parser in Python
import re
import json
# define a function to parse the resume
def parse_resume(resume_text):
# split the text into lines
lines = resume_text.split('\n')
# initialize variables to store the parsed information
name = ''
@iam-mhaseeb
iam-mhaseeb / xss-scanner.py
Last active November 10, 2022 17:27
A simple XSS vulnerability scanner tool in Python.
import sys
import requests
from pprint import pprint
from bs4 import BeautifulSoup as bs
from urllib.parse import urljoin
XSS_SCRIPT = "<Script>alert('hi')</scripT>"
class MissingUrlException(Exception):
UNLOAD ('select * from skytrax.airline')
TO 's3://redshift-data-movement/backups/airline.csv'
CREDENTIALS 'aws_access_key_id=XXXXXXXXXX;aws_secret_access_key=XXXXXXXXXX'
FORMAT as csv;
COPY skytrax.airline
FROM 's3://redshift-data-movement/airline.csv'
CREDENTIALS 'aws_access_key_id=XXXXXXXXXX;aws_secret_access_key=XXXXXXXXXX'
FORMAT as csv
IGNOREHEADER 1
TRUNCATECOLUMNS;
--Tables recreation
DROP TABLE IF EXISTS skytrax.airline;
DROP TABLE IF EXISTS skytrax.airport;
DROP TABLE IF EXISTS skytrax.lounge;
DROP TABLE IF EXISTS skytrax.seat;
CREATE TABLE IF NOT EXISTS skytrax.airline(
airline_name VARCHAR(100) DEFAULT 'Unknown',
link VARCHAR(100) DEFAULT 'Unknown',
title VARCHAR(150) DEFAULT 'Unknown',
-- Schema recreation
create schema if not exists skytrax;
@iam-mhaseeb
iam-mhaseeb / routing.ts
Created March 4, 2022 06:29
Manual Routing
{
component: AppComponent,
path: '',
canActivate: [LoggedInGuard],
loadChildren: () => import('./homepage/homepage.module').then(m => m.HomepageModule)
},
import re
import logging
import requests
from bs4 import BeautifulSoup
from collections import deque
from urllib.parse import urlsplit
from urllib.parse import urlparse
LOGGER = logging.getLogger(__name__)
@iam-mhaseeb
iam-mhaseeb / slackmojis_downloader.py
Created January 31, 2022 09:40
Slackmojis.com Downloader
import os
import sys
import requests
from bs4 import BeautifulSoup
def show_arg():
req = requests.get(sys.argv[1])
@iam-mhaseeb
iam-mhaseeb / gist:1e09485444d9aa384a1e61c86b1fd3de
Created January 5, 2022 16:58 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>