JasperValero.com http://jaspervalero.com Coder / Writer / Speaker Sat, 28 Feb 2015 05:09:50 +0000 en-US hourly 1 http://wordpress.org/?v=4.1.1 You Need To Know That ES6 Has Arrivedhttp://jaspervalero.com/you-need-to-know-that-es6-has-arrived/ http://jaspervalero.com/you-need-to-know-that-es6-has-arrived/#comments Thu, 26 Feb 2015 16:00:00 +0000 http://jaspervalero.com/?p=171 I’m convinced that the time to start coding in ECMAScript 6 (ES6) is now. I know a large part of the JavaScript community is waiting for a cue to begin. I’m going to share with you the signals that I’ve been seeing. If you’re not using ES6 yet, hopefully by the end of this post I will […]

The post You Need To Know That ES6 Has Arrived appeared first on JasperValero.com.

]]>
I’m convinced that the time to start coding in ECMAScript 6 (ES6) is now. I know a large part of the JavaScript community is waiting for a cue to begin. I’m going to share with you the signals that I’ve been seeing. If you’re not using ES6 yet, hopefully by the end of this post I will have convinced you to start. If you are coding in it already then you’ll have some more confirmation that you’re doing the right thing.

Inbox On Swole

One of the things I love about the JavaScript community is how active it is. You can find JavaScript resources in every medium and format. One of my favorite ways of keeping up with latest developments is by email. I couldn’t tell you how many JavaScript newsletters I’m subscribed to. The number is high though.

ES6 Newsletters

Email newsletters mentioning ES6

I usually scan through these newsletters in batches. This makes it easy to spot trends and common patterns. Right now, they’re all screaming ES6. Fifteen minutes of fame? I think it is more than that.

My belief is that we are at the tipping point. We will continue to see ES6 mentioned until it is the mainstream flavor. Then we’ll just start referring to it as JavaScript again.

The Mouths Of Giants

I’m sure you’ve heard the Sir Isaac Newton quote about “standing on the shoulders of giants”. What about the mouths of giants? It is important to take notice of what the titans in the JavaScript community have been saying about ES6.

Many well-known names in the community have shared their support of using ES6 already. I’m not talking about the type of people who take blind leaps of faith. I’m talking about JavaScript thought leaders. Thankfully, they’ve been vocal about their reasons.

Guillermo Rauch

of LearnBoost, Socket.io, Automattic

Guillermo recently said:

“For the past few months I’ve been exclusively writing ECMAScript 6 code by taking advantage of transpilation to a currently supported version of JavaScript.”

He went on to say:

“Adopting ES6 has simultaneously resulted in increased productivity (by making my code more succinct) and eliminated entire classes of bugs by addressing common JavaScript gotchas.”

Source

Brendan Eich

the creator of JavaScript, member of the ECMAScript Committee

Brendan had this to say about ES6:

“Most new features can be used now…”

Source

Dave Herman

Founder and Principal Researcher at Mozilla Research, member of the ECMAScript Committee

In an interview with Dave about ES6 he said:

“We can gather real world feedback from communities of early adopters, and the transpiler implementors become subject matter experts who can provide invaluable feedback combining the implementor’s perspective with the user developer’s perspective.”

He also touched on the positive impact it has on browsers:

“Allowing developers to start using features sooner helps provide greater pressure on browser vendors to implement features natively.”

Source

That is just a few who have made the switch to ES6. There are plenty more developers who are joining them. There are entire open source project teams who are making the change.

ES6 Called Dibs On Your Libs

A natural by-product of JavaScript engineers moving to ES6 is the migration of libraries and frameworks. The community is now starting to see projects rewritten in ES6 and support being added to them. Don’t be surprised when some of you favorite libs and tools follow suit. Maybe they already have.

Here are a few examples:

io.js

Take io.js, for example. Here we have a fork of Node.js done by the core contributors of Node.js. One of the first things they did was update the V8 JavaScript engine to support as much of ES6 as possible. You can read more about how they’ve exposed these features on the io.js ES6 page.

Meteor.js

Meteor.js adds support for ES6 with the harmony package. It allows you to write your apps in ES6. The files are then transpiled to ES5 using tools that are all within the Atmosphere ecosystem.

Backbone + ES6

In his Backbone TodoMVC + ECMAScript6 repo on Github, Addy Osmani shows us how we can build Backbone apps using ES6.

Search around for ES6 tutorials and support for your favorite JavaScript libs. Chances are you’ll find someone talking about it. If not, then considering starting the conversation yourself.

Why You Should Start Using ES6 Now

It would be foolish to ignore the growing momentum behind ES6. Now is the perfect time to start using ES6. You need this. Your team needs this. The community needs it.

Think about the vast number of JavaScript projects that exist. Now realize they all need tools and support built around them for ES6. In a way, there is a blank canvas to take advantage of. Plenty to do. Open source projects will be begging for help.

And remember the wisdom that Dave Herman shared. We can help push native browser support forward by adopting early. Let that motivate you to do your part.

Conclusion

Should you begin writing exclusively in ES6, transpiling to ES5 and shipping? I don’t know. You will have to decide if that makes sense for your projects and production environments.

You should begin using it in some capacity. This will help you avoid the last-minute rush to try and get caught up. I believe mainstream adoption is coming sooner than some might think.

I’d also like to say that I’m in the same boat. I’ve just started using ES6 myself. I’m still learning and would love to hear about your own experiences with ES6. Please share your own thoughts and ideas below in the comments.

Now that I’ve convinced you that coding in ES6 is the smart thing to do, I won’t leave you hanging. Over the next few weeks, I’ll be writing a lot about ES6. I’ll point out all its new features. I’ll show you how to get up and running in the browser with transpilation. I’ll be sharing my own experiences. I’ll also be doing a round up of the best ES6 resources. So make sure to check back often.

The post You Need To Know That ES6 Has Arrived appeared first on JasperValero.com.

]]>
http://jaspervalero.com/you-need-to-know-that-es6-has-arrived/feed/ 0
How To Boost Your .gitignore Workflow With gitignore.iohttp://jaspervalero.com/how-to-boost-your-gitignore-workflow-with-gitignore-io/ http://jaspervalero.com/how-to-boost-your-gitignore-workflow-with-gitignore-io/#comments Fri, 20 Feb 2015 16:23:31 +0000 http://jaspervalero.com/?p=130 Do you have a .gitignore template setup in your text expander or code editor snippets? Do you tediously add coverage to it over time as you find new files you don’t want committed into your Git repos? Well, now that you’ve spent all that time on it, get ready to let that old thing collect […]

The post How To Boost Your .gitignore Workflow With gitignore.io appeared first on JasperValero.com.

]]>
gitignore.io Logo

Do you have a .gitignore template setup in your text expander or code editor snippets? Do you tediously add coverage to it over time as you find new files you don’t want committed into your Git repos? Well, now that you’ve spent all that time on it, get ready to let that old thing collect some dust. We’re going to take things to the next level with gitignore.io.

I haven’t met many developers who were aware of gitignore.io yet. gitignore.io is a web service designed to help you create .gitignore files for your Git repositories. It is super easy to setup. You’ll never look back once you’ve integrated it into your workflow.

Using The gitignore.io CLI

If you’re like me you’re going to want to setup and use gitignore.io via its command line interface. For my workflow, having gitignore.io available right in Mac OSX Terminal is great. It only takes a minute or two to put into place. So let’s dive in.

Setting Up gitignore.io In Mac OSX Terminal

A couple of important things to note first:

  • I use ohmyzsh (ZSH) instead of Terminal’s default Bash shell, but this has little impact on gitignore.io setup. I’ll point out the difference when it is time. I got you covered.
  • I use iTerm2 instead of vanilla Terminal. This makes no difference where gitignore.io is concerned. So you can follow the same steps regardless of which one you use.

Step 1 – Creating A Function In Your Shell

The first thing you need to do to use gitignore.io on the CLI is add a function to your shell. This is true regardless of whether you use ohmyzsh or Bash. The only difference is a small part of the function you’ll create.

Write Straight To Your Shell Profile

If you just found yourself saying WTF dotfiles? I’ll probably go into them a bit more in a future blog post. For now you don’t have to worry about them. You can create a function in your shell using the following:

For ohmyzsh:

For Bash:

I’ll explain what this is doing without going too deep into Shell scripting. This command writes (echo) a function called gi() to your shell profile. It then reloads your shell so that the function is available and ready to use.

You can see from the commands for ohmyzsh and Bash that the function is exactly the same. The only difference in the commands is the Shell profile file you write to and reload. That is .zshrc for ohmyzsh and .base_profile for Bash.

dotfiles Version

I create and maintain my own custom dotfiles. If you do as well then this section is for you. If you already used the command above you can skip on to Step 2.

I use gi() already for some other functionality. So I instead created a function called ignore(). You can name this function whatever you want. Here is what my function looks like:

Like any function I write, this one comes well commented. I’ve also provided some usage examples.

Step 2 – Test Your Function

Remember when I told you setup was easy. I didn’t lie. Step 1 was all the setup required. But now you should test the function you created to make sure it works. If you know Shell script you already know what this function does. I’ll explain it just in case you don’t.

The function takes a single argument which is a comma separated value (CSV) of supported templates (more on supported templates later). It then makes a cURL request to the gitignore.io API. By default, the cURL request will output its results in Terminal.

That is handy for testing that the function works. You get to preview the result, which, will let you know if the function is working. You’ll also get to see what the function returns based on the templates you passed it. This is perfect for seeing what will go into your .gitignore file as well.

Now for the test. In terminal enter the following command (replacing “ignore” with whatever you called your function):

You should see the something like:

If you don’t see anything or you see errors please leave a comment and I’ll try and help you out. If your function is working then you can move on to Step 3.

Step 3 – Creating Your First .gitignore File With gitignore.io

To create your first .gitignore file just rerun the same command you used in Step 2. Only this time you’ll write the results into a .gitignore file. If you’re just learning CLI then realize that whenever you use “>” after a command and then provide a path/to/filename it will create a file in that location. If you just use the filename it will create the file in your current working directory (CWD).

Note: Before you enter the command make sure you’re okay with creating a .gitignore file in your CWD. You can also use the path/to/filename to specify another location to create the file if you don’t want to change your CWD.

So the command is:

Setting Up gitignore.io On Linux Or Windows

If you’re on either Linux or Windows you’ll be happy to know they support gitignore.io as well. Setup is slightly different, but still pretty easy. I recommend you head over the gitignore.io docs and follow the steps there.

Using The gitignore.io GUI

If you prefer to use a GUI, no worries. You can skip the CLI setup. You can instead copy and paste a template into your .gitignore file using gitignore.io itself. The home page is the GUI.

gitignore.io GUI

gitignore.io GUI

gitignore.io Supported Templates

I promised you I’d say more about supported templates. To use gitignore.io to its full potential, you’ll need to know what templates it supports. Otherwise, you may find yourself facepalming as you try to find the correct argument to pass your function.

Finding Supported Templates

You can find this using any of the following methods:

1) Use the list argument:

2) gitignore.io Documentation

3) AutoSuggest GUI on gitignore.io

My Most Used Template Combo

If you’re wondering what combination of templates I used the most, wait no longer! Here is my most used CLI command:

I use Sublime Text for almost everything. I also do a lot of work with Node.js, Grunt (I use Gulp a lot more now, but it isn’t supported yet), Bower and Sass. Some of the other engineers I work with use either Eclipse or JetBrains on Windows. This command does a pretty good job of covering all bases for most of the projects I work on.

Conclusion

The ease of setup alone should be a major selling point for you. Consistency is another great aspect that gitignore.io offers. It definitely does a great job of keeping the most common ignored files out of your repos.

Still it does have a few improvements I’d like to see. I’d love to see instructions for contributing new templates to the project (Gulp please!). I’d also love to see some version awareness. Having an easy way to check if the templates changed since you’ve created your .gitignore file would be nice.

I’m interested in hearing about your own experiences with gitignore.io. Please share your comments and thoughts below. Thanks for reading!

The post How To Boost Your .gitignore Workflow With gitignore.io appeared first on JasperValero.com.

]]>
http://jaspervalero.com/how-to-boost-your-gitignore-workflow-with-gitignore-io/feed/ 0
7 Quick Ways To Make A Text Expander Your Herohttp://jaspervalero.com/7-quick-ways-to-make-a-text-expander-your-hero/ http://jaspervalero.com/7-quick-ways-to-make-a-text-expander-your-hero/#comments Fri, 23 Jan 2015 04:56:03 +0000 http://jaspervalero.com/?p=30 You may be surprised to find out that your typing workflow may be 150 years old. If you’re not using a text expander then the way you’ve been coding and typing is from the 1800s. The good news is I’m going to give you 7 quick ways that you can put a text expander to work for […]

The post 7 Quick Ways To Make A Text Expander Your Hero appeared first on JasperValero.com.

]]>
You may be surprised to find out that your typing workflow may be 150 years old. If you’re not using a text expander then the way you’ve been coding and typing is from the 1800s. The good news is I’m going to give you 7 quick ways that you can put a text expander to work for you. Don’t worry it’s painless. You’ll never go back to that yucky, yester-century (2 centuries, technically) workflow. If you’re already using a text expander my list will give you some new ideas for making the most of it.

Text Say-what-er?

If “text expander” sounds like a made up word, I assure you it’s not. I don’t blame you though. Several years ago I worked in the shipping office of a steel building manufacturer. A prank they’d play on new hires was to send them to fetch a “metal stretcher”.

Usually the new person would wander off immediately without much thought. The request was always phrased so matter of factly that few would ever question it. It would always be fun to see just how long it would be before they came back with a “Wait a minute here!” or even “I can’t find one.” Some times they’d be gone for 20-30 minutes. One guy even disappeared for close to 2 hours as he walked about hunting unicorns.

The truth was no magical device existed that allowed you to stretch cold, hard steel. Text expanders, however, do actually exist. They’re no unicorn, but they do seem magical once integrated into your work day.

A text expander is an application, or feature, that allows you to create shortcuts. These shortcuts, when typed, expand out into bigger things. For example, you might enter “omw” and it could expand to “On my way!”

Text Expander Example - "omg" expands to "On my way!"

Basic example of a text expander in action.

That should give you the basic idea, enough to understand the list I’ll be giving you.

Let’s brush up on some history first though…

The Not-So-Modern Day Keyboard

Until recently, I assumed the QWERTY keyboard was invented in the last 30-40 years. The QWERTY keyboard has actually been around since 1873. Christopher Latham Sholes invented 5 years after he created the first successful typewriter in 1868.

The original QWERTY – Sholes typewriter, 1873. Buffalo History Museum.

The original QWERTY – Sholes typewriter, 1873. Buffalo History Museum.

It’s 142 years later and the QWERTY keyboard is still the most used keyboard in the world. You can find it used with desktop computers, tablets, gaming consoles and mobile phones. Only the functional keys that were added around the letter keys seem to change. Other than that the typing workflow hasn’t changed much in quite some time.

If you’re wondering if I’m going to say to abandon the QWERTY keyboard, relax. That is not what I’m recommending at all. I’m just as accustomed to using it as you probably are.

Go To The Next Level With A Text Expander

If you’re not using a text expander yet, then it’s time to introduce yourself to one. If you’re already using one, great! Perhaps my list will give you a few new ideas to try.

Choosing A Text Expander

I don’t want to dive too deep into any specific text expander apps in this post. What I recommend is doing a comparison on features. Try to get the most bang for your buck, based on your budget. You may want to start out with a free app to begin with, or check out a free trial. You can always upgrade to a more robust app once you’ve gotten use to using one.

Here’s a few text expanders you may want to check out:

I use aText for Mac. It has fewer features than TextExpander by Smile Software, but it has everything I need so far and is $30 cheaper. There are some more options out there that I haven’t included. Feel free to do some Googleing if you’d like to do some more comparing.

Text Expanders For Mobile – iOS, Android

There are some mobile text expanders available for both iOS and Android. For iOS, you might try TextExpander Touch. For Android, you can check out Textpansion or PhraseExpress for Android. Before you drop any cash you may want to try the text expanders that your mobile OS has built-in. Their functionality is basic, but for convenience alone they’re worth checking out.

Keyboard Shortcuts On iOS

You can set up text expansion using iOS native keyboard shortcuts using the following steps:

  1. Go to Settings > General > Keyboard > Shortcuts
  2. Click the “+” icon on the top right of the “Shortcuts” screen
  3. In the “Phrase” field enter the text you want the shortcut to expand into, E.g. Be right back.
  4. In the “Shortcut” field enter the shortcut (E.g. brb) you’ll enter to get the full phrase entered in the previous step.
  5. TEST IT OUT, the last thing you want to do is not have it work when you need it.

Personal Dictionary On Android

You can set up text expansion using Android’s Personal Dictionary using the following steps:

(Note: These steps work only with the stock Android keyboard. Tap Settings, Language & Input, and make sure you’ve selected Google Keyboard under the Keyboard & Input Methods heading.)

  1. Go to Settings > Language & Input > Personal Dictionary
  2. Select the language option that meets your needs.
  3. Tap the “+” icon on the top right of the screen.
  4. On the first line enter the text you want the shortcut to expand into, E.g. Be right back. (50 character limit)
  5. On the second line enter the shortcut (E.g. brb) you’ll enter to get the full phrase entered in the previous step.

7 Quick Ways

Without any further delay here are 7 uses for your text expander that will make it your hero.

1. Code Snippets

Chances are your favorite code editor or IDE offers support for custom snippets. You might be thinking why would I want to use a text expander for my code snippets? Well you just might be surprised.

Next time you’re using Codepen or JSFiddle think how awesome having snippets would be.

Using a text expander at Codepen

Using a text expander at Codepen

Using a text expander at JSFiddle

Using a text expander at JSFiddle

Or perhaps you’re in an interview where you’re using an online, collaborative coding tool. Many of these are a glorified text box with some light syntax highlighting. If you have snippets in your text expander you can quickly do your setup. Then all you have to do is focus on the solution for the problem they gave you. (Note: I’d recommend giving your interviewers a heads up if you plan on doing this. It could disqualify you if it goes against one of their policies. Although, I’d be a bit suspect of any company who didn’t appreciate automation. Especially when it comes to coding.)

I recommend using a text expander that allows you to sync your shortcuts. I use aText which has built-in syncing with Dropbox. If your text expander doesn’t offer syncing, you may still be able to sync it. You can do a lot of neat things with symlinks. Do some searches on Google to see what you can dig up for your OS. (If you need a hint drop a comment and I’ll see what I can do.)

2. Communication

Quite often we overlook the fact that we reuse a lot of the same phrases. We can use a text expander to speed up our communication. We can speed up the output of our most used quips and sayings!

  • “morn” ⇨ “Good morning!”
  • “rsvp” ⇨ “Please RSVP if you plan on attending.”
  • “date” ⇨ “Thursday, January 22nd, 2015″ or “1/22/15″  or any format your text expander supports
  • “rvrp” ⇨ “Please review and reply when you get the chance.”

Sometimes the repetitive nature of what we say can cause us to say them in an impersonal way. We can cheat and use the text expander to add some life and vibrance back into what we’re saying. Consider mapping things like “Hey Rick” to “Hello Rick, how’s you’re day going?” That’s just one example, but you get the idea. Use this sparingly though.

3. Remembering Things

(Note: I do NOT recommend storing sensitive information in your text expander shortcuts.)

Another thing I like to use a text expander for is memory. After many years of marriage I have no problem remembering my wedding anniversary. I still have trouble remembering some of my friends’ birthdays and anniversaries though.

I definitely recommend entering these into your calendar and setting up reminders. It is still helpful to create some shortcuts for the moments you need to know in an instant. Trust me these moments happen more than you might suspect.

Here are a few ideas to get your creative juices flowing:

  • “anny” ⇨ “July 14th” (replace with your own anniversary)
  • “jdbday” ⇨ “John Doe’s birthday is 8/16, born in 1987.”
  • “carinfo” ⇨ “License# SAMPLE1, Make: Dodge, Model: Ram, Year: 2015, Insurance Provider: XYZ Co., Insurance Policy#: 3A9433XYZ”
  • “pobox” ⇨ “PO Box 191, San Francisco, CA 94105″ (Please note this is not an actual PO Box addy.)
  • “myvision” ⇨ “Insert your personal vision statement here.”

4. Templates

Setting up templates can save you a lot of time. They are where you can get some of the biggest value from a text expander. They are well worth the time to configure.

Email Templates

This takes what you learned in Communication a few steps further. Crafting email templates will surprise you by how much time it saves. If you send the same type of email often, remember DRY (Don’t Repeat Yourself). Create a template!

A frequent email I send is a release notification (cause oh yeah, I ship baby!). The benefits for creating a template for this type of email is two-fold. First it speeds things up. Secondly, it reminds me of everything I need to include in the email.

Ticket/Issue Templates

At work we use Scrum for our product teams. Despite the method you use, it is beneficial to create issue or ticket templates. These templates will contain the format for all the info you should enter. For example, I have templates for the following:

  • Definition of Done – Static, agreed upon definition.
  • Acceptance Criteria – A template usually filled out by the Product Owner for stories or the Engineering Lead for technical tasks.
  • QA Details – Description, Steps to Replicate, Expected Result, etc.

Evernote Note Templates

This is a newer idea that I’ve explored. Like many others I use Evernote as my digital brain. I prefer working with only the task at hand in my real brain, when possible. So I send Evernote everything and then schedule it using a GTD based system.

It is great to have some templates for starting notes:

  • Meeting agendas
  • Research projects
  • Goal related tasks

5. Lists

A list is like a more powerful version of a Remembering Things type of shortcut. You can create a list shortcut for any type of list you might keep. The sky is the limit.

If someone asks you what your favorite bands are you could type “favebands”. BOOM, you now have them sitting right in front of you. I know you probably know most of these off the top of your head, so the memory value might be lower. You can, however, send them a reply with your top bands with a few keystrokes.

I’ll give you another example, with a bit more practicality. Remember the “carinfo” example I gave you earlier? That’s great if you have only one car, but what if you own 2 or more. Break out the list baby! “mycars” or “ourcars” and you can have a bulleted list pop out the deets on all of your cars.

Some other ideas:

  • Project specific technology stacks (this should be documented somewhere, but for convenience)
  • iPhone or Android installed apps (helpful when setting up a new phone or telling someone about the apps you use)
  • Favorite blogs
  • Favorite authors
  • Reading lists
  • Wishlist

The main takeaway here is lists kick ass! Add some to your text expander for a much happier workflow. Trust me.

6. Terminal Commands

Some people might categorize these in as part of Code Snippets. Others might ask, “Do you even dotfiles bro?” The answer to that is yes, yes I do. I like to keep my favorite commands and aliases both in my dotfiles and in my text expander.

Why?

Well keep in mind that you’re not always in your own shell. There are plenty of times as developers where we’re working on a remote shell via SSH. Few times do you find a remote shell setup with your favorite tricks and shortcuts. With a text expander you can still have a few tricks up your sleeve.

For example, one of my most used commands is a grep search with color output. The next time you need to find every instance of a string within files in a directory, recursively, try this:

 $ grep -r -i -n --color='auto' "your search text goes here" *

I have that setup with the shortcut: “,greps”

7. URLs

A bookmark manager is a hell of a thing. It allows you to organize all your favorite sites and get to them with just a few clicks. I find bookmarks work great for front pages and specific articles.

For deeper links with non-typical structure it can be helpful to have some shortcuts. At work we use Atlassian JIRA for issue and story tracking. If I click on my bookmark it takes me to the default view for JIRA. This means I have several more clicks to reach a specific ticket.

So I setup a shortcut that expands out the entire first part of the URL for direct access to a ticket. All I have to do is enter the ticket number at the end of it and hit enter. This saves me a lot of time.

Another great way I’ve found to use URL shortcuts is with API queries. I do a lot of work tying up front ends to backend services. When testing responses from an API, it helps to have some quick ways to enter the queries. I find this true for both endpoints with query strings and ones that are RESTful.

Conclusion

My goal is to motivate you to try out a text expander or add to your existing shortcuts. It does save a lot of time and automate a lot of things for you. I took a lot longer than I should have before I added one into my workflow.

I want to remind you again to not put sensitive information into your shortcuts. It may be tempting to create a “cccard” or “bankacct#” shortcut. Perhaps some login credential shortcuts. Be safe, be smart.

Lastly, I want to say that this post did not touch on advanced uses of text expanders. I’d be happy to do another post on advanced techniques in the future. If this is something that would interest you make sure to let me in the comments below.

Don’t forget to subscribe (bottom right) so you get notified of my new posts!

The post 7 Quick Ways To Make A Text Expander Your Hero appeared first on JasperValero.com.

]]>
http://jaspervalero.com/7-quick-ways-to-make-a-text-expander-your-hero/feed/ 0
How To Install Sinon.JS In The Browser With Bowerhttp://jaspervalero.com/install-sinon-js-browser-bower/ http://jaspervalero.com/install-sinon-js-browser-bower/#comments Thu, 22 Jan 2015 07:05:54 +0000 http://jaspervalero.com/?p=73 Just a quick tip for those of you using Bower to install Sinon.JS for unit testing in the browser. Hopefully you’ll avoid scratching your head like I did when things didn’t work out as expected when using the registered Bower package. The solution is sometimes so easy, but it can still take a little time to find. […]

The post How To Install Sinon.JS In The Browser With Bower appeared first on JasperValero.com.

]]>
Sinon.JS + Bower

Just a quick tip for those of you using Bower to install Sinon.JS for unit testing in the browser. Hopefully you’ll avoid scratching your head like I did when things didn’t work out as expected when using the registered Bower package. The solution is sometimes so easy, but it can still take a little time to find.

Installing Using The Registered Sinon.JS Bower Package

If you do a standard:

$ bower install sinon

You will be successful in installing Sinon.JS, however, you will have trouble using it in the browser. This is because the Bower package is not a built version. What you’re given is all the components, not a complete file ready for use in the browser.

So if you’ve already installed it go ahead and uninstall it using:

$ bower uninstall sinon

(Note: Remember to use the –save-dev flag if you used it when installing. This will make sure that you remove the dependency in your bower.json file as well.)

Alternative Bower Package Installation Methods

So to solve the problem we need to install a built version. Remember that Bower install API allows us to install dependencies using any of the following for <package>:

Registered package namejquery
normalize.css
Git endpointhttps://github.com/user/package.git
git@github.com:user/package.git
Local foldermy/local/folder/
Public Subversion endpointsvn+http://package.googlecode.com/svn/
Private Subversion endpointsvn+ssh://package.googlecode.com/svn/
svn+https://package.googlecode.com/svn/
Shorthand (defaults to GitHub)user/package
URLhttp://example.com/script.js
http://example.com/style.css
http://example.com/package.zip (contents will be extracted)
http://example.com/package.tar (contents will be extracted)

Installing Sinon.JS Using Release URLs

Normally if I don’t find the package I need in Bower, I try to use a Git endpoint. Sinon.JS did not seem to offer one for built versions of the file, so I used the URL of the current release (v1.12.2 at the time I wrote this post).

$ bower install http://sinonjs.org/releases/sinon-1.12.2.js

You can replace the version sinon-1.12.2.js with sinon-x.x.x.js where x.x.x = the major.minor.patch of the version you’re wanting to use. For a full listing of versions current and old visit the Sinon.JS download page.

Finding The Path To Use In Your HTML

You can quickly find the path to use in your HTML page using:

$ bower list -p 

That will list out the paths for all of your current installed Bower packages. Copy and paste the path for Sinon.JS (it will probably show up as ‘sinon-1.12.2′) into your HTML page and start unit testing away.

I hope this saves you some time.

The post How To Install Sinon.JS In The Browser With Bower appeared first on JasperValero.com.

]]>
http://jaspervalero.com/install-sinon-js-browser-bower/feed/ 0
Why I Think Feedback Loops For All The Things Is Awesomehttp://jaspervalero.com/why-i-think-feedback-loops-for-all-the-things-is-awesome-2/ http://jaspervalero.com/why-i-think-feedback-loops-for-all-the-things-is-awesome-2/#comments Wed, 07 Jan 2015 20:51:04 +0000 http://jaspervalero.com/?p=11 The world of product development is a scary place without feedback loops working for us at all times. Would you believe me if I told you a sudden epiphany hit me out of nowhere and I instantly realized just how many decisions in life that people make based on assumptions? I’m not talking small, fill-in-the-gap assumptions […]

The post Why I Think Feedback Loops For All The Things Is Awesome appeared first on JasperValero.com.

]]>
The world of product development is a scary place without feedback loops working for us at all times. Would you believe me if I told you a sudden epiphany hit me out of nowhere and I instantly realized just how many decisions in life that people make based on assumptions? I’m not talking small, fill-in-the-gap assumptions either, I’m talking about blatant ignorance driving full speed down the road while we ride shotgun with no seat belt. If we’re lucky it’s driving on the right side of the road, but often times we allow it to drive us right into oncoming traffic. Another depiction might be driving without looking where you’re going.

Feedback loops avoid driving without looking and apocalypses!

Before I continue, please allow me take a moment to correct an assumption you may have made based on my opening question above. No it wasn’t a sudden epiphany, so you shouldn’t have believed that. It was actually several events leading up to this new year that opened my eyes wide to this fact. So let that be a lesson to you if you answered yes based on premise. Anyway, I’m a bit of a workflow hacker. I’m always looking for ways to automate things, speed things up, improve communication and increase efficiency. This last year I saw a lot of different approaches to developing products. It was a bit of a trying on shoes sort of year. Most methods I was a part of had some pros and showed at least some potential. There were of course cons too.

Plan In A Box Assumptions Just Don’t Work

Perhaps the most repetitive pattern I saw was vast dependency on assumption and speculation. Of course none of the guides, books, blog posts, etc. came right out and said that. Most attempted to promote market research, user tests and metrics and the like. Very few truly got to the root of what this truly means though. It’s an everyday practice for companies to ask their best and brightest minds to come up with products that will disrupt entire industries. They better generate an increasing amount of revenue year over year as well. With that ask they’ll hand down a deadline and ask for you to package up all the details into a 2-3 page document. Now you see, the expectation that they’ll be innovative and create some cash flow isn’t the issue. The problem is that with that deadline comes an absolute need to make some assumptions. Yes, we can do some homework and talk to some of our potential audience or target market. How presumptuous is it that this can all be done in set time period though?

Feedback Loops For All The Things!

“We must learn what customers really want, not what they say they want or what we think they should want.” -Eric Ries

Feedback loops must persevere. Products must adapt. Product teams must stay in touch with their users. Discovery and research should live and breathe throughout the entire life-cycle of our products. They have to be a part of our everyday product development process. The time between a product release and receiving feedback should also be optimized. Doing this empowers product teams to make decisions based on facts and knowledge and validated learning. This is why I think it would be awesome to add feedback loops to all the things. Every product you work on should have a framework that allows you to quickly and easily test ideas. We should make feedback loops  a central part of all that we do.

In Conclusion

So what am I asking you to do? Take some time to think about just how much assumption goes into the product development process you’re a part of. Then do your best to remove any and all decisions made on assumptions. Test all ideas and theories and use what you learn to develop awesome products that offer value to both your company and your users. Feel free to leave a comment discussing your thoughts on feedback loops or your experiences with assumptions that seem to take the wheel.

The post Why I Think Feedback Loops For All The Things Is Awesome appeared first on JasperValero.com.

]]>
http://jaspervalero.com/why-i-think-feedback-loops-for-all-the-things-is-awesome-2/feed/ 0