NOTE I now use the conventions detailed in the SUIT framework
Used to provide structural templates.
Pattern
t-template-name
| (function($){ | |
| $.widget("ui.mywidget", { | |
| options: { | |
| autoOpen: true | |
| }, | |
| _create: function(){ | |
| // by default, consider this thing closed. |
| /* | |
| * Updated to use the function-based method described in http://www.phpied.com/social-button-bffs/ | |
| * Better handling of scripts without supplied ids. | |
| * | |
| * N.B. Be sure to include Google Analytics's _gaq and Facebook's fbAsyncInit prior to this function. | |
| */ | |
| (function(doc, script) { | |
| var js, | |
| fjs = doc.getElementsByTagName(script)[0], |
| .box { | |
| -moz-box-shadow: 5px 9px 5px 5px rgba(0, 0, 0, 0.75); | |
| -webkit-box-shadow: 5px 9px 5px 5px rgba(0, 0, 0, 0.75); | |
| -o-box-shadow: 5px 9px 5px 5px rgba(0, 0, 0, 0.75); | |
| box-shadow: 5px 9px 5px 5px rgba(0, 0, 0, 0.75); | |
| } |
NOTE I now use the conventions detailed in the SUIT framework
Used to provide structural templates.
Pattern
t-template-name
| ## Prepare ################################################################### | |
| # Remove RVM | |
| rvm implode | |
| # Ensure your homebrew is working properly and up to date | |
| brew doctor | |
| brew update | |
| ## Install ################################################################### |
| var BaseView = Backbone.View.extend({ | |
| close: function() { | |
| this.closeSubviews(); | |
| this.unbindFromAll(); | |
| this.off(); | |
| this.remove(); | |
| if (this.onClose) this.onClose(); | |
| }, |
http://socialdriver.com/2012/07/20-best-responsive-websites/ lists 20 sites that are supposedly best-in-class when it comes to responsive design techniques. I had a look at the viewport meta tags used in these sites.
width=device-width, with in most cases an additional initial-scale=1. This is good practice.However:
maximum-scale to 1, or using user-scalable=no. While there are some corner use cases for this, it does not make sense to do this on text-heavy sites as it impairs accessibility.| _.mixin({ | |
| // Get/set the value of a nested property | |
| deep: function (obj, key, value) { | |
| var keys = key.replace(/\[(["']?)([^\1]+?)\1?\]/g, '.$2').replace(/^\./, '').split('.'), | |
| root, | |
| i = 0, | |
| n = keys.length; |
| @import compass | |
| $icons: sprite-map("icons/*.png") | |
| $icons-hd: sprite-map("icons-hd/*.png") | |
| i | |
| background: $icons | |
| display: inline-block | |
| @media (-webkit-min-device-pixel-ratio: 1.5), (min-resolution: 144dpi) | |
| background: $icons-hd |
| @main-font-size: 16px; | |
| .x-rem (@property, @value) { | |
| // This is a workaround, inspired by https://github.com/borodean/less-properties | |
| @px-fallback: @value * @main-font-size; | |
| -: ~`(function () { return ';@{property}: @{px-fallback}'; }())`; | |
| -: ~`(function () { return ';@{property}: @{value}rem'; }())`; | |
| } |