Skip to content

Instantly share code, notes, and snippets.

View findoff's full-sized avatar

abnessor aka findoff findoff

View GitHub Profile
/**
* Converts an RGB color value to HSL. Conversion formula
* adapted from http://en.wikipedia.org/wiki/HSL_color_space.
* Assumes r, g, and b are contained in the set [0, 255] and
* returns h, s, and l in the set [0, 1].
*
* @param Number r The red color value
* @param Number g The green color value
* @param Number b The blue color value
* @return Array The HSL representation
@shamil
shamil / mount_qcow2.md
Last active July 18, 2024 15:23
How to mount a qcow2 disk image

How to mount a qcow2 disk image

This is a quick guide to mounting a qcow2 disk images on your host server. This is useful to reset passwords, edit files, or recover something without the virtual machine running.

Step 1 - Enable NBD on the Host

modprobe nbd max_part=8
exports.reversePath = function(path)
{
var reversedPath = [];
for(var i = 0; i < path.length; i++)
{
var currentStep = path[i];
var dx = currentStep.dx * -1;
var dy = currentStep.dy * -1;
@yurydelendik
yurydelendik / !wasmllvm.md
Last active May 31, 2024 06:31
Using WebAssembly in LLVM

NOTE: the content is out-of-date. All development is moved to the https://github.com/yurydelendik/wasmception

Using WebAssembly in LLVM

Compiling

# locations, e.g.
export WORKDIR=~/llvmwasm; mkdir -p $WORKDIR
export INSTALLDIR=$WORKDIR

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@jorritfolmer
jorritfolmer / qemu-kvm-ovirt-windows-server-2016.md
Last active June 8, 2021 20:25
Installing Windows Server 2016 on oVirt qemu/kvm

Installing Windows Server 2016 on Ovirt v4 qemu/kvm

The install fails with BSOD and "Your PC ran into a problem and needs to restart. We're just collecting some error info, and then we'll restart for you."

Windows installer BSOD on qemu/kvm

After reboot it returns with the following message: "The computer restarted unexpectedly or encountered an unexpected error. Windows installation cannot proceed. To install Windows, click OK to restart the computer, and then restart the installation.":

Windows installer restarted unexpectedly on qemu/kvm

@OmarShehata
OmarShehata / Text.js
Created February 10, 2017 17:33
Create an in-game text object in the PlayCanvas engine
var Text = pc.createScript('text');
Text.attributes.add('text', { type: 'string', default:'Hello World!' });
Text.attributes.add('fontsize', { type: 'number', default:70, title:"Font Size" });
// initialize code called once per entity
Text.prototype.initialize = function() {
// Create a canvas to do the text rendering
this.canvas = document.createElement('canvas');
this.canvas.height = 128;
@cvan
cvan / webgl-detect-gpu.js
Last active January 19, 2024 02:54
use JavaScript to detect GPU used from within your browser
var canvas = document.createElement('canvas');
var gl;
var debugInfo;
var vendor;
var renderer;
try {
gl = canvas.getContext('webgl') || canvas.getContext('experimental-webgl');
} catch (e) {
}
@kerryboyko
kerryboyko / README.md
Last active April 26, 2023 16:08
VueJS Best Practices Guide

Deverus Vue.js Style Guide

Guide for developing Vue.js applications.

v. 0.0.1

Vue.js is an amazing framework, which can be as powerful as Angular or React, the two big heavy hitters in the world of front-end frameworks.

However, most of Vue's ease-of-use is due to the use of Observables - a pattern that triggers re-renders and other function calls with the reassignment of a variable.

@fuqunaga
fuqunaga / CalculateObliqueMatrix
Created September 4, 2018 05:22
CalculateObliqueMatrix inplement
// https://forum.unity.com/threads/oblique-near-plane-clipping.194722/
public class Clipper : MonoBehaviour
{
Matrix4x4 projection;
Camera offscreenCam;
void Start ()
{
projection = camera.projectionMatrix;
}