Skip to content

Instantly share code, notes, and snippets.

View dirkk0's full-sized avatar

Dirk Krause dirkk0

View GitHub Profile
@dirkk0
dirkk0 / blender_addon_ege.py
Created November 26, 2023 17:47
Easy glTF/glb Exporter Blender addon
bl_info = {
"name": "Easy glTF/glb Exporter",
"blender": (2, 80, 0),
"category": "Experiment",
"author": "Dirk Krause",
}
import bpy, os
class EgePanel(bpy.types.Panel):
@dirkk0
dirkk0 / main.js
Last active November 29, 2023 08:12
nodejs websocket with ws and http - full minimal example
// starter was this very helpful post from @lpinca
// https://github.com/websockets/ws/issues/2052#issuecomment-1142529734
// installation: npm install ws
const WebSocketServer = require("ws");
const http = require('http');
const PORT = process.env.PORT || 8084;
@dirkk0
dirkk0 / server.js
Created July 23, 2022 09:38
minimal nodejs webserver without modules but with CORS
"use strict";
const http = require('http');
const url = require('url');
const fs = require('fs');
const path = require('path');
const port = process.argv[2] || 9000;
// via
// https://stackoverflow.com/questions/16333790/node-js-quick-file-server-static-files-over-http
@dirkk0
dirkk0 / main.cpp
Last active August 3, 2023 23:08
Basic SDL2 OpenGL application
// code nicked mainly from here:
// http://lazyfoo.net/tutorials/SDL/50_SDL_and_opengl_2/index.php
/* to compile
### installation on ubuntu
# install compiler etc
sudo apt-get install --yes software-properties-common g++ make
# install sdl2
@dirkk0
dirkk0 / agent.gd
Created May 9, 2023 19:23
navigation server example for Godot 3.52
extends KinematicBody
onready var navigation = $"../Navigation"
var target # = $"../Position3D"
var speed = 10.0
var path = []
var path_index = 0
var pois = []
@dirkk0
dirkk0 / texteditor.html
Last active March 27, 2023 08:01
webview-node text editor example
<html>
<style>
#text {
width: 100%;
height: 90%;
}
</style>
<body>
@dirkk0
dirkk0 / heydey.js
Created November 15, 2014 18:33
Isometric tiles in pixi.js
var w = 600
var h = 380
var stage = new PIXI.Stage(0x66FF99);
var renderer = PIXI.autoDetectRenderer(w, h);
document.body.appendChild(renderer.view);
requestAnimFrame(animate);
var n = 12; // CHANGE THIS
<!doctype html>
<!--
Copyright 2018 The Immersive Web Community Group
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
@dirkk0
dirkk0 / deezer-minimal.html
Created September 5, 2021 09:37
Minimal JavaScript to get Deezer wo work. Don't forget to replace the APP_ID and put it on the domain associated with this ID.
<!DOCTYPE html>
<html>
<head>
<title>Basic Custom Player with Deezer JavaScript SDK</title>
<meta name="viewport"
content="width=device-width,initial-scale=1,shrink-to-fit=no,user-scalable=no,maximum-scale=1" />
<script src="https://e-cdns-files.dzcdn.net/js/min/dz.js"></script>
</head>