Skip to content

Instantly share code, notes, and snippets.

View durveshshah's full-sized avatar

Durrvesh Sshah durveshshah

View GitHub Profile
@durveshshah
durveshshah / Accounts_Integration (Apex Code).cls
Created December 3, 2021 01:22
Salesforce Integration Code
@RestResource(urlMapping='/v1/accounts/*')
global with sharing class Accounts_Integration{
private class Attach {
String Body;
String ContentType;
String Name;
}
private class AccountClass {
@durveshshah
durveshshah / Json_Body.json
Created December 3, 2021 01:26
JSON Body
{
"thisAccount": {
"Name" : "sss1",
"phone" : "8867",
"AccountNumber" : "111"
},
"attachments":
[{
"Body": "aGVsbG8=",
"Name": "hello.txt"
@durveshshah
durveshshah / main.py
Created December 3, 2021 01:28
Python Flask
from flask import Flask,render_template,request,redirect,url_for,flash
import requests
import json
import base64
grant_type = 'xxx'
client_id = 'xxxxxx'
client_secret = 'xxxxx'
username = 'xxx@abc.com'
password = 'xxxx'
@durveshshah
durveshshah / base.html
Created December 3, 2021 01:35
Flask base
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>
<link rel = "stylesheet" type="text/css" href="{{ url_for('static',filename = 'style.css')}}">
<meta name="viewport" content="width=device-width, initial-
{% extends 'base.html' %}
{% include 'header.html' %}
{% block content %}
<div class = "container">
<center><h1 style="color:green">Salesforce-Python Connector</h1></center>
<div class="row">
<div class="col-sm">
<form method="POST" action="{{ url_for('Save')}}" autocomplete="off" enctype="multipart/form-data">
<div class="form-group">
{% with messages = get_flashed_messages() %}
{% extends 'base.html' %}
{% block content %}
<div class = "jumbotron p-3" style="width:10000px">
<img src="{{ url_for('static', filename='platform.png') }}" style="width:300px" height="100px"/>
</div>
{% endblock content %}
@durveshshah
durveshshah / App.py
Created December 7, 2021 05:04
Python Flask MySql
from flask import Flask,render_template,request,redirect,url_for,flash
from flask_sqlalchemy import SQLAlchemy
app = Flask(__name__)
app.secret_key = "Secret Key"
#SqlAlchemy Database Configuration With Mysql
app.config['SQLALCHEMY_DATABASE_URI'] = 'mysql+pymysql://root:''@localhost/crud'
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>
{% extends 'base.html' %}
<title> Flask Crud</title>
{% block content %}
<div class = "jumbotron p-3">
<div class = "well text-center">
<h1> University Student Database System</h1>
<h4 style="text-align:right">Developed by: Durvesh Shah</h4>
{% extends 'base.html' %}
{% include 'header.html' %}
{% block content %}
<div class = "container">
<div class = "row">
<div class="col md-12">
<div class = "jumbotron p-3">
<h2><b>Manage Students </b> <button type="button" class="btn btn-success float-right"