Alternative for ng-class + something like $rootScope.bodyClass with more pretty implementation.
Example:
<div app-configurable-class>
<!-- directive:app-set-class my-container-classname -->
| import audio; | |
| auto soundDecoder = new Decoder(new BufferedFile("./mywave.mp3")); | |
| // Decoder should implements opApply method; | |
| // http://dlang.org/statement.html#opApply | |
| foreach(ulong frameNumber, FrameInfo frame; soundDecoder) { | |
| // so something usefull, FFT for example | |
| doStuff(frame.data); | |
| } | |
| // or |
| app.factory('Slide', [ function () { | |
| function Slide(blockData) { | |
| this.data = angular.extend({}, blockData || {}); | |
| this.uploadInfo = {}; | |
| this.uploadOptions = { | |
| fieldName: 'asset[attachment]' // может это дело в конструктор передавать? это ж настройки по идее... | |
| change: angular.bind(this, this.cangeHandler) | |
| }; |
Простенький бенчмарк на коллекции эллементов в 1000 штук, обход делается 100 раз в рамках одного бенчмарка для большей точности, бенчмарк прогоняется 10 раз.
Результаты на моем не сильно мощном ноуте:
PHP 5.5.9 (cli)
Array filter with simple foreach:
-----------------
Average execution time: 2045 ns
| angular.module('app', []) | |
| .constant('server', {endpoint: 'http://test.com'}) | |
| .config(function(server, apiClientFactoryProvider) { | |
| apiClientFactoryProvider.register({ | |
| 'api': { | |
| endpoint: server.endpoint, // will be concatinated with url | |
| // global interceptors are bad, right? Heres a local one! | |
| // Fully compatible with global interceptors | |
| interceptors: ['myAuthInterceptor', 'noInternetConnectionInterceptor'] | |
| }, |
| <?php | |
| define('REPEAT_BENCH', 4); | |
| define('REPEAT_EXEC', 5); | |
| function array_merge_sorted($first, $second) | |
| { | |
| $out = []; | |
| for ( | |
| $f = 0, $s = 0, |
| .message, | |
| .success, | |
| .error, | |
| .warning { | |
| border: 1px solid #ccc; | |
| padding: 10px; | |
| color: #333; | |
| } | |
| .success { | |
| border-color: green; |
| <?php | |
| /** | |
| -- | |
| -- Table structure for table `adjacent_table` | |
| -- | |
| DROP TABLE IF EXISTS `adjacent_table`; |
| angular.module('js-model', []) | |
| .provider('jsModel', jsModelProvider) | |
| .config(function (jsModelProvider) { | |
| jsModelProvider | |
| .register('Photo') | |
| .register('User', function (Photo) { | |
| return { |
| Feature: Authentification and Authorization | |
| In order to use app | |
| As a user | |
| I should successfully sign in into my account | |
| Background: Users registered in the system | |
| Given users registered: | |
| | name | email | password | | |
| | Sergey | qa1@example.com | qa1pass | | |
| Given i on login screen |