Nothing gives you the edge more than creating your own toolbox to problem solve faster and more effienciently. As developers, we want to go in, keyboards blazing. But going through the motions of setting things up can easily get in your way.
Building up a treasure trove of smart tasks and shortcuts abstracts away a lot dirty work, so that you can focus on the bigger picture. You can set up tasks to automate all facets of your interaction with a program: the front end, back end, and even the keyboard. Here are some shortcuts I’ve been exploring:
Back End:
Rake Tasks
Rake tasks are part and parcel of the rails framework, but you can easily set up your own custom ones.
You can create tasks that load different environments, install themes, generate templates, seed data, organize folders, and clean up unwanted files.
All the tasks will be stored in a RakeFile, where you can handpick what gems and dependencies are required.
Rake uses an intuitive and abstracted language to explain your tasks clearly. For example, a task making a new postmay look like:
1 2 3 4 5 |
|
Or to preview a simulation
1 2 3 4 5 |
|
Gems
Extending your built in functionality is important in creating an awesome and robust program that feels intuitive.
Gems are stored in the Gemfile, which is created during the bundle install command in the Terminal. Their dependencies and versions are safeguarded by the Gemfile.lock file.
Some cool and useful gems I’ve come across:
Logstash
RubyCritic
Faker
And lots more gems on the Ruby Gems website.
Front End
Gruntfile.js
Grunt runs tasks with javascript using Node.js. It can run asynchronous tasks, check for typos in syntax, uglify files, and generate JSON. There are also tons of plugins available for Grunt. Here are some good tutorials on how to start installing a using it:
Grunt: Getting Started
Grnt.js: The Basics
Text Editors
Both Sublime Text and Atom have awesome autocompletion and snippets, however Sublime gets annoying quickly with popups to purchase their product, while atom is free.
To the more hardcore programmers, the solution is either Vim or Emacs. Vim has a lot of shortcuts and starts with them as default, and emacs allows you to customize commands across many platforms. You can learn about both in the links below: