- Create a gist if you haven't already.
- Clone your gist:
# make sure to replace `<hash>` with your gist's hash git clone https://gist.github.com/<hash>.git # with https git clone git@gist.github.com:<hash>.git # or with ssh
Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.
This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would
The Three.js Blender exporter has been broken for at least the last 10 releases of Three.js. It's had at least 20 individual authors and contributors, most of whom have left the project never to return. Nevertheless, I have successfully imported animated (both with rigging and morph target) meshes into Three.js. Here's all the things I've encountered which you need to know about:
- The exporter flips all vertices, faces, etc in the mesh you export. There used to be a "Flip Y/Z" option in the exporter, but it was removed when the exporter was rewritten. Since then speculation is the Blender API changed, or some other change after this one mangled the faces on export. For now we're stuck with it until we track it down.
- mrdoob/three.js#8723 Invalid json is exported for all files with animations, so you have to delete a key manually from the json
- mrdoob/three.js#8710 morph target exporting doesn't work with "a
Install xvfb
apt-get install xvfb x11-xkb-utils xfonts-100dpi xfonts-75dpi xfonts-scalable xfonts-cyrillic x11-apps
Some tips at: xvfb init script for Ubuntu
| // Simulate a call to Dropbox or other service that can | |
| // return an image as an ArrayBuffer. | |
| var xhr = new XMLHttpRequest(); | |
| // Use JSFiddle logo as a sample image to avoid complicating | |
| // this example with cross-domain issues. | |
| xhr.open( "GET", "http://fiddle.jshell.net/img/logo.png", true ); | |
| // Ask for the result as an ArrayBuffer. | |
| xhr.responseType = "arraybuffer"; |
| # put this in your .bash_profile | |
| if [ $ITERM_SESSION_ID ]; then | |
| export PROMPT_COMMAND='echo -ne "\033];${PWD##*/}\007"; ':"$PROMPT_COMMAND"; | |
| fi | |
| # Piece-by-Piece Explanation: | |
| # the if condition makes sure we only screw with $PROMPT_COMMAND if we're in an iTerm environment | |
| # iTerm happens to give each session a unique $ITERM_SESSION_ID we can use, $ITERM_PROFILE is an option too | |
| # the $PROMPT_COMMAND environment variable is executed every time a command is run | |
| # see: ss64.com/bash/syntax-prompt.html |
| /* Quadtree by Ozan Turgut (ozanturgut@gmail.com) | |
| A Quadtree is a structure for managing many nodes interacting in space by | |
| organizing them within a tree, where each node contains elements which may | |
| interact with other elements within the node. This is particularly useful in | |
| collision detection, in which a brute-force algorithm requires the checking of | |
| every element against every other element, regardless of their distance in space. | |
| This quadtree handles object in 2d space by their bounding boxes. It splits | |
| a node once it exceeds the object limit per-node. When a node is split, it's |
| #!/bin/bash | |
| # This is an improved script of pngfix.sh (https://gist.github.com/404909) | |
| # which can also crush/shrink/optimize/losslessly compress JPEGs and GIFs. | |
| # It is recommended you backup your image files before executing this script. | |
| # Operation will be skipped if output file is bigger in size. | |
| # | |
| # use chmod +x crushimg.sh to make it executable and then ./crushimg.sh to run, or | |
| # bash ./crushimg.sh to run it directly | |
| # | |
| # ./crushimg.sh [FILE] - (default to current directory) |
| Handle<Value> params[2] = { | |
| String::New("child"), // event name | |
| String::New("somevalue") // event name | |
| }; | |
| v8::Local<v8::Object> ctx = Context::GetCurrent()->Global(); | |
| MakeCallback(ctx, "emit", 2, params); |
| /** | |
| * Prototype for recursively iterating over an array of | |
| * arrays. | |
| * @author Dave Mackintosh | |
| * @param callback function | |
| */ | |
| Array.prototype.recursiveArrayIterator = function (cb) { | |
| this.forEach(function (obj, inx) { | |
| // If it's an array we want to fire another iterator | |
| // with our parent array as a separate argument |