Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
| var MyModel = Backbone.Model.extend({ | |
| someMethod: function(opts) { | |
| var url = this.url() + '/someMethod', | |
| // note that these are just $.ajax() options | |
| options = { | |
| url: url, | |
| type: 'POST' | |
| }; | |
| // add any additional options, e.g. a "success" callback or data |
| { | |
| "auto_complete_with_fields": true, | |
| "binary_file_patterns": | |
| [ | |
| "*.jpg", | |
| "*.jpeg", | |
| "*.png", | |
| "*.gif", | |
| "*.ttf", | |
| "*.tga", |
| /** | |
| * get top level object terms | |
| * @package default | |
| * @version 1.0 | |
| **/ | |
| function _get_object_parent_terms ($object, $taxonomies, $args = array()) { | |
| $object_terms = wp_get_object_terms($object, $taxonomies, $args); | |
| $output = array(); |
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
I wanted to figure out the fastest way to load non-critical CSS so that the impact on initial page drawing is minimal.
TL;DR: Here's the solution I ended up with: https://github.com/filamentgroup/loadCSS/
For async JavaScript file requests, we have the async attribute to make this easy, but CSS file requests have no similar standard mechanism (at least, none that will still apply the CSS after loading - here are some async CSS loading conditions that do apply when CSS is inapplicable to media: https://gist.github.com/igrigorik/2935269#file-notes-md ).
Seems there are a couple ways to load and apply a CSS file in a non-blocking manner:
| function logClass(target: any) { | |
| // save a reference to the original constructor | |
| var original = target; | |
| // a utility function to generate instances of a class | |
| function construct(constructor, args) { | |
| var c : any = function () { | |
| return constructor.apply(this, args); | |
| } |
| <!DOCTYPE html> | |
| <html data-ng-app="TestApp"> | |
| <head> | |
| <script src="http://code.angularjs.org/1.2.9/angular.js"></script> | |
| <script> | |
| angular.module('TestApp', []) | |
| .factory('beforeUnload', function ($rootScope, $window) { | |
| // Events are broadcast outside the Scope Lifecycle |