Create a file called layout.php. Where you want the content to
appear add <?php echo $content ?>. Here is an example:
| echo "\e[1m\e[34m ,%%%, \e[0m" | |
| echo "\e[1m\e[34m ,%%%` %==-- \e[0m" | |
| echo "\e[1m\e[34m ,%%`( '| \e[0m" | |
| echo "\e[1m\e[34m ,%%@ /\_/ \e[0m" | |
| echo "\e[1m\e[34m ,%.-\"\"\"--%%% \"@@__ \e[0m" | |
| echo "\e[1m\e[34m %%/ |__`\ \e[0m" | |
| echo "\e[1m\e[34m .%'\ | \ / // \e[0m" | |
| echo "\e[1m\e[34m ,%' > .'----\ | [/ \e[0m" | |
| echo "\e[1m\e[34m < <<` || \e[0m" | |
| echo "\e[1m\e[34m `\\\ || \e[0m" |
Every programming community quickly converges on a style, an accepted set of idioms. Programming is all about communication and knowing those idioms are key to being a successful programmer in that community.
Ruby style of programming:
- Code should be crystal clear, it should shout its intent
- Good code is also concise
Ruby indentation convention:
- Make the Web Faster
- Best Practices for Speeding Up Your Web Site
- Browser Cache Usage
- Key takeaway: Keep in mind the empty cache user experience. It might be more prevalent than you think!
- Gzip Using PHP
- Important to note: The method of adding this snippet of code
<? ob_start("ob_gzhandler"); ?>did not work when I tried it. The.htaccessmethod in the article on How To Optimize Your Site With Gzip Compression worked however.
- Important to note: The method of adding this snippet of code
- How To Optimize Your Site With Gzip Compression
- Evaluating network performance - Chrome Dev Tools
This guide currently uses Ruby 1.9.3, Rails 3.2 and Ubuntu 13.04 (Raring Ringtail). I started off with a fresh install of Ubuntu on a virtual machine.
-
Install RVM. See http://rvm.io/rvm/install for all the details.
$ sudo apt-get install curl
$ \curl -L https://get.rvm.io | bash -s stable
| // Thanks to CSS Tricks for the inspiration: http://css-tricks.com/equidistant-objects-with-css/ | |
| @mixin horizontal-list-span-width { | |
| margin: 0; | |
| padding: 0; | |
| list-style-type: none; | |
| text-align: justify; | |
| &:after { |
Firstly, you've got to see it to believe it. Then, when you're all excited follow the steps below to set it up as a plugin for Sublime Text 2 on Ubuntu 13.04.
$ rvm 2.0.0@sublime-text-2 --create$ gem install seeing_is_believing$ cd ~/.config/sublime_text_2/Packages$ git clone git://github.com/JoshCheek/sublime-text-2-seeing-is-believing.git SeeingIsBelieving
Rails provides an API that we can use to create our own renderers. In this chapter we explore the API as we modify the render() method to accept :pdf as an option and return a PDF created with Prawn.
To create a new plugin just run the following:
$ rails plugin new my_plugin
TODO Complete notes
Unmaintainable templates result from the following:
- Markup repetition
- Logic in templates