This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from timeit import default_timer | |
def request(session): | |
url = "https://jsonplaceholder.typicode.com/photos" | |
with session.get(url) as response: | |
data = response.text | |
if response.status_code != 200: | |
print("FAILURE::{0}".format(url)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import asyncio | |
from timeit import default_timer | |
from concurrent.futures import ThreadPoolExecutor | |
START_TIME = default_timer() | |
def request(session, i): | |
url = "https://jsonplaceholder.typicode.com/photos" | |
with session.get(url) as response: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState } from "react"; | |
function App() { | |
const [name, setName] = useState(""); | |
const debounce = (func, delay) => { | |
let debounceTimer; | |
return function () { | |
const context = this; | |
const args = arguments; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState } from "react"; | |
import axios from "axios"; | |
function App() { | |
const [file, setFile] = useState(); | |
const [fileName, setFileName] = useState(""); | |
const saveFile = (e) => { | |
setFile(e.target.files[0]); | |
setFileName(e.target.files[0].name); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require("express"); | |
const fileupload = require("express-fileupload"); | |
const cors = require("cors"); | |
const app = express(); | |
app.use(cors()); | |
app.use(fileupload()); | |
app.use(express.static("files")); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// DES encryption | |
public string EncryptData(string strData, string strEncDcKey) { | |
byte[] key = {}; //Encryption Key | |
byte[] IV = { | |
10, | |
20, | |
30, | |
40, | |
50, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//AES Encryption | |
public static string EncryptString(string plainText, string keyToUse) { | |
byte[] iv = new byte[16]; | |
byte[] array; | |
using(Aes aes = Aes.Create()) { | |
aes.Key = Encoding.UTF8.GetBytes(Get128BitString(keyToUse)); | |
aes.IV = iv; | |
ICryptoTransform encryptor = aes.CreateEncryptor(aes.Key, aes.IV); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Create Table file(id Int AUTO_INCREMENT Not Null Primary Key, file_name Varchar(30), file_data LONGBLOB Not Null, created_by Varchar(20) Not Null, created_on Datetime Not Null); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require("express"); | |
const sql = require('mysql'); | |
const app = express(); | |
app.use(express.json({ limit: "50mb" })); | |
app.use(express.urlencoded({ extended: true })); | |
app.set("view engine", "ejs"); | |
const config = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<title>Document</title> | |
</head> | |
<body> | |
<input type="file" id="file-input" accept="image/*" /> | |
<script> | |
const inputFile = document.getElementById("file-input"); |