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.
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
| "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
| <!-- | |
| Utility to generate points along a route using the Google Maps API | |
| Directions service. | |
| 2011-03-31 Rob Gabbard, cintimedia LLC, www.cintimedia.com | |
| Based on the Google Maps API Optimized Directions demo at: |
| var SomeModel = Backbone.Model.extend({}); | |
| someModel = new SomeModel(); | |
| someModel.bind("change", function(model, collection){ | |
| alert("You set some_attribute to " + model.get('some_attribute')); | |
| }); | |
| someModel.set({some_attribute: "some value"}); |
| class Thumb extends Backbone.Model | |
| defaults: | |
| uri: '' | |
| state: '' | |
| select: (state) -> | |
| st = '' | |
| st = 'selected' if state | |
| @set('state' : st) |
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.
| $(document).ready(function() { | |
| // Support for AJAX loaded modal window. | |
| // Focuses on first input textbox after it loads the window. | |
| $('[data-toggle="modal"]').click(function(e) { | |
| e.preventDefault(); | |
| var url = $(this).attr('href'); | |
| if (url.indexOf('#') == 0) { | |
| $(url).modal('open'); | |
| } else { |
| [url, height, width, output_dir] = phantom.args | |
| console.log("url #{url}, height #{height}, width #{width}, output_dir #{output_dir}") | |
| page = require('webpage').create() | |
| page.viewportSize = | |
| width: width | |
| height: height | |
| page.onConsoleMessage = (msg) -> |
| // Tokenahead.less | |
| // --------------- | |
| .tokenahead { | |
| cursor: text; | |
| overflow: hidden; | |
| height: auto; | |
| padding-bottom: 0; | |
| border-color: @inputBorder; | |
| } |
| <?php | |
| HTML::macro('breadcrumbs', function() { | |
| $links = ''; | |
| $current = URI::current(); | |
| if ($current != '/') | |
| { | |
| return array_reduce(explode('/', URI::current()), function($t,$c) use (&$current, &$links) { | |
| $links = $links ? $links.'/'.$c : $c; |
| <snippet> | |
| <content><![CDATA[ | |
| // ${1} Resource | |
| Route::get('${1}s', array('as' => '${1}s', 'uses' => '${1}s@index')); | |
| Route::get('${1}s/(:any)', array('as' => '${1}', 'uses' => '${1}s@show')); | |
| Route::get('${1}s/new', array('as' => 'new_${1}', 'uses' => '${1}s@new')); | |
| Route::get('${1}s/(:any)edit', array('as' => 'edit_${1}', 'uses' => '${1}s@edit')); | |
| Route::post('${1}s', '${1}s@create'); | |
| Route::put('${1}s/(:any)', '${1}s@update'); | |
| Route::delete('${1}s/(:any)', '${1}s@destroy'); |
| <snippet> | |
| <content><![CDATA[ | |
| // ${1} Resource | |
| Route::get('${1}s', array('as' => '${1}s', 'uses' => '${1}s@index')); | |
| Route::get('${1}s/(:any)', array('as' => '${1}', 'uses' => '${1}s@show')); | |
| Route::get('${1}s/new', array('as' => 'new_${1}', 'uses' => '${1}s@new')); | |
| Route::get('${1}s/(:any)edit', array('as' => 'edit_${1}', 'uses' => '${1}s@edit')); | |
| Route::post('${1}s', '${1}s@create'); | |
| Route::put('${1}s/(:any)', '${1}s@update'); | |
| Route::delete('${1}s/(:any)', '${1}s@destroy'); |