Skip to content

Instantly share code, notes, and snippets.

View Plagiatus's full-sized avatar

Lukas Scheuerle Plagiatus

View GitHub Profile
@Plagiatus
Plagiatus / Map.svelte
Created March 9, 2023 08:00
Using the Google Maps JS API in svelte
<script lang="ts">
let map: google.maps.Map;
let mapElement: HTMLDivElement;
const apiKey = '<your api key here>';
let marker: google.maps.Marker;
function initMap() {
const start = new google.maps.LatLng(52.5069704,13.2846517);
map = new google.maps.Map(mapElement, {
@Plagiatus
Plagiatus / ms_auth_class.ts
Created September 12, 2021 15:19
A basic implementation for a full flow of Microsoft-Login -> Minecraft Auth + Player Info. No error handling included for easier understandability.
import { XMLHttpRequest } from "xmlhttprequest";
interface AuthorizationTokenResponse {
token_type: string,
expires_in: number,
scope: string,
access_token: string,
refresh_token: string,
user_id: string,
foci: string