Skip to content

Instantly share code, notes, and snippets.

knee-cola

Block or report user

Report or block knee-cola

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@knee-cola
knee-cola / define-process-shim.js
Created Dec 5, 2018
Shim for `process` variable for CDN modules packed as UMD
View define-process-shim.js
if(!this.process) {
this.process = {};
}
if(!this.process.env) {
this.process.env = {};
}
if(!this.process.env.NODE_ENV) {
this.process.env.NODE_ENV = "production";
View chrome-mobile-footer-bug.html
@knee-cola
knee-cola / _README.md
Last active Dec 12, 2017
tracking battery usage on Windows laptop
View _README.md

What's this?

This is a script, which tracks charging and discharging time of a Windows powered laptop.

It creates a log file, which contains information about time the laptop spend charging and discharging the battery. The collected information can give you a pretty good idea about the battery life of your laptop.

Here's a sample:

charge=77
@knee-cola
knee-cola / ..README.md
Last active Dec 8, 2017
Concentric CSS config for VS Code extensions PostCSS Sorting & Sass Lint
View ..README.md

What's this?

This is concentric configuration for PostCSS Sorting an Sass Lint Visual Studio code extensions.

The Sass Lint extension will check if the SCSS file is formated corectly, while PostCSS Sorting will help you automatically fix the property order.

How to install

Step1: First install both VS Code plugins.

View SphereControls.js
var SphereControls = function (camera, domElement, config) {
var self = this;
config = config || {};
domElement = ( domElement !== undefined ) ? domElement : document;
domElement.addEventListener( 'mousedown', onDocumentMouseDown, false );
domElement.addEventListener( 'mousemove', onDocumentMouseMove, false );
domElement.addEventListener( 'mouseup', onDocumentMouseUp, false );
View BallSpinerLoader.js
/**
* @author knee-cola / https://github.com/knee-cola
* Original file URL: https://gist.github.com/knee-cola/37875bc4359609b96c9f329cd2a68fa1
*
* This is a spinner/loader built for Three.js platform.
* It can be used to notify user that some resources are being loaded.
* I made it to replace pure CSS spinner, which was displayed in the
* overlay above the 3D animation, since it was slowing down WebGL
*
* How to use:
@knee-cola
knee-cola / ProgressiveImgLoader.js
Last active Mar 22, 2017
simple progressive texture image loader for Three.js
View ProgressiveImgLoader.js
/**
* @author knee-cola / https://github.com/knee-cola
* Original file URL: https://gist.github.com/knee-cola/37875bc4359609b96c9f329cd2a68fa1
*/
// This is a simple progressive image loader for Three.js
// It enables the smaller image files to be loaded first,
// before the big texture image is fully loaded.
//
// The images are loaded in the order they are passed
View ThreeUvMapper.js
// This function is based on the code found at (the original source doesn't work well)
// http://stackoverflow.com/questions/20774648/three-js-generate-uv-coordinate
//
// She following page explains how UV map should be calculated
// https://solutiondesign.com/blog/-/blogs/webgl-and-three-js-texture-mappi-1/
//
// The following documentation shows what a apherical UV map should look like
// https://threejs.org/examples/#misc_uv_tests
var ThreeUvMapper = {
@knee-cola
knee-cola / ThreeCSG.js
Last active Mar 20, 2017 — forked from chandlerprall/ThreeCSG.js
csg.js wrapper for three.js
View ThreeCSG.js
/*
THREE.CSG
@author Chandler Prall <chandler.prall@gmail.com> http://chandler.prallfamily.com
Wrapper for Evan Wallace's CSG library (https://github.com/evanw/csg.js/)
Provides CSG capabilities for Three.js models.
Provided under the MIT License
*/
You can’t perform that action at this time.