Skip to content

Instantly share code, notes, and snippets.

Avatar

liuvigongzuoshi liuvigongzuoshi

View GitHub Profile
@liuvigongzuoshi
liuvigongzuoshi / gpu-information.js
Created Mar 15, 2021
Javascript get graphics card information
View gpu-information.js
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)
@liuvigongzuoshi
liuvigongzuoshi / js-utf8-decode.js
Last active Mar 15, 2021
JavaScript UTF-8 decode
View js-utf8-decode.js
// 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) {