This file contains 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
version: '3' | |
services: | |
my-react-app: | |
build: | |
context: . | |
dockerfile: Dockerfile | |
ports: | |
- "80:80" | |
volumes: |
This file contains 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
server { | |
listen 80; | |
server_name example.com; | |
root /usr/share/nginx/html; | |
index index.html; | |
location / { | |
try_files $uri $uri/ /index.html; | |
} | |
} |
This file contains 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
# Use an official Node runtime as a parent image | |
FROM node:19-alpine as build | |
# Set the working directory to /app | |
WORKDIR /app | |
# Copy the package.json and package-lock.json to the container | |
COPY package*.json ./ | |
# Install dependencies | |
RUN npm install | |
# Copy the rest of the application code to the container | |
COPY . . |
This file contains 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 newtonSquareRoot = (num) => { | |
let x = 1; | |
let result; | |
for (let i = 0; i < 20; i++) | |
{ | |
result = x - ( x*x - num )/( 2*x ); | |
x = result; | |
} |
This file contains 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
let puppeteer = require('puppeteer'); | |
var nodemailer = require('nodemailer'); | |
scrapePrice('https://www.google.com/search?client=opera&hs=Wzk&sxsrf=ALeKk00I7IW96h0D13mdL99WUos0Xhz5MA%3A1604829566135&ei=fsGnX_DmB4XosAeQpInwAQ&q=türk+hava+yolları+hisse&oq=türk+hava+yolları+hisse&gs_lcp=CgZwc3ktYWIQAzIICAAQyQMQywEyBQgAEMsBMgUIABDLATIFCAAQywEyBQgAEMsBMgUIABDLATIFCAAQywEyBQgAEMsBMgUIABDLATIFCAAQywE6BAgAEEc6CwguEMcBEK8BEMsBUMULWKYSYNcSaABwAngAgAGpAogBwAeSAQUwLjQuMZgBAKABAaoBB2d3cy13aXrIAQjAAQE&sclient=psy-ab&ved=0ahUKEwjwnduB2PLsAhUFNOwKHRBSAh4Q4dUDCAw&uact=5'); | |
function main(srcTxt) | |
{ | |
let currentPrice = srcTxt; | |
let myPrice = 9.62; |
This file contains 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
async function scrapePrice(url){ | |
const browser = await puppeteer.launch(); | |
const page = await browser.newPage(); | |
await page.goto(url); | |
const [el] = await page.$x('<XPath>'); | |
const txt = await (await el.getProperty('textContent')).jsonValue(); // return 9,71 but parseFloat need to period not comma | |
browser.close(); | |
let stringTxt = JSON.stringify(txt).replace('"',"").replace('"',"").replace(",","."); // first change json to string type, this return "number.decimal" and some string methods | |
} |
This file contains 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, useEffect, useRef } from "react"; | |
import { HubConnectionBuilder } from "@microsoft/signalr"; | |
import ChatWindow from "./ChatWindow"; | |
import ChatInput from "./ChatInput"; | |
import { Container } from "reactstrap"; | |
const Chat = () => { | |
const [connection, setConnection] = useState(null); | |
const [chat, setChat] = useState([]); | |
const latestChat = useRef(null); |
This file contains 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 "bootstrap/dist/css/bootstrap.min.css"; |
This file contains 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
services.AddSignalR(); |
This file contains 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
app.UseCors("ClientPermission"); |
NewerOlder