Skip to content

Instantly share code, notes, and snippets.

View hxmwr's full-sized avatar
🐶
Doing machine learning research.

Nmaxwiver hxmwr

🐶
Doing machine learning research.
  • H.E. Tech
  • China
View GitHub Profile
@RaheelYawar
RaheelYawar / bloom.fragment.glsl
Created June 22, 2018 08:36
Three.js (GLSL) basic bloom shader
// THREEjs build-in uniforms and attributes (Fragment)
// uniform mat4 viewMatrix - camera.matrixWorldInverse
// uniform vec3 cameraPosition - camera position in world space
varying vec2 vUv;
uniform sampler2D albedo;
void main() {
@amitchhajer
amitchhajer / Count Code lines
Created January 5, 2013 11:08
Count number of code lines in git repository per user
git ls-files -z | xargs -0n1 git blame -w | perl -n -e '/^.*\((.*?)\s*[\d]{4}/; print $1,"\n"' | sort -f | uniq -c | sort -n
@kig
kig / gist:1229476
Created September 20, 2011 15:52
Three.js canvas text
// Usage:
// var txt = alignPlane(createText2D('String', 'red', 'Verdana', 64), THREE.RightAlign, THREE.BottomAlign);
// scene.addChild(txt);
function createTextCanvas(text, color, font, size) {
size = size || 24;
var canvas = document.createElement('canvas');
var ctx = canvas.getContext('2d');
var fontStr = (font || 'Arial') + ' ' + (size +'px');
ctx.font = fontStr;