Skip to content

Instantly share code, notes, and snippets.

@davidborzek
davidborzek / spotify-ws.js
Created August 6, 2021 12:48
Access the spotify websocket api for real time updates about playback etc. Only works with an offical access token, third-party ones don't work.
import axios from 'axios';
import WebSocket from 'ws';
/*
Use a spotify acces token from an offical source like open.spotify.com. You can obtain it by using the network inspector in your browser.
Third-party access token obtained via OAuth2 will not work because of an api limitation by spotify.
*/
const ACCESS_TOKEN = "";
const createWebSocketUrl = (accessToken) => `wss://dealer.spotify.com/?access_token=${accessToken}`;
@ColonelThirtyTwo
ColonelThirtyTwo / FakeMatrixStack.lua
Created August 11, 2012 00:03
GMod Real Matrix Stack (if VMatrix:Copy() is implemented)
local FakeMatrixStack = {}
FakeMatrixStack.m = Matrix()
function FakeMatrixStack:push()
local m = self.m
cam.PushModelMatrix(m)
self[#self+1] = m:Copy()
end