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
import Syncano from '@syncano/core'
export default (ctx) => {
const {channel, response} = new Syncano(ctx)
const {args} = ctx
try {
channel.publish(`global-messages`, {'light': args.light, 'status': args.status})
.then(res => {response(JSON.stringify(res), 200, 'application/json')})
} catch(e) {
@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
@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
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
if (light === "star") {
hyperdrive.writeSync(1);
try {
clearTimeout(hyperdriveTimer);
} catch (e) {}
hyperdriveTimer = setTimeout(function() {
hyperdrive.writeSync(0);
}, 3000);
play("r2d2");
}
if (args.action == 'started') {
args.light = 'star'
args.status = 1
}
<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)"
{
"name": "Millennium Falcon",
"short_name": "Falcon",
"theme_color": "#2196f3",
"background_color": "#2196f3",
"display": "standalone",
"orientation": "portrait",
"scope": "/",
"icons": [{
"src": "/images/icons/icon-128x128.png",
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
const { spawn } = require('child_process');
const player = spawn('aplay', [`audio/chewbacca.wav`]);