How to Wire/Control a Relay with Arduino or Raspberry Pi

Let’s say you want to control a light/air pump/device from a microcontroller or raspberry pi… We’re assuming the device in question is one that can easily be controlled simply by turning the power on and off. You can use a relay. Basically these things are physical switches mounted inside a block with a small inductive coil next to it. When you push

Recursive Function to Capitalize Words in an Array

Every once in a while, someone writes something bullet proof in as little as a couple lines. Here’s something I got off code academy that I thought might be useful to people: // Our array of messy words var capitals = [“berlin”, “parIs”, “MaDRiD”]; // Capitalize function function capitalize(word) { return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase(); } // Our recursive function function

Custom Linked Images in WordPress Page Gallery

Let’s say you spent all weekend building your girlfriends portfolio site and you want an easy way to output linked images on a page. You might think “easy enough, I’ll just put in a gallery on the page. She can manage her images from there!” But then you hand your site to your gf and she says “can I link

Slow Recursion

Let’s say you want to do something in a for loop, but you can’t seem to make it run with a delay in between loop iterations (let’s assume you’re working in something like JavaScript where the “setTimeout” function is non-blocking and will execute immediately). Not to worry, the standard approach would be to write a recursive algorithm and do “setTimeout”

Web Speech API

Made a quick library (https://github.com/newshorts/WebSpeechJS) last week that’s working alright for me. Thinking of making it an actual project on github. Just wanted to post a little blurb about it here, before I add documentation and make it a real thing. It’s called WebSpeechJS. Basically, it just makes it easy to loop the web speech API return (primitive and final)

IOS Safari Partial Support of Web Speech API

I’ll keep this short. If you’re looking to use the speech recognition capabilities of the Web Speech API on safari mobile (or safari for that matter) 7.1+ forget it. If you check out caniuse.com you’ll see that mobile safari only supports the speech synthesis part of the API (text –> speech). Android on the part support speech recognition in the browser. Just

jQuery “extend” as an Object Merger

Let’s say you’re creating a class and want to load in some “options”. You could write you’re own defaults and up with a huge top heavy class…or you could let jQuery do the work for you. [pastacode lang=”javascript” message=”” highlight=”” provider=”manual”] function MyClass($, options) { var __ = this; var defaults = { // callback onResult: function(data) {}, // attribute color:

GSP First Floor

Just thought I’d capture the first floor in a 360 photo sphere and then put it up to show people our space! DEMO

Embed Adobe Edge Animation on Your Page

NOTE: if you’re looking for the “triggering events from within an adobe edge animation to the page” look here: https://iwearshorts.com/blog/triggering-events-from-within-edge-animations-to-the-page/ This tutorial will show you how to embed an adobe edge animation onto an existing page within your site. TL;DW Publish the adobe edge animation (File -> publish). Find the file, and copy the adobe runtime block and the stage div: 1.