Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
| # This is an example of metaprogramming in the Elixir language. | |
| # | |
| # We will define a domain specific language (DSL) for the definition | |
| # of a service which is watched by several sensors. | |
| # Each sensor watches some property/functionality of the service and | |
| # returns the result of the check. | |
| # | |
| # To determine if the service is functioning properly, we need functions | |
| # to run all the sensors' code and gather the returned data. | |
| # |
| -# HTML5 doctype | |
| !!! 5 | |
| !!! strict | |
| !!! XML | |
| %html | |
| -#ie conditionals | |
| /[if IE] | |
| %a{ href: "http://www.mozilla.com/en-US/firefox/" } |
Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
| // EntryPoint.js | |
| define(function () { | |
| return function EntryPoint(model1, model2) { | |
| // stuff | |
| }; | |
| }); | |
| // Model1.js | |
| define(function () { | |
| return function Model1() { |
If you're using [ASP.NET MVC3][], it uses [jQuery Validate][] to do client-side validations. Instead of using [jQuery Validate][] directly, however, it wraps it with its own jQuery plugin called [jQuery.Validate.Unobtrusive][]. [jQuery.Validate.Unobtrusive][] sets up [jQuery Validate][] for you, behind the scenes, so you don't have an opportunity to customize your [jQuery Validate][] settings at all!
We've been running into trouble with this when we've been doing our own custom client-side validations. We need a way to integrate with the build-in [ASP.NET MVC3][] validation so we can:
| /* | |
| * Example #1 : usage example | |
| * - Image paths are relative to the HTML file. | |
| * - Support absolute paths as well. | |
| * - Appending `!bust` to the end of the file name will avoid caching the image. | |
| */ | |
| require(['image!lol_cat.gif', 'image!http://tinyurl.com/4ge98jz', 'image!dynamic_image.jpg!bust'], function(cat, awesome, dynamic){ | |
| //add loaded images to the document! | |
| document.body.appendChild(awesome); | |
| document.body.appendChild(cat); |