Skip to content

Instantly share code, notes, and snippets.

View SudhanPlayz's full-sized avatar
🔍
Exploring Web3

Sudhan SudhanPlayz

🔍
Exploring Web3
View GitHub Profile
/*
A single-file JavaScript class to draw candlestick charts.
Use at your own risk.
https://twitter.com/pingpoli
https://pingpoli.de
*/
function pingpoliCandlestick( timestamp , open , close , high , low )
{
this.timestamp = parseInt(timestamp);
this.open = parseFloat(open);
@SudhanPlayz
SudhanPlayz / ShareX_CustomUploader.js
Created May 3, 2021 11:54
ShareX Custom Domain Uploader
var express = require("express")
var multer = require("multer");
var body_parser = require("body-parser");
var cors = require("cors");
var app = express()
var storage = multer.diskStorage({
destination: function (req, file, cb) {
cb(null, "Uploads");
},
@SudhanPlayz
SudhanPlayz / Deploy GitHub Repo Using SSH Keys.md
Last active January 1, 2022 08:41
Topic's in this gist: Connecting to Ubuntu VM, Installing nodejs, Generating SSH key and cloning GitHub repo using git
@zihadmahiuddin
zihadmahiuddin / AUTO_DEPLOY.md
Last active May 27, 2024 06:21
GitHub Auto Deploy for NodeJS apps using Webhooks
@jesperorb
jesperorb / cors.md
Last active February 21, 2024 14:17
Handle CORS Client-side

Handle CORS Client-side

Cross-origin resource sharing (CORS) is a mechanism that allows restricted resources (e.g. fonts) on a web page to be requested from another domain outside the domain from which the first resource was served. This is set on the server-side and there is nothing you can do from the client-side to change that setting, that is up to the server/API. There are some ways to get around it tho.

Sources : MDN - HTTP Access Control | Wiki - CORS

CORS is set server-side by supplying each request with additional headers which allow requests to be requested outside of the own domain, for example to your localhost. This is primarily set by the header:

Access-Control-Allow-Origin