Skip to content

Instantly share code, notes, and snippets.

View rohan-deshpande's full-sized avatar
🚀
Just shipped https://getnebula.app check it out!

Rohan Deshpande rohan-deshpande

🚀
Just shipped https://getnebula.app check it out!
View GitHub Profile
@donmccurdy
donmccurdy / README.md
Last active September 25, 2024 15:50
Convert legacy three.js (JSON) files to glTF 2.0

legacythree2gltf.js

Converts legacy JSON models (created by the three.js Blender exporter, for THREE.JSONLoader) to glTF 2.0. When original .blend files are available, prefer direct export from Blender 2.80+.

NOTE: JSON files created with .toJSON() use a newer JSON format, which isn't deprecated, and these are still supported by THREE.ObjectLoader. This converter does not support that newer type of JSON file.

Installation:

npm install canvas vblob three
@ameliemaia
ameliemaia / three-examples-converter.js
Last active November 26, 2018 03:32
Convert threejs examples js to es6 - slightly hacky but works
var fs = require('fs');
require('shelljs/global');
const EXAMPLES_DIR = './node_modules/three/examples/js'
const DEST_DIR = './src/js/lib/three/examples'
mkdir('-p', DEST_DIR);
const files = [
`${EXAMPLES_DIR}/loaders/GLTFLoader.js`,
@jeanlescure
jeanlescure / TransformationShader.js
Last active January 22, 2025 14:07
ThreeJS: Vertex shader for translating, scaling, and rotating. Fragment shader for adding texture and controlling opacity.
THREE.TransformationShader = {
defines: {},
uniforms: {
"tDiffuse": { type: "t", value: texture },
"opacity": { type: "f", value: 1.0 },
"translationX": { type: "f", value: 1.0 },
"translationY": { type: "f", value: 1.0 },
"translationZ": { type: "f", value: 1.0 },
"scaleX": { type: "f", value: 1.0 },
@maaarghk
maaarghk / ballache.md
Last active August 22, 2017 23:16
Dual PHP - Run PHP 5.3 using mod_php and PHP 5.6 using php_fpm on Apache 2.2, as distributed by CentOS 6.5. Also tested on CentOS 6.3!

Dual PHP - Apache 2.2 running PHP 5.3 mod_php and PHP 5.6 php_fpm on CentOS 6.5

Introduction

We have a CentOS 6.5 server in production, running sites which are not compatible with PHP 5.4+. For this reason, we are running Apache 2.2 + PHP 5.3 (mod_php). We also run some newer sites on the server and we would like to run them on PHP 5.6 in order to take advantage of the performance improvements which have been realised in the newer versions of PHP. To minimize pain, we will run both versions side by side. This will require mod_php to be overridden in the VirtualHost by mod_fastcgi. We will install PHP 5.6 FPM to achieve this.

This procedure has also been tested and works on an up to date install of CentOS 6.3!

@jeremejazz
jeremejazz / polygonCenter.js
Last active February 22, 2021 21:19
Return Center polygon in google maps v3. This does not apply to some shapes though. I recommend using turf.js instead https://turfjs.org/
function polygonCenter(poly) {
var lowx,
highx,
lowy,
highy,
lats = [],
lngs = [],
vertices = poly.getPath();
for(var i=0; i<vertices.length; i++) {
@octocat
octocat / .gitignore
Created February 27, 2014 19:38
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@pitch-gist
pitch-gist / gist:2999707
Created June 26, 2012 22:21
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@gre
gre / easing.js
Last active July 11, 2025 12:47
Simple Easing Functions in Javascript - see https://github.com/gre/bezier-easing
/*
* This work is free. You can redistribute it and/or modify it under the
* terms of the Do What The Fuck You Want To Public License, Version 2,
* as published by Sam Hocevar. See the COPYING file for more details.
*/
/*
* Easing Functions - inspired from http://gizma.com/easing/
* only considering the t value for the range [0, 1] => [0, 1]
*/
EasingFunctions = {