Download audio using HTML5 Download attribute in Rails

I found so many overcomplicated solutions to solve this, so I wanted to share a simplistic solution that I use. My goal: Let the user download an audio file that is stored in AWS by clicking on a download icon.

This solution above uses a FontAwesome shortcut and the HTML5 download attribute on my Song show page. I use carrierwave to upload my media…

Read More

Create a Javascript console in Sublime

STEP 1: Download Node.js and run the install https://nodejs.org/en/ STEP 2: In Sublime, go to Tools > Build System > New Build System and paste the following code:

Make sure this is the only code you see. STEP 3: Save the file as “node.sublime-build” in the default “user” folder, which should already be populated for you. If you receive a [Errno 2] error when trying…

Read More

Why The Firehose Project is the best online coding bootcamp

There are so many coding boot camps popping up everywhere and it makes it really difficult to choose the right one. Especially when most of them cost thousands of dollars. After starting and leaving 4 online boot camps and turning down 2 of the top in-person boot camps, I can 100% highly recommend The Firehose Project. This school is amazing on so many levels and I’m excited to tell…

Read More

Command Line Power User

A video series for web developers on learning a modern command line workflow with ZSH, Z and related tools.

WHAT IS THIS?

11 “I had no idea you could do that” videos for web developers looking to improve their command line skills.

They cover a workflow using some of the best modern tools that relate to using command line tools such as git, npm, gulp and so on.

WHO MADE THESE?

Wes Bos – a full stack developer and teacher passionate about workflow and tooling. Wes recently released Sublime Text Power User – a book and video series on mastering Sublime Text.

Source: commandlinepoweruser.com

The difference between select and map methods

Here is a basic understanding of the .select and .map methods with real world analogies and coding examples. .select  takes a block and creates a new array of the items the block evaluates to true only. .map aka .collect  takes a block and creates a new array with all the items modified by the block. ** Map and Collect are exactly the same. Example

 

The difference between Normalizing and Resetting CSS

Normalize.css Makes browsers render all elements more consistently and in line with modern standards. It precisely targets only the styles that need normalizing. Makes elements consistent across all browsers – a foundation to start from. Nicolas Gallagher’s normalize.css is used by companies like Twitter, Github, and Soundcloud. Reset.css Reduce browser inconsistencies in things like default line heights, margins and font sizes of headings, and so on. Removes…

Read More

Building a Deck of Cards in Ruby

I would like to share this challenge I did while at The Firehose Project online bootcamp. The challenge: Build a deck of cards, shuffle them, and deal a card. The code

Thought process First, we need to build a class Card  and a method that puts out the name of the card. A card has a rank and a suit. So far this is pretty easy. Then, we…

Read More

Explaining the inject method

The inject method takes a collection and reduces it to a single value, such as a sum of values. Here are the basic workings when iterating through an array and adding the elements together:

What’s happening [1, 2, 3, 4, 5] .inject  takes the first element and does something to the second element; in this case adds it. [1, 2] equals to [3] (our new first…

Read More