Skip to content

Instantly share code, notes, and snippets.

View maciejkorsan's full-sized avatar
🐼
I'm a panda developer.

Maciek Korsan maciejkorsan

🐼
I'm a panda developer.
View GitHub Profile
let ws = new WebSocket(socketUrl)
ws.on("open", function open() {
console.log("Connected 🚀")
});
ws.on("message", function incoming(data) {
const parsed = JSON.parse(data)
const message = parsed.payload
import axios from "axios";
const hyperdrive = document.querySelector(".-hyperdrive");
const cockpit = document.querySelector(".-cockpit");
const headlights = document.querySelector(".-headlights");
let lights = {
cockpit: 0,
front: 0,
hyperdrive: 0
{
"name": "Millennium Falcon",
"short_name": "Falcon",
"theme_color": "#2196f3",
"background_color": "#2196f3",
"display": "standalone",
"orientation": "portrait",
"scope": "/",
"icons": [{
"src": "/images/icons/icon-128x128.png",
<link rel="manifest" href="/manifest.webmanifest" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<link
rel="apple-touch-icon"
sizes="192x192"
href="/images/icons/icon-192x192.png"
/>
<link
href="splashscreens/iphone5_splash.png"
media="(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2)"
if (args.action == 'started') {
args.light = 'star'
args.status = 1
}
if (light === "star") {
hyperdrive.writeSync(1);
try {
clearTimeout(hyperdriveTimer);
} catch (e) {}
hyperdriveTimer = setTimeout(function() {
hyperdrive.writeSync(0);
}, 3000);
play("r2d2");
}
@maciejkorsan
maciejkorsan / spotify.js
Last active October 5, 2021 15:02
Spotify cover endpoint
const authkey = // authkey stored somewhere ie. file / database
const client_id = ""; // Your client id
const client_secret = ""; // Your secret
const refresh_token = "";
console.log(authkey.keyvalue);
const getCover = () => {
axios
@maciejkorsan
maciejkorsan / howto
Created October 13, 2023 22:13
running processing with kinect on macos
1. open terminal
2. cd ~/Documents/Processing/libraries/openkinect_processing/library/v1/mac/share
3. run `freenect-glview`
now your kinect will work inside processing app