Skip to content

Instantly share code, notes, and snippets.

Avatar
🌲
Growing

SOKHUONG UON SOKHUONG

🌲
Growing
View GitHub Profile
@SOKHUONG
SOKHUONG / console.image.min.js
Created Oct 11, 2020
print image in console
View console.image.min.js
/**
* 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
View usk_test.js
// 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;