Skip to content

Instantly share code, notes, and snippets.

View aveek22's full-sized avatar
🏠
Working from home

Aveek aveek22

🏠
Working from home
View GitHub Profile
import requests # To deal with REST APIs
# Get the ClientID and ClientSecret to get the access token
client_id = "YOUR_CLIENT_ID"
client_secret = "YOUR_CLIENT_SECRET"
organization_id = "YOUR_ORGANIZATION_ID"
url_access_token = "https://www.linkedin.com/oauth/v2/accessToken"
auth_code = "YOUR_AUTH_CODE_FROM_PREVIOUS_VERIFICATION"
payload = {
'grant_type' : 'authorization_code',
'code' : auth_code,
'redirect_uri' : redirect_uri,
'client_id' : client_id,
'client_secret' : client_secret
}
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}'
from flask import Flask
from flask_restful import Api, Resource, reqparse
import pandas as pd
app = Flask(__name__)
api = Api(app)
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),
# Import the pandas
import pandas as pd
# Read the CSV file
data = pd.read_csv('C:/DemoSourceData.csv')
# Print the data
print(data)
Employee Department Salary
John HR 6000
Fred Engineering 10000
George Sales 8000
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
/*
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
/*
This script will create the users table on the flyway-db database
*/
CREATE TABLE Users(
[UserID] INT,
[UserName] VARCHAR(255),
[Address] VARCHAR(255),
)
GO