Simple Shader with ThreeJS

Ok folks, it doesn’t get easier than this. If you want to start writing shaders in the browser but can’t figure out how to create your shader program, ThreeJS has you covered: In your JS   In your head:      

Finding A Pixel in Canvas Image Data

I never have time, so this will be quick. Let’s say we want to find a pixel index amoung all that image data canvas returns with: The formula is simple: Basically, you need to draw this one out. Let’s say we have a 3×3 image. Each pixel would have it’s own zero based index. The width would be three. Each

Mars VR Demo

Just wanted to post this. The source is pretty self explanatory and i’ll put up a github later once I clean up a few things. I’ll explain later. Be patient, it takes a second to load. DEMO –>

XHR Doesn’t Return responseURL in iOS8

So you’ve been making ajax calls and everything is going great. Your onSuccess message looks something like this: All of a sudden your QA professional says things aren’t working in iOS8! No prob, bob. It’s actually that iOS8 and below doesn’t return a “responseURL” attribute of the xhr object. Look at the difference: iOS8 xhr object: Everything else: Anyway…

Vertical Center in CSS Without Transform

This one is quick. Usually you can do: But sometimes you need to vertically center something without the use of transforms. Here’s a little snippet: If you don’t know the height of the parent (as is most cases) this might work: And here’s a little demo. The “marker” div is using transforms. The “centered” div isn’t:   See the Pen

Downloading Batch Images From S3

I know I know… You’re afraid of the CLI, there’s not a good chrome extension and you can’t be bothered to boot up Firefox just for s3fox… Dude, the CLI is so simps:    

Securing Your Linux Server

There’s a great post about securing your new linux server (ubuntu) here: I wanted to summarize here and explain some details. To start, create a password for your user (root) Make a new userĀ for day to day logins (production) Require ssh logins instead of username/password Remove root login Only allow login from specific IP (if using a static IP)

Lost My Box Tool – XScope

  If you lose your box tool: You can get it back by selecting it, as I’ve done in the photo above, then hitting “cmd + shft + 5” Boom.