Skip to content

Instantly share code, notes, and snippets.

View NoxWings's full-sized avatar
🦀

David G. Miguel NoxWings

🦀
View GitHub Profile
float2 positions[3] = {
float2( 0.0, -0.5),
float2( 0.5, 0.5),
float2(-0.5, 0.5)
};
float4 colors[3] = {
float4(1.0, 0.0, 0.0, 1.0),
float4(0.0, 1.0, 0.0, 1.0),
float4(0.0, 0.0, 1.0, 1.0)
@NoxWings
NoxWings / load_spectorjs_in_dev_console.js
Created November 7, 2021 16:29 — forked from De-Panther/load_spectorjs_in_dev_console.js
Code snippet for loading SpectorJS in WebGL page. Copy this code to the development console of a web page with WebGL content. Make sure that you are posting it in the right context(if the canvas is inside an iframe).
var newScript = document.createElement("script");
newScript.onload = function() {
var spector = new SPECTOR.Spector();
spector.displayUI();
};
document.head.appendChild(newScript);
newScript.src = "https://spectorcdn.babylonjs.com/spector.bundle.js";
@NoxWings
NoxWings / virtualCam.sh
Last active January 19, 2021 14:43
Simple script to create a virtual cam device to be used as a sink OBS for example. You will need some v4l2loopback package(s) installed. Also the obs sink can be found here: https://github.com/CatxFish/obs-v4l2sink
#!/bin/bash
sudo modprobe v4l2loopback devices=1 video_nr=10 card_label="OBS Cam" exclusive_caps=1
ls -l /dev/video*
v4l2-ctl --list-devices
# https://www.google.es/search?sxsrf=ALeKk01prUlE8BPxGnfFe0RkbsMiSFo4Lg%3A1585693172189&ei=9MGDXtCaC-vjgwfMuYjwCA&q=obs+plugins+use&oq=obs+plugins+use&gs_lcp=CgZwc3ktYWIQAzIGCAAQFhAeMgUIABDNAjIFCAAQzQIyBQgAEM0COgQIABBHOgUIABCRAjoFCAAQywE6AggAULO1AVixwQFgvcIBaABwAngAgAFUiAGIA5IBATWYAQCgAQGqAQdnd3Mtd2l6&sclient=psy-ab&ved=0ahUKEwjQ5ICy38XoAhXr8eAKHcwcAo4Q4dUDCAs&uact=5
# https://obsproject.com/forum/resources/obs-virtualcam.539/
# https://github.com/CatxFish/obs-v4l2sink
# https://github.com/CatxFish/obs-virtual-cam/issues/17
# https://srcco.de/posts/using-obs-studio-with-v4l2-for-google-hangouts-meet.html
@NoxWings
NoxWings / showInteractiveAreas.js
Last active March 10, 2020 15:15
highlights PIXI interactive areas
function showInteractiveAreas () {
const root = APP.safeGetChildByName("");
const debugHitArea = "DebugHitArea";
const queue = [root];
while (queue.length > 0) {
const element = queue.pop();
if (element.name === debugHitArea)
@NoxWings
NoxWings / extract-wiki-page-links.js
Last active September 12, 2019 09:24
Having the wiki page list on the home screen has better visibility than having them on the side so this extracts the links and prints the markup to add it to a page
const range = (min, max) => Array(max - min).fill().map((_, i) => i + min);
function fastPrimes(n) {
var p = range(2, n);
for (var i = 0; i < p.length; i++) {
for (var j = i + p[i]; j < p.length; j += p[i]) { p[j] = undefined; }
p = p.filter(n => n);
}
return p;
}
const osmosis = require("osmosis");
const fs = require("fs");
function extractVideoLinks (code) {
const resolutionRegex = /resolution *==+ *"(.*?)"/g;
const sourceRegex = /source\.src *= *"(.*?)";/g;
const links = {};
let match = false;
do {
@NoxWings
NoxWings / ztype.js
Created January 12, 2018 13:58
Cheat for ztype
class Cheat {
constructor (game) {
this.game = game;
this._target = undefined;
}
get target () {
if (!this._target || this._target.remainingWord.length === 0) {
this._target = this.bestTarget;
}
@NoxWings
NoxWings / install-base.sh
Last active January 10, 2018 11:53
Raspbian remove bloat software
# ---------------------
# Install base software
# ---------------------
# Install node LTS
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo aptitude install -y nodejs
@NoxWings
NoxWings / printPIXIHierarchy.js
Last active August 27, 2020 13:20
Print PIXI tree hierarchy
function printHierarchy(node, padding="") {
let newPadding = padding;
if (node.name) {
newPadding += " |";
console.log(`${padding}-${node.name}`);
}
node.children.forEach(child => printHierarchy(child, newPadding));
}