organise Less files into directories:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function ($) { | |
| // on ready | |
| $(function () { | |
| }); | |
| }(jQuery)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| phh = phh || {}; | |
| (function ($) { | |
| $(function () { | |
| phh.url.init(); | |
| }); | |
| phh.url = (function () { | |
| // v 1.3 | |
| // runs before dom ready or window loaded |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // from google javascript style guide: | |
| // One thing to keep in mind, however, is that a closure keeps a pointer to its enclosing scope. As a | |
| // result, attaching a closure to a DOM element can create a circular reference and thus, a memory leak. | |
| // For example, in the following code: | |
| // Leaky example | |
| function foo (element, a, b) { | |
| element.onclick = function() { | |
| // uses a and b | |
| // this func keeps a pointer to foo, its enclosing scope |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| phh = phh || {}; | |
| phh.round = function (n) { | |
| return ~~((n >= 0 ? n : -n) + 0.5); | |
| }; | |
| phh.ceil = function (n) { | |
| // faster than Math.ceil, but only behaves the same when testing positive numbers | |
| // http://jsperf.com/math-ceil/4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| metamorphosis = { | |
| defaults : { | |
| thing : 4 | |
| }, | |
| init : function (options) { | |
| var | |
| the = this, | |
| o, // private object | |
| p; // public object |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* C U S T O M F U N C T I O N S */ | |
| /** | |
| * search an array recursively to find | |
| * the first instance of a key and return its value | |
| * | |
| * useful when you do not know the location of a key nested (only once) in a multidimensional array | |
| * |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .inner(...) { | |
| /* INNER */ | |
| } | |
| .inner(a) { | |
| /* type A */ | |
| .x-1 {float: left;} | |
| .x-2 {float: right;} | |
| } | |
| .inner(b) { | |
| /* type B */ |