Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Aveek aveek22

🏠
Working from home
View GitHub Profile
View wordpress_posts.py
import requests
from config import Config
WORDPRESS_URL = 'https://public-api.wordpress.com/'
AUTH_TOKEN_URL = f'{WORDPRESS_URL}oauth2/token'
POSTS_URL = f'{WORDPRESS_URL}rest/v1.1/sites/{Config.SITE_ID}/posts/{Config.POST_ID}'
View flask_initialize.py
from flask import Flask
from flask_restful import Api, Resource, reqparse
import pandas as pd
app = Flask(__name__)
api = Api(app)
View athena_sql_server.sql
EXEC master.dbo.sp_addlinkedserver
@server =N'AWS_ATHENA',
@srvproduct=N'',
@provider=N'MSDASQL',
@datasrc=N'AWS_ATHENA'
GO
EXEC master.dbo.sp_addlinkedsrvlogin
@rmtsrvname=N'AWS_ATHENA',
@useself=N'False',
View mysql-window-functions.sql
CREATE TABLE Students(
student_number INT AUTO_INCREMENT PRIMARY KEY,
student_name VARCHAR(100),
dept_name VARCHAR(100),
subject VARCHAR(100),
marks INT
);
INSERT INTO Students (student_name,dept_name,subject,marks) VALUES
('Tom','CS','Programming',90),
View python_powerbi.py
# Import the pandas
import pandas as pd
# Read the CSV file
data = pd.read_csv('C:/DemoSourceData.csv')
# Print the data
print(data)
View DemoSourceData.csv
Employee Department Salary
John HR 6000
Fred Engineering 10000
George Sales 8000
View postgres_analytic_functions.sql
CREATE TABLE laptops(
laptop_id SERIAL,
laptop_name VARCHAR(100),
laptop_brand VARCHAR(100),
relesed_year INT,
device_type VARCHAR(100),
price DECIMAL(9,2)
);
INSERT INTO laptops (laptop_name,laptop_brand,relesed_year,device_type,price) VALUES
View sql_shack_analytic_functions.sql
CREATE TABLE Laptops(
LaptopID INT IDENTITY(1,1) PRIMARY KEY,
LaptopName VARCHAR(100),
LaptopBrand VARCHAR(100),
ReleasedYear INT,
DeviceType VARCHAR(100),
Price DECIMAL(9,2)
)
GO
View V1_1_0__Add_Column_To_Users_Table.SQL
/*
This script will alter the users table on the flyway-db database
and add a few columns
*/
ALTER TABLE Users ADD [Age] INT;
ALTER TABLE Users ADD [Email] VARCHAR(255);
GO
View V1_0_0__Add_Users_Table.SQL
/*
This script will create the users table on the flyway-db database
*/
CREATE TABLE Users(
[UserID] INT,
[UserName] VARCHAR(255),
[Address] VARCHAR(255),
)
GO