Skip to content

Instantly share code, notes, and snippets.

View SOKHUONG's full-sized avatar
🌲
Growing

SOKHUONG UON SOKHUONG

🌲
Growing
View GitHub Profile
@SOKHUONG
SOKHUONG / usk_test.js
Last active October 11, 2020 15:30
test
// WebGL Renderer
{
this.renderer = new WebGLRenderer({antialias: true});
this.renderer.name = "Renderer";
// this.renderer.setClearColor(0x888888);
this.renderer.setPixelRatio(window.devicePixelRatio);
this.renderer.setSize(this.sceneSpace.clientWidth, this.sceneSpace.clientHeight);
this.renderer.outputEncoding = sRGBEncoding;
this.renderer.shadowMap.enabled = true;
this.renderer.shadowMap.type = PCFSoftShadowMap;
@SOKHUONG
SOKHUONG / console.image.min.js
Created October 11, 2020 16:16
print image in console
/**
* Dubiously created by Adrian Cooney
* http://dunxrion.github.io
*/(function(e){"use strict";function n(e,t){return{string:"+",style:"font-size: 1px; padding: "+Math.floor(t/2)+"px "+Math.floor(e/2)+"px; line-height: "+t+"px;"}}function r(e,t,n,r,o){n=n.toUpperCase();if(n.length<24){var u=Math.max(0,n.length-12),a=70+u*-3;i(e,a,n,r/2,o)}else if(n.length<29)i(e,40,n,r/2,o);else{var f=s(n,27);f.forEach(function(n,s){i(e,40,n,r/2,t=="lower"?o-(f.length-1)*40+s*40:o+s*40)})}}function i(e,t,n,r,i){e.font="bold "+t+"px Impact";e.fillStyle="#fff";e.textAlign="center";e.textBaseline="middle";e.lineWidth=7;e.strokeStyle="#000";e.strokeText(n,r,i);e.fillText(n,r,i)}function s(e,t){var n=[],r=e.split(" "),i=[];for(var s=0,o=r.length;s<o;s++)if((i+r[s]).length<t)i.push(r[s]);else{n.push(i.join(" "));i.length=0;i.push(r[s])}n.push(i.join(" "));return n}var t={"10 Guy":"//i.imgur.com/LaENqOV.jpg","3rd World Success Kid":"//i.imgur.com/WA5duA1.jpg","90's Problems":"//i.imgur.com/tL47qtp.jpg","Aaand It's Gone":"//i.im