xScope command to copy colors

This one will benefit maybe one person out there…ever.

If you want to copy a color you are hovering over in xScope. Hover over the color you want and hit:

ctrl + cmd + optn + c

GLSL Functions Explained

UPDATE: Actually, you don’t need to read further, instead go here: http://thebookofshaders.com/glossary/


Disclaimer: I’m in no way an expert on GLSL, graphics programing, or anything else in the world, really…

However, I’m finding it difficult to find good docs on WebGL functions, that explain in layman’s terms what the hell they do. So I’m starting a list here and updating it as I learn more. Also, if I’m wrong, tell me, I don’t want to give out bad information.


float step(float a, float b)

  • returns a float value of either 0.0 or 1.0 depending on if “b” is higher or lower than “a”
  • “a” represents the limit or threshold to cross
  • “b” represents the number to test against the threshold

float smoothstep(float a, float b, float c)

  • returns a float value of anywhere from 0.0 to 1.0. 0.0 for any “c” value below “a” and 1.0 for any “c” value above “b”. The “c” values in between the “a” and “b” range are interpolated
  • “a” represents the start of the range (threshold)
  • “b” represents the end of the range (threshold)
  • “c” represents the value to test against the range

float fract(float a)

  • returns only the fraction portion of a value. So given the value 3.14159265358979, it will return .14159265358979


ThreeJS Setting the Right Aspect Ratio for the Camera

Quick note for myself and anyone who will ever use this…

if you are working with an abnormal size canvas. Just do this to set the size of the renderer to be correct with the aspect ratio:

let rect = this.renderer.domElement.getBoundingClientRect();
		camera.aspect = rect.width / rect.height;
		renderer.setSize( rect.width, rect.height );

That’s it that’s all

Finder Won’t Show Image Dimensions

You’ve got something that looks like this:


You have to tell finder to re-index a bunch of shit. Just run the following (keep in mind this will take quite a while but it runs in the background so whatevs.

sudo mdutil -E -i on /



iDevice Continuously Reconnects USB

You plug in your iphone/ipad and it just continuously reconnects…

some people say its the cord others say its privacy settings

I say its the disk utility…

Just disconnect and open Disk Utility > First Aid and run it, then reconnect the device.




Photoshop paste into a layer mask

You want to create a layer mask and paste an image into it

  1. copy the image you want in the mask
  2. create a new layer and put black over the whole thing
  3. add a layer mask and option click it to get into the mask edit mode
  4. cmd + optn + shft + v to paste the image into the mask
  5. cmd + i to invert it
  6. profit


Look here



Find the (x,y) coordinates of an index value in an array

Let’s say you have an array of blocks that you want to draw to a canvas. Let’s also say you want to compute the (x,y) coordinates of a specific item in the array. There’s a formula for that:

var blockSize = 2;
var totalBlocks = (canvas.width / blockSize) * (canvas.height / blockSize);
var cursor = index % totalBlocks;
var columns = canvas.width / blockSize;
var x = (cursor % columns) * blockSize;
var y = (cursor / columns) * blockSize;

All this does is count up to the index taking into account the fact you need to wrap blocks of a certain size.

If you don’t need a specific block size and are just using single pixels as a block size, then the formula becomes even simpler:

var x = index % columns;
var y = index / columns;

That’s it~

How to show transparency on Blender texture

If you want show transparency on a blender texture and it’s not showing up when you set the view mode to “texture” then you need to do this:

Map your UVs how you would. Then set the texture alpha channel to 1.0:

Then set your z-transparency to 0.0: