A PlanarFe Adventure

LearnLoveCode

JS Curry

SoMuchCurry

Now that I’m become firmly entrenched in the Javascript world, I figured it was high time that I read ‘The Good Parts’. Since I’m working in React, and since React is just just Javascript, it wasn’t too hard to get through, though one exercise took me a bit to get my head around - Curry.

Tap, Inject, and Each_With_Object

http://live2eat.typepad.com/.a/6a014e8968623c970d017d42a40c16970c-pi

I realized the other day that, while I’ve been using Object#tap, Enumerator#each#with_object, and Enumerable#each_with_object for some time now, I wasn’t completely clear on the difference between these methods or how best to employ them. Mostly I just threw in Object#tap wherever I saw sandwich code and called it a day.

Time for a…

http://40.media.tumblr.com/33dded80b572fc3f9733ba5616b7e6ed/tumblr_mv4yonGTMV1rh0tlxo2_1280.jpg

Keyword Arguments

During a morning standup (less fun than actual standup) at work someone mentioned that a method was a good candidate for a refactor using Keyword Arguments. So I went back to my desk, googled it, and my newb brain said ‘Why?’.

A New Hash#map

https://www.etsy.com/shop/bananastrudel?ref=l2-shopheader-name

The Problem

The Enumerable mixin’s #map/#collect methods are fantastic for mutating the values in an array but have an inconsistent behavior when applied to a hash. So since using #map/#collect on an array gives you this:

1
2
[1,2,3].map{|i| i*i}
#=> [1,4,9]

you might expect the hash to behave something like this:

1
2
{a: 1, b: 2, c: 3}.map{|k,v| k: v*v}
#=> {a: 1, b: 4, c: 9}

but instead you get: SyntaxError: (irb):1: syntax error, unexpected ':', expecting '}'

Everyday Rails: Testing With RSpec

What’s a pirate’s favorite testing framework? ArrrrrrrrSpec!

This past week I’ve been working through Aaron Sumner’s “Everyday Rails Testing with RSpec” in order to bone up on my TDD. This is the CliffsNotes version since, unlike ‘Romeo and Juliet’, you can’t run down to Blockbuster and rent the movie. Mostly because good luck finding a Blockbuster and also, not a lot of movies about Rails… or RSpec… I didn’t notice any model specs in the 1995 classic ‘Hackers’.

<-MACHINE->

“Finite State Machines” is one of those terms that I’ve heard mentioned but never found the time to look into. Now that I’ve finished my three months at the Flatiron School I figured that I would give it a look.

3Dify Yourself: Three.js

Three.js is a Javascript library designed to be used to render 3D objects and animations in the browser using WebGL. It allows you to create animations without relying on proprietary plugins using the end-users GPU and as well as providing a bunch of classes and functions to let you skip a whole bunch of programming and move straight to the animating.

Primes With Regex

I ran across a blog post explaining how you can use regular expressions to determine if a number is prime. It seems like an odd use and it has been a while (kinda? Like four whole weeks!) since I’ve used regular expressions so it took a a bit of time and a whole lot of whiteboard space to figure out what was happening so this is the post topic that you’re getting god dammit!