- Website: https://stimulusjs.org/
- GitHub repo: https://github.com/stimulusjs/stimulus
- Handbook: https://stimulusjs.org/handbook/introduction
- Discourse: https://discourse.stimulusjs.org/
initialize: once, when the controller is first instantiatedconnect: anytime the controller is connected to the DOM
Homebrew is a package management system for OS X. You can read more about it here, or simply run
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"to install it.
Web fonts are pretty much all the rage. Using a CDN for font libraries, like TypeKit or Google Fonts, will be a great solution for many projects. For others, this is not an option. Especially when you are creating a custom icon library for your project.
Rails and the asset pipeline are great tools, but Rails has yet to get caught up in the custom web font craze.
As with all things Rails, there is more then one way to skin this cat. There is the recommended way, and then there are the other ways.
Here I will show how to update your Rails project so that you can use the asset pipeline appropriately and resource your files using the common Rails convention.
| // all portrait | |
| $iphone-portrait: em(320) | |
| $samsung-galaxy-portrait: em(380) | |
| $kindle-portrait: em(600) | |
| $ipad-portrait: em(768) | |
| // all landscape | |
| $iphone-landscape: em(480) |
| module ApplicationHelper | |
| def current_class?(test_path) | |
| return 'active' if request.path == test_path | |
| '' | |
| end | |
| end |
| /* | |
| * Take a set of full height screenshots for a range of screensizes. | |
| * phantomjs responsive-screens.js http://www.cnn.com/ png | |
| * | |
| * This will create a directory tree in your current directory which | |
| * mirrors the URL. All files will be named with the current time. | |
| * You can run this on a cron to build an archive of screenshots. | |
| **/ | |
| var page = new WebPage(), |
| ------------------------------- | |
| The code for the contact form | |
| ------------------------------- | |
| <div id='contact-box' class="group"> | |
| <div class="span6 clear"> | |
| <form action="/" method="post" class="well"> | |
| <label for="name">Your Name:</label> | |
| <input type="text" name="name" class="span4" placeholder="John Smith..."> | |
| <label for="email">Your email address:</label> |
| ## Prepare ################################################################### | |
| # Remove RVM | |
| rvm implode | |
| # Ensure your homebrew is working properly and up to date | |
| brew doctor | |
| brew update | |
| ## Install ################################################################### |