.box-shadow () { -webkit-box-shadow: @arguments }
content: "hello @{var}"; // replaced with value of @var
| <!DOCTYPE html> | |
| <!-- Helpful things to keep in your <head/> | |
| // Brian Blakely, 360i | |
| // http://twitter.com/brianblakely/ | |
| --> | |
| <head> | |
| <!-- Disable automatic DNS prefetching. | |
| <?php | |
| if ( ! defined('EXT')){ | |
| exit('Invalid file request'); | |
| } | |
| $conf['app_version'] = "169"; | |
| $conf['license_number'] = "1234-1234-1234-1234"; | |
| $conf['debug'] = "1"; | |
| $conf['install_lock'] = "1"; |
| /* | |
| * matchMedia() polyfill - test whether a CSS media type or media query applies | |
| * authors: Scott Jehl, Paul Irish, Nicholas Zakas | |
| * Copyright (c) 2010 Filament Group, Inc | |
| * MIT license | |
| * dev.w3.org/csswg/cssom-view/#dom-window-matchmedia | |
| * in Chrome since m10: http://trac.webkit.org/changeset/72552 | |
| */ |
| // Original code from http://www.blog.highub.com/mobile-2/a-fix-for-iphone-viewport-scale-bug/ | |
| var metas = document.getElementsByTagName('meta'); | |
| var i; | |
| if (navigator.userAgent.match(/iPhone/i)) { | |
| for (i=0; i<metas.length; i++) { | |
| if (metas[i].name == "viewport") { | |
| metas[i].content = "width=device-width, minimum-scale=1.0, maximum-scale=1.0"; | |
| } | |
| } |
| /* | |
| Adapt.js licensed under GPL and MIT. | |
| Read more here: http://adapt.960.gs | |
| */ | |
| // Closure. | |
| (function(w, d, config, undefined) { | |
| // If no config, exit. | |
| if (!config) { |
| Choose a ticket class: <select id="tickets"></select> | |
| <p id="ticketOutput"></p> | |
| <script id="ticketTemplate" type="text/x-jquery-tmpl"> | |
| {{if chosenTicket}} | |
| You have chosen <b>${ chosenTicket().name }</b> | |
| ($${ chosenTicket().price }) | |
| <button data-bind="click: resetTicket">Clear</button> | |
| {{/if}} |
Looking at the ES5 compatibility table, several browsers provide everything often used (i. e. not Object.freeze() and friends) except Function.prototype.bind. So I just inline that. Browsers that don't provide other functions also don't include Object.getOwnPropertyNames, so I used it as my test for including the entire shim.
Note that I haven't tested it yet, and it doesn't work for the six Object functions next to each other in the Safari 5 part of the compatibility chart (Safari 5 is deemed good enough).
Update: I added JSON for IE <= 7. JSON is used in a good number of node.js modules.
#Four Ways To Do Pub/Sub With jQuery and jQuery UI (in the future)
Between jQuery 1.7 and some of work going into future versions of jQuery UI, there are a ton of hot new ways for you to get your publish/subscribe on. Here are just four of them, three of which are new.
(PS: If you're unfamiliar with pub/sub, read the guide to it that Julian Aubourg and I wrote here http://msdn.microsoft.com/en-us/scriptjunkie/hh201955.aspx)
##Option 1: Using jQuery 1.7's $.Callbacks() feature:
| #!/usr/bin/env ruby | |
| # Aside from removing Ruby on Rails specific code this is taken verbatim from | |
| # mislav's git-deploy (http://github.com/mislav/git-deploy) and it's awesome | |
| # - Ryan Florence (http://ryanflorence.com) | |
| # | |
| # Install this hook to a remote repository with a working tree, when you push | |
| # to it, this hook will reset the head so the files are updated | |
| if ENV['GIT_DIR'] == '.' |