Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
| /* | |
| == Tim == | |
| A tiny, secure JavaScript micro-templating script. | |
| This has now moved to: | |
| github.com/premasagar/tim | |
| */ |
| /* A lightweight templating system. | |
| * | |
| * Based on Tim (http://github.com/premasagar/tim) and Mustache | |
| * (http://github.com/janl/mustache.js). | |
| * | |
| * Template supports simple value replacement as well as block | |
| * functions, iterators and conditionals | |
| * | |
| * Template strings can contain either plain tokens `{{token}}` | |
| * which are replaced with their equivilent value in the data |
| {!-- build result rows --} | |
| {exp:stash:set parse_tags="yes"} | |
| {stash:results_rows} | |
| {exp:channel:entries | |
| channel="my_channel" | |
| limit="10" | |
| paginate="bottom" | |
| } | |
| <tr> |
| var cat = {}; | |
| /** | |
| * cat.NewsBox | |
| * Retrieves news from Google | |
| */ | |
| cat.NewsBox = (function(){ | |
| function NewsBox(searchTerm, injectFn) { | |
| this.searchTerm = searchTerm; |
| /* | |
| NOTE!!!! | |
| The most updated version of this code is here: | |
| https://github.com/scottjehl/iOS-Orientationchange-Fix |
Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
| if (typeof (AC) === "undefined") { | |
| AC = {} | |
| } | |
| AC.ImageReplacer = Class.create({ | |
| _defaultOptions: { | |
| listenToSwapView: true, | |
| filenameRegex: /(.*)(\.[a-z]{3}($|#.*|\?.*))/i, | |
| filenameInsert: "_☃x", | |
| ignoreCheck: /(^http:\/\/movies\.apple\.com\/|\/105\/|\/global\/elements\/quicktime\/|_(([2-9]|[1-9][0-9]+)x|nohires)(\.[a-z]{3})($|#.*|\?.*))/i, | |
| attribute: "data-hires", |
I'm a fan of MiniTest::Spec. It strikes a nice balance between the simplicity of TestUnit and the readable syntax of RSpec. When I first switched from RSpec to MiniTest::Spec, one thing I was worried I would miss was the ability to add matchers. (A note in terminology: "matchers" in MiniTest::Spec refer to something completely different than "matchers" in RSpec. I won't get into it, but from now on, let's use the proper term: "expectations").
Let's take a look in the code (I'm specifically referring to the gem, not the standard library that's built into Ruby 1.9):
# minitest/spec.rb
module MiniTest::Expectations| #!/usr/bin/env sh | |
| ## | |
| # This is script with usefull tips taken from: | |
| # https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
| # | |
| # install it: | |
| # curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
| # |
| <script> | |
| document.write('<script src=' + | |
| ('__proto__' in {} ? 'zepto' : 'jquery') + | |
| '.js><\/script>') | |
| </script> |