Here are a few common tasks you might do in your templates, as they would be written in ExpressionEngine vs. Craft CMS.
| (function () { | |
| var labels, label, inputs, input, type, i, ilen; | |
| if (!document.addEventListener) { | |
| labels = document.getElementsByTagName('label'); | |
| inputs = document.getElementsByTagName('input'); | |
| function inputClick() { | |
| clicked = window.event.srcElement; |
| {# Shows all categories in the news group #} | |
| {% set categories = craft.categories.group('news') %} | |
| <ul> | |
| {% nav category in categories %} | |
| <li> | |
| <a title="{{ category.title }}" href="{{ category.url }}">{{ category.title }}</a> | |
| {# Output a nested <ul> if this category has any children #} | |
| {% ifchildren %} | |
| <ul>{% children %}</ul> |
| $config['ce_image_document_root'] = '/usr/home/site_username/www/'; | |
| //remove the extra '/~site_username' from the source | |
| $config['ce_image_src_regex'] = array( '/~site_username' => '' ); | |
| //after the image is manipulated, replace the first '/' | |
| //with the extra '/~site_username/' so it works with the URL | |
| $config['ce_image_made_regex'] = array( '^/' => '/~site_username/' ); |
| # --------------------------------------------------------------------------- | |
| # | |
| # Description: This file holds all my BASH configurations and aliases | |
| # | |
| # Sections: | |
| # 1. Environment Configuration | |
| # 2. Make Terminal Better (remapping defaults and adding functionality) | |
| # 3. File and Folder Management | |
| # 4. Searching | |
| # 5. Process Management |
| "First Name","Email" | |
| {exp:freeform:entries | |
| form_name="contact" | |
| orderby="entry_date" | |
| sort="asc" | |
| limit="9999" | |
| }"{freeform:field:first_name}","{freeform:field:email}" | |
| {/exp:freeform:entries} | |
| <?php |
| // Just before switching jobs: | |
| // Add one of these. | |
| // Preferably into the same commit where you do a large merge. | |
| // | |
| // This started as a tweet with a joke of "C++ pro-tip: #define private public", | |
| // and then it quickly escalated into more and more evil suggestions. | |
| // I've tried to capture interesting suggestions here. | |
| // | |
| // Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_, | |
| // @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant, |
| this worked very nice for a single page site | |
| ``` | |
| wget \ | |
| --recursive \ | |
| --page-requisites \ | |
| --convert-links \ | |
| [website] | |
| ``` | |
| wget options |
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
⇐ back to the gist-blog at jrw.fi
Or, 16 cool things you may not have known your stylesheets could do. I'd rather have kept it to a nice round number like 10, but they just kept coming. Sorry.
I've been using SCSS/SASS for most of my styling work since 2009, and I'm a huge fan of Compass (by the great @chriseppstein). It really helped many of us through the darkest cross-browser crap. Even though browsers are increasingly playing nice with CSS, another problem has become very topical: managing the complexity in stylesheets as our in-browser apps get larger and larger. SCSS is an indispensable tool for dealing with this.
This isn't an introduction to the language by a long shot; many things probably won't make sense unless you have some SCSS under your belt already. That said, if you're not yet comfy with the basics, check out the aweso