Skip to content

Instantly share code, notes, and snippets.

View rowanwins's full-sized avatar
🌐
Making maps

Rowan Winsemius rowanwins

🌐
Making maps
  • Canberra, Australia
View GitHub Profile
@steveruizok
steveruizok / getRaysIntersection.ts
Last active October 10, 2021 11:46
Get the intersection of two rays.
/**
* Get the intersection of two rays, with origin points p0 and p1, and direction vectors n0 and n1.
* @param p0 The origin point of the first ray
* @param n0 The direction vector of the first ray
* @param p1 The origin point of the second ray
* @param n1 The direction vector of the second ray
* @returns
*/
export function getRaysIntersection(
p0: number[],

Important

DO NOT USE VSCODE terminal and make sure uname -m returns arm64

  1. First Install Xcode command line tool
xcode-select --install
  1. Create and change /opt directories owner
@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