Skip to content

Instantly share code, notes, and snippets.

View lvisei's full-sized avatar

lvisei lvisei

View GitHub Profile
@lvisei
lvisei / gpu-information.js
Created March 15, 2021 02:13
Javascript get graphics card information
const canvas = document.createElement('canvas');
const webgl = canvas.getContext('experimental-webgl');
const info = webgl.getExtension('WEBGL_debug_renderer_info');
const msg = webgl.getParameter(info.UNMASKED_RENDERER_WEBGL);
console.log(msg)
@lvisei
lvisei / js-utf8-decode.js
Last active March 15, 2021 02:13
JavaScript UTF-8 decode
// ES5
function utf8Decode(str_data) {
let tmp_arr = [],
i = 0,
ac = 0,
c1 = 0,
c2 = 0,
c3 = 0;
str_data += "";
while (i < str_data.length) {