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
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
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
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 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 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 { IDBManager, MySqlType } from "../types/types"; | |
import { connection } from "./DBConnection"; | |
export class DBManager implements IDBManager { | |
public ReadData(query: string, paramCollection: (string | number | boolean)[] = []): Promise<MySqlType> { | |
return new Promise((resolve, reject) => { | |
connection.query(query, paramCollection, (err, result) => { | |
if (err) { | |
return reject(err) |
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 mysql from 'mysql'; | |
import dotenv from 'dotenv' | |
dotenv.config(); | |
const connection = mysql.createPool({ | |
host: process.env.HOST, | |
user: process.env.USER, | |
password: process.env.PASSWORD, | |
database: process.env.DATABASE, |
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 { MysqlError } from "mysql"; | |
export interface IDBManager { | |
ReadData(query: string, paramCollection: (number | string | boolean)[]): Promise<any | MysqlError> | |
InsertOrUpdateData(query: string, paramCollection: (number | string | boolean)[]): Promise<any | MysqlError> | |
DeleteData(query: string, paramCollection: (number | string | boolean)[]): Promise<any | MysqlError> | |
} |
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
PORT=3000 | |
HOST='localhost' | |
USER='root' | |
PASSWORD='root' | |
DATABASE='onion' |