text:
'use strict';

/**
 * Created by Brandon on 5/25/2016.
 */

/**
 * A helper class to simplify registering Angular components and provide a consistent syntax for doing so.
 */
function registerComponent(appName) {

    var app = angular.module(appName);

    return {
        directive: directive,
        controller: controller,
        service: service,
        provider: provider,
        factory: factory
    };

    function directive(name, constructorFn) {

        constructorFn = _normalizeConstructor(constructorFn);

        if (!constructorFn.prototype.compile) {
            // create an empty compile function if none was defined.
            constructorFn.prototype.compile = function () {};
        }

        var originalCompileFn = _cloneFunction(constructorFn.prototype.compile);

        // Decorate the compile method to automatically return the link method (if it exists)
        // and bind it to the context of the constructor (so `this` works correctly).
        // This gets around the problem of a non-lexical "this" which occurs when the directive class itself
        // returns `this.link` from within the compile function.
        _override(constructorFn.prototype, 'compile', function () {
            return function () {
                originalCompileFn.apply(this, arguments);

                if (constructorFn.prototype.link) {
                    return constructorFn.prototype.link.bind(this);
                }
            };
        });

        var factoryArray = _createFactoryArray(constructorFn);

        app.directive(name, factoryArray);
        return this;
    }

    function controller(name, contructorFn) {
        app.controller(name, contructorFn);
        return this;
    }

    function service(name, contructorFn) {
        app.service(name, contructorFn);
        return this;
    }

    function provider(name, constructorFn) {
        app.provider(name, constructorFn);
        return this;
    }

    function factory(name, constructorFn) {
        constructorFn = _normalizeConstructor(constructorFn);
        var factoryArray = _createFactoryArray(constructorFn);
        app.factory(name, factoryArray);
        return this;
    }

    /**
     * If the constructorFn is an array of type ['dep1', 'dep2', ..., constructor() {}]
     * we need to pull out the array of dependencies and add it as an $inject property of the
     * actual constructor function.
     * @param input
     * @returns {*}
     * @private
     */
    function _normalizeConstructor(input) {
        var constructorFn;

        if (input.constructor === Array) {
            //
            var injected = input.slice(0, input.length - 1);
            constructorFn = input[input.length - 1];
            constructorFn.$inject = injected;
        } else {
            constructorFn = input;
        }

        return constructorFn;
    }

    /**
     * Convert a constructor function into a factory function which returns a new instance of that
     * constructor, with the correct dependencies automatically injected as arguments.
     *
     * In order to inject the dependencies, they must be attached to the constructor function with the
     * `$inject` property annotation.
     *
     * @param constructorFn
     * @returns {Array.<T>}
     * @private
     */
    function _createFactoryArray(constructorFn) {
        // get the array of dependencies that are needed by this component (as contained in the `$inject` array)
        var args = constructorFn.$inject || [];
        var factoryArray = args.slice(); // create a copy of the array
        // The factoryArray uses Angular's array notation whereby each element of the array is the name of a
        // dependency, and the final item is the factory function itself.
        factoryArray.push(function () {
            for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
                args[_key] = arguments[_key];
            }

            //return new constructorFn(...args);
            var instance = new (Function.prototype.bind.apply(constructorFn, [null].concat(args)))();
            for (var key in instance) {
                instance[key] = instance[key];
            }
            return instance;
        });

        return factoryArray;
    }

    /**
     * Clone a function
     * @param original
     * @returns {Function}
     */
    function _cloneFunction(original) {
        return function () {
            return original.apply(this, arguments);
        };
    }

    /**
     * Override an object's method with a new one specified by `callback`.
     * @param object
     * @param methodName
     * @param callback
     */
    function _override(object, methodName, callback) {
        object[methodName] = callback(object[methodName]);
    }
}
'use strict';

// Declare app level module which depends on views, and components

var angularApp = angular.module('app', ['ngRoute', 'app.controllers', 'app.directives', 'app.services', 'angular-velocity', 'ngAnimate', 'angular-carousel']);

angularApp.config(['$locationProvider', '$routeProvider', function ($locationProvider, $routeProvider) {
    //$locationProvider.hashPrefix('!');

    //Setup URL routes.
    $routeProvider.when('/', {
        templateUrl: 'angular-app/home/home.html',
        controller: 'HomeCtrl',
        controllerAs: 'vm',
        label: 'Home'
    }).when('/about', {
        templateUrl: 'angular-app/about-us/about-us.html',
        controller: 'AboutCtrl',
        controllerAs: 'vm',
        label: 'About Us'
    }).when('/contact', {
        templateUrl: 'angular-app/contact-us/contact-us.html',
        controller: 'ContactCtrl',
        controllerAs: 'vm',
        label: 'Contact Us'
    }).when('/portfolio', {
        templateUrl: 'angular-app/portfolio/portfolio.html',
        controller: 'PortfolioCtrl',
        controllerAs: 'vm',
        label: 'Portfolio'
    }).when('/pricing', {
        templateUrl: 'angular-app/pricing/pricing.html',
        controller: 'PricingCtrl',
        controllerAs: 'vm',
        label: 'Pricing'
    }).otherwise({ redirectTo: '/' });
}]);

angularApp.run([function () {
    //$(document).foundation();
}]);

/**
 * Here we declare some empty modules for our application where we will put the app's controllers, directives, and services
 */
angular.module('app.controllers', []);
angular.module('app.directives', []);
angular.module('app.services', []);
'use strict';

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

/**
 * Created by Brandon on 6/2/2016.
 */

var AboutUsController = function () {
    _createClass(AboutUsController, null, [{
        key: 'getName',
        value: function getName() {
            return 'AboutCtrl';
        }
    }, {
        key: 'getDependencies',
        value: function getDependencies() {
            return ['$http', '$rootScope', '$timeout', 'ScrollMagic', AboutUsController];
        }
    }]);

    function AboutUsController($http, $rootScope, $timeout, ScrollMagic) {
        _classCallCheck(this, AboutUsController);

        this.$http = $http;
        this.$rootScope = $rootScope;
        this.ScrollMagic = ScrollMagic;
        this.$timeout = $timeout;
        this.runStartAnimation = false;

        this.contacts = [{
            photoUrl: 'https://0.s3.envato.com/files/183626516/Image/Image_Profile.jpg', //'dist/images/jeremy.jpg',
            name: 'Jeremy Ayers',
            title: 'Pilot (FAA Licensed)',
            email: 'jeremy@cinescape.us'
        }, {
            photoUrl: 'https://0.s3.envato.com/files/183626516/Image/Image_Profile.jpg',
            name: 'Sam Low',
            title: 'Cinematographer',
            email: 'sam@cinescape.us'
        }, {
            photoUrl: 'https://0.s3.envato.com/files/183626516/Image/Image_Profile.jpg',
            name: 'Darren Beasley',
            title: 'Cinematographer / Photographer',
            email: 'darren@cinescape.us'
        }, {
            photoUrl: 'https://0.s3.envato.com/files/183626516/Image/Image_Profile.jpg',
            name: 'Brandon Ayers',
            title: 'Cinematographer / Photographer',
            email: 'brandon@cinescape.us'
        }];

        // $timeout(() => {
        //     this.runStartAnimation = true;
        // }, 0);

        this.init();
    }

    _createClass(AboutUsController, [{
        key: 'init',
        value: function init() {
            var _this = this;

            this.$rootScope.appData.smallScreenHeader = 'About Us';
            this.$rootScope.appData.isLight = true;

            this.$timeout(function () {
                var getContactCardScene = function getContactCardScene(triggerSelector) {
                    return new _this.ScrollMagic.Scene({ triggerElement: triggerSelector }).on("enter", function (e) {
                        $(triggerSelector).velocity("transition.slideLeftIn", { duration: 750, stagger: 150 });
                    }).on("leave", function (e) {
                        $(triggerSelector).velocity({ opacity: 0 }, { duration: 300, stagger: 150 });
                    })
                    //.addIndicators() //uncomment this to see where the scroll triggers will be
                    .triggerHook(.75);
                };

                var getSectionScene = function getSectionScene(triggerSelector) {
                    return new _this.ScrollMagic.Scene({ triggerElement: triggerSelector }).on("enter", function (e) {
                        $(triggerSelector).find('h1,h1+p').velocity("transition.slideLeftIn", { duration: 1000, stagger: 200 });
                    }).on("leave", function (e) {
                        $(triggerSelector).find('h1,h1+p').velocity({ opacity: 0 }, { duration: 300, stagger: 200 });
                    })
                    //.addIndicators() //uncomment this to see where the scroll triggers will be
                    .triggerHook(.75);
                };

                var scrollMagicController = new _this.ScrollMagic.Controller();
                scrollMagicController.addScene(getContactCardScene('.contact-card'));
                scrollMagicController.addScene(getSectionScene('.about-hero'));
                scrollMagicController.addScene(getSectionScene('.philosophy'));
                //scrollMagicController.addScene(getContactCardScene('#bright-bold-container'));
                //scrollMagicController.addScene(getContactCardScene('#human-centered-container'));
            }, 0);
        }
    }]);

    return AboutUsController;
}();

registerComponent('app.controllers').controller(AboutUsController.getName(), AboutUsController.getDependencies());
'use strict';

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

/**
 * This is the base controller attached to the  tag
 */

var BaseController = function () {
    _createClass(BaseController, null, [{
        key: 'getName',
        value: function getName() {
            return 'BaseCtrl';
        }
    }, {
        key: 'getDependencies',
        value: function getDependencies() {
            return ['$rootScope', '$scope', '$location', 'velocity', '_', '$sce', BaseController];
        }
    }]);

    function BaseController($rootScope, $scope, $location, velocity, _, $sce) {
        _classCallCheck(this, BaseController);

        this.$rootScope = $rootScope;
        this.$location = $location;
        this.velocity = velocity;
        this._ = _;

        this.$rootScope.appData = {
            smallScreenHeader: 'Cinescape',
            activeNavigationLink: 'home'
        };

        this.navLinks = [{ label: 'Ceremony', smallLabel: $sce.trustAsHtml('Ceremony'), href: '#/', isActive: false }, { label: 'Reception', smallLabel: $sce.trustAsHtml('Reception'), href: '#/portfolio', isActive: false }, { label: 'Afterparty', smallLabel: $sce.trustAsHtml('Afterparty'), href: '#/pricing', isActive: false }
        // {label: 'About Us', smallLabel: $sce.trustAsHtml('About Us'), href: '#/about', isActive: false},
        // {label: 'Contact Us', smallLabel: $sce.trustAsHtml('Contact Us'), href: '#/contact', isActive: false}
        ];

        this.init($scope);
    }

    _createClass(BaseController, [{
        key: 'init',
        value: function init($scope) {
            var _this = this;

            //when the user navigates to a new page, clear the page messages/errors
            $scope.$on('$locationChangeStart', function (event) {
                var currentPath = _this.$location.path();
                switch (currentPath) {
                    case '/':
                        _this.setLinksInactive();
                        _this._.find(_this.navLinks, { href: '#/' }).isActive = true;
                        break;
                    case '/about':
                        _this.setLinksInactive();
                        _this._.find(_this.navLinks, { href: '#/about' }).isActive = true;
                        break;
                    case '/contact':
                        _this.setLinksInactive();
                        _this._.find(_this.navLinks, { href: '#/contact' }).isActive = true;
                        break;
                    case '/portfolio':
                        _this.setLinksInactive();
                        _this._.find(_this.navLinks, { href: '#/portfolio' }).isActive = true;
                        break;
                    case '/pricing':
                        _this.setLinksInactive();
                        _this._.find(_this.navLinks, { href: '#/pricing' }).isActive = true;
                        break;
                }

                _this.scrollToTop(0);
            });
        }
    }, {
        key: 'setLinksInactive',
        value: function setLinksInactive() {
            this._.forEach(this.navLinks, function (link) {
                link.isActive = false;
            });
        }
    }, {
        key: 'afterViewEnter',
        value: function afterViewEnter() {
            $('#view').attr('style', '');
        }
    }, {
        key: 'onScrollToTopClick',
        value: function onScrollToTopClick() {
            this.scrollToTop(350);
        }
    }, {
        key: 'scrollToTop',
        value: function scrollToTop(duration) {
            this.velocity($('html'), 'scroll', { duration: duration });
        }
    }]);

    return BaseController;
}();

registerComponent('app.controllers').controller(BaseController.getName(), BaseController.getDependencies());
'use strict';

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

/**
 * Created by Brandon on 6/2/2016.
 */

var ContactUsController = function () {
    _createClass(ContactUsController, null, [{
        key: 'getName',
        value: function getName() {
            return 'ContactCtrl';
        }
    }, {
        key: 'getDependencies',
        value: function getDependencies() {
            return ['$http', '$rootScope', '$timeout', 'swal', 'velocity', ContactUsController];
        }
    }]);

    function ContactUsController($http, $rootScope, $timeout, swal, velocity) {
        _classCallCheck(this, ContactUsController);

        this.$http = $http;
        this.$rootScope = $rootScope;
        this.swal = swal;
        this.velocity = velocity;
        this.$timeout = $timeout;

        this.contact = this.getEmptyContact();
        this.isSubmitting = false;

        this.init();
    }

    _createClass(ContactUsController, [{
        key: 'init',
        value: function init() {
            var _this = this;

            this.$rootScope.appData.smallScreenHeader = 'Contact Us';
            this.$rootScope.appData.isLight = false;

            this.$timeout(function () {
                var items = $('form');
                _this.velocity(items, 'transition.slideUpIn', { duration: 500, delay: 50 });
            }, 0);
        }
    }, {
        key: 'getEmptyContact',
        value: function getEmptyContact() {
            return {
                name: '',
                email: '',
                phone: '',
                subject: '',
                message: ''
            };
        }
    }, {
        key: 'onSubmit',
        value: function onSubmit(contactForm) {
            if (contactForm.$valid) {
                this.isSubmitting = true;
                this.swal('Success', 'Thank you for contacting us, someone will respond to you shortly.', 'success');
                this.contact = this.getEmptyContact();
                this.contactForm.$setPristine(true);
                this.isSubmitting = false;
            }
        }
    }]);

    return ContactUsController;
}();

registerComponent('app.controllers').controller(ContactUsController.getName(), ContactUsController.getDependencies());
'use strict';

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

/**
 * Created by Brandon on 6/2/2016.
 */

var HomeController = function () {
    _createClass(HomeController, null, [{
        key: 'getName',
        value: function getName() {
            return 'HomeCtrl';
        }
    }, {
        key: 'getDependencies',
        value: function getDependencies() {
            return ['$http', '$rootScope', '$timeout', 'velocity', HomeController];
        }
    }]);

    function HomeController($http, $rootScope, $timeout, velocity) {
        _classCallCheck(this, HomeController);

        this.$http = $http;
        this.$rootScope = $rootScope;
        this.$timeout = $timeout;
        this.velocity = velocity;

        this.init();
    }

    _createClass(HomeController, [{
        key: 'init',
        value: function init() {
            this.$rootScope.appData.smallScreenHeader = 'Cinescape';
            this.$rootScope.appData.isLight = true;

            this.$timeout(function () {
                $(document).foundation();

                //this.velocity($('.hero-text').find('p,h1,button'), 'transition.slideUpIn', {duration: 1000, stagger: 100, drag: true});
            }, 0);
        }
    }, {
        key: 'onLearnMore',
        value: function onLearnMore() {
            this.velocity($('.home-content > .row:first'), 'scroll', { duration: 1000, easing: 'easeOutExpo' });
        }
    }]);

    return HomeController;
}();

registerComponent('app.controllers').controller(HomeController.getName(), HomeController.getDependencies());
'use strict';

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

/**
 * Created by Brandon on 6/2/2016.
 */

var PortfolioController = function () {
    _createClass(PortfolioController, null, [{
        key: 'getName',
        value: function getName() {
            return 'PortfolioCtrl';
        }
    }, {
        key: 'getDependencies',
        value: function getDependencies() {
            return ['$rootScope', PortfolioController];
        }
    }]);

    function PortfolioController($rootScope) {
        _classCallCheck(this, PortfolioController);

        this.$rootScope = $rootScope;

        this.init();
    }

    _createClass(PortfolioController, [{
        key: 'init',
        value: function init() {
            this.$rootScope.appData.smallScreenHeader = 'Portfolio';
            this.$rootScope.appData.isLight = false;

            // this.$timeout(() => {
            //     let items = $('form');
            //     this.velocity(items, 'transition.slideUpIn', {duration: 500, delay: 50});
            // }, 0);
        }
    }]);

    return PortfolioController;
}();

registerComponent('app.controllers').controller(PortfolioController.getName(), PortfolioController.getDependencies());
'use strict';

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

/**
 * Created by Brandon on 6/2/2016.
 */

var PricingController = function () {
    _createClass(PricingController, null, [{
        key: 'getName',
        value: function getName() {
            return 'PricingCtrl';
        }
    }, {
        key: 'getDependencies',
        value: function getDependencies() {
            return ['$rootScope', 'velocity', '$timeout', PricingController];
        }
    }]);

    function PricingController($rootScope, velocity, $timeout) {
        _classCallCheck(this, PricingController);

        this.$rootScope = $rootScope;
        this.velocity = velocity;
        this.$timeout = $timeout;

        this.pricingInfo = [{
            title: 'Standard Property',
            price: '$1499*',
            description: '* This is just an estimate. Pricing is subject to change based on each individual property.',
            houseSize: '< 2000 sqft house',
            lotSize: '< 8000 sqft lot',
            included: 'Professionally edited 4k footage'
        }, {
            title: 'Large Property',
            price: '$2499*',
            description: '* This is just an estimate. Pricing is subject to change based on each individual property.',
            houseSize: '2001 - 3500 sqft house',
            lotSize: '8001 - 16000 sqft lot',
            included: 'Professionally edited 4k footage'
        }, {
            title: 'Luxury Property',
            price: '$4999*',
            description: '* This is just an estimate. Pricing is subject to change based on each individual property.',
            houseSize: '> 3500 sqft house',
            lotSize: '> 16000 sqft lot',
            included: 'Professionally edited 4k footage'
        }];

        this.init();
    }

    _createClass(PricingController, [{
        key: 'init',
        value: function init() {
            var _this = this;

            this.$rootScope.appData.smallScreenHeader = 'Pricing';
            this.$rootScope.appData.isLight = false;

            this.$timeout(function () {
                var items = $('.pricing-wrapper');
                _this.velocity(items, 'transition.slideLeftIn', { duration: 750, stagger: 75 });
            }, 0);
        }
    }]);

    return PricingController;
}();

registerComponent('app.controllers').controller(PricingController.getName(), PricingController.getDependencies());
'use strict';

/**
 * Created by Brandon on 10/29/2015.
 */

angular.module('app.directives').directive('appForm', ['$timeout', 'velocity', '_', function ($timeout, velocity, _) {
    return {
        restrict: 'A', //can only be attribute
        link: function link(scope, element, attrs) {
            if (!attrs.name) {
                throw 'Directive app-form requires "name" attribute.';
            }

            element.addClass('app-form');

            var addBlurHandlers = function addBlurHandlers() {
                var allInputs = element.find('input, textarea');
                allInputs.off('blur.appForm');
                allInputs.on('blur.appForm', function () {
                    $(this).addClass('has-visited');
                    showErrors();
                });
            };
            addBlurHandlers();

            var getInvalidElements = function getInvalidElements() {
                if (element.hasClass('ng-submitted')) {
                    return element.find('.ng-invalid');
                } else {
                    var inputs = element.find('input.ng-invalid.ng-dirty.has-visited');
                    var textareas = element.find('textarea.ng-invalid.ng-dirty.has-visited');
                    var selects = element.find('select.ng-invalid.ng-dirty');

                    return inputs.add(textareas).add(selects);
                }
            };

            var showErrors = function showErrors() {
                var errorEls = element.find('input.is-invalid-input,label.is-invalid-label,span.form-error');
                errorEls.removeClass('is-invalid-input').removeClass('is-invalid-label').removeClass('is-visible');

                var invalidFields = getInvalidElements();
                _.forEach(invalidFields, function (field) {
                    var parentDiv = $(field).parents('div:first');
                    //parentDiv.addClass('error');
                    parentDiv.find('label').addClass('is-invalid-label');
                    parentDiv.find('input').addClass('is-invalid-input');
                    parentDiv.find('span.form-error').addClass('is-visible');
                });
            };

            element.on('submit', function () {
                $timeout(function () {
                    var invalidFields = getInvalidElements();
                    var visibleInvalidFields = invalidFields.filter(':visible');
                    if (visibleInvalidFields.length > 0) {
                        velocity($(visibleInvalidFields[0]), 'scroll', { duration: 300, offset: -100, easing: 'spring' });
                    }

                    showErrors();
                }, 50);

                //if ng-submit wasn't set (which will prevent form submission), then we need to prevent form submission ourselves.
                if (!attrs.ngSubmit) {
                    scope.$eval('$parent.' + attrs.name).$setSubmitted();
                    event.preventDefault();
                    event.returnValue = false;
                    return false;
                }
            });

            scope.$parent.$watch(attrs.name + '.$error', function () {
                $timeout(function () {
                    showErrors();
                }, 200);
            }, true);

            scope.$parent.$watch(attrs.name + '.$pristine', function (isPristine) {
                if (isPristine === true) {
                    $timeout(function () {
                        showErrors();
                    }, 200);
                }
            });

            scope.$watch(function () {
                return element.find('input, select, textarea').length;
            }, function () {
                addBlurHandlers();
                setupFormElementWatches();
            });

            /////////////////auto save bindings/////////////////////
            var onChange = function onChange(trackLastActivity) {
                //console.log('auto-save-trigger onChange triggered');
                if (trackLastActivity === true) {
                    scope.lastActivity = Date.now();
                } else {
                    scope.isDirty = true;
                }

                if (!scope.$$phase && !scope.$root.$$phase) {
                    scope.$apply();
                }
            };

            var setupFormElementWatches = function setupFormElementWatches() {
                if (scope.enableAutoSave != 'true') {
                    return;
                }

                element.find('input, textarea, select').off('keyup.appForm change.appForm').not('[auto-save-ignore]').each(function () {
                    var input = this;
                    var isTextInput = input.tagName.toLowerCase() == 'textarea' || input.tagName.toLowerCase() == 'input' && ['radio', 'checkbox', 'hidden'].indexOf($(input).attr('type').toLowerCase()) < 0;

                    //if it's a ucr-select2 control then don't treat it like a text input
                    isTextInput = isTextInput && $(input).attr('ucr-select2') != '';

                    if (isTextInput) {
                        $(input).bind('keyup.appForm', function () {
                            onChange(true);
                        });
                    } else {
                        $(input).bind('change.appForm', onChange);
                    }
                });
            };

            setupFormElementWatches();
        },
        controller: ['$scope', function ($scope) {
            $scope.maxSaveInterval = $scope.maxSaveInterval ? $scope.maxSaveInterval : 3000; //The form won't save more often than this
            $scope.inactivityInterval = $scope.inactivityInterval ? $scope.inactivityInterval : 1000; //Amount of inactivity on text inputs necessary before triggering auto save

            $scope.lastActivity = 0;
            $scope.$watch('lastActivity', function (newValue, oldValue) {
                if (newValue === oldValue) {
                    return;
                }

                //console.log('lastActivity watch - oldValue: ' + oldValue + ', newValue: ' + newValue);
                if ($scope.isDirty || newValue == 0) {
                    //console.log('isDirty is already true or newValue is 0, returning');
                    return;
                }

                function setIsDirty() {
                    //console.log('setIsDirty() called in lastActivity watch');
                    $scope.isDirty = true;
                }

                var now = Date.now();

                var msSinceLastActivity = now - oldValue;
                //console.log('Time since last activity: ' + msSinceLastActivity);
                if (oldValue == 0 || msSinceLastActivity < $scope.inactivityInterval) {
                    //console.log('Not enough inactivity');
                    if ($scope.inactivityTimeout != null) {
                        $timeout.cancel($scope.inactivityTimeout);
                        $scope.inactivityTimeout = null;
                    }

                    $scope.inactivityTimeout = $timeout(setIsDirty, $scope.inactivityInterval);
                    return;
                }

                //console.log('Calling setIsDirty directly since last activity > inactivityInterval');
                setIsDirty();
            });

            $scope.inactivityTimeout = null;
            $scope.isDirty = false;
            $scope.$watch('isDirty', function (newValue, oldValue) {
                if (newValue === oldValue) {
                    return;
                }

                //console.log('isDirty watch: ' + newValue);
                if (newValue == false || $scope.maxSaveTimeout != null) {
                    return;
                }

                var now = Date.now();

                var msSinceLastSaved = now - $scope.lastSaved;
                if (msSinceLastSaved < $scope.maxSaveInterval) {
                    var nextSaveTime = $scope.maxSaveInterval - msSinceLastSaved;
                    $scope.maxSaveTimeout = $timeout($scope.triggerAutoSave, nextSaveTime);
                    return;
                }

                $scope.triggerAutoSave();
            });
            $scope.triggerAutoSave = function () {
                //console.log('AutoSave triggered');
                if ($scope.maxSaveTimeout != null) $timeout.cancel($scope.maxSaveTimeout);
                $scope.maxSaveTimeout = null;
                if ($scope.inactivityTimeout != null) $timeout.cancel($scope.inactivityTimeout);
                $scope.inactivityTimeout = null;
                $scope.lastActivity = 0;
                $scope.isDirty = false;
                $scope.lastSaved = Date.now();
                $scope.onAutoSave();
            };
            $scope.lastSaved = 0;
            $scope.maxSaveTimeout = null;
        }],
        scope: {
            'enableAutoSave': '@',
            'onAutoSave': '&',
            'maxSaveInterval': '@',
            'inactivityInterval': '@'
        }
    };
}]);
/**
 * Created by Brandon on 10/20/2015.
 */

'use strict';

/* 3rd Party Service Wrappers */

angular.module('app.services')

//velocity service
.factory('velocity', [function () {
    return $.Velocity;
}])

//lodash service
.factory('_', [function () {
    return window._;
}])

//magnific popup service
//     .factory('magnificPopup', [
//         function() {
//             return $.magnificPopup;
//         }])

//ScrollMagic
.factory('ScrollMagic', [function () {
    return window.ScrollMagic;
}])

//sweet alert service
.factory('swal', [function () {
    return window.swal;
}]);

//js-logger library
//     .factory('Logger', [
//         function() {
//             return Logger;
//         }])

//momentjs library
//     .factory('moment', [
//         function() {
//             return moment;
//         }]);


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Bidr. Känn. Finl. Nat. Folk 37: 185 (1882)

#### Original name
Clavaria spinulosa Pers., 1800

### Remarks
null

redpajama_set_name: RedPajamaGithub


text:
const moduleA = require('module-a');
const moduleB = require('module-b');


text:
package com.github.stephanenicolas.afterburner.inserts;

import com.github.stephanenicolas.afterburner.exception.AfterBurnerImpossibleException;

import javassist.CtClass;

/**
 * Base class of all insertable constructors through AfterBurner.
 * Inserts code in all constructors of a target class.
 * @author SNI
 */
public abstract class InsertableConstructor extends Insertable {

    public InsertableConstructor(CtClass classToInsertInto) {
        super(classToInsertInto);
    }

    /**
     * Return the list of java statements to be inserted in all constructors of the target class.
     * @param paramClasses the arguments passed to the constructor.
     * @return all instructions to be inserted at the beginning of each constructor.
     * @throws AfterBurnerImpossibleException in case something goes wrong. Wrap all exceptions into it.
     */
    public abstract String getConstructorBody(CtClass[] paramClasses) throws AfterBurnerImpossibleException;

    /**
     * Allows to filter constructors based on their parameter types.
     * @param paramClasses the arguments passed to the constructor.
     * @return whether or not the constructor will receive injected code (whether or not to call {@link #getConstructorBody(CtClass[])}).
     * @throws AfterBurnerImpossibleException in case something goes wrong. Wrap all exceptions into it.
     */
    public abstract boolean acceptParameters(CtClass[] paramClasses) throws AfterBurnerImpossibleException;

}


text:
import fixtures
import mock
from oslo_utils.fixture import uuidsentinel
from pypowervm import const as pvm_const
from pypowervm.tasks import scsi_mapper as tsk_map
from pypowervm.tests import test_fixtures as pvm_fx
from pypowervm.utils import transaction as pvm_tx
from pypowervm.wrappers import network as pvm_net
from pypowervm.wrappers import storage as pvm_stg
from pypowervm.wrappers import virtual_io_server as pvm_vios

from nova import test
from nova.virt.powervm import media as m

class TestConfigDrivePowerVM(test.NoDBTestCase):
    """Unit Tests for the ConfigDrivePowerVM class."""

    def setUp(self):
        super(TestConfigDrivePowerVM, self).setUp()

        self.apt = self.useFixture(pvm_fx.AdapterFx()).adpt

        self.validate_vopt = self.useFixture(fixtures.MockPatch(
            'pypowervm.tasks.vopt.validate_vopt_repo_exists',
            autospec=True)).mock
        self.validate_vopt.return_value = 'vios_uuid', 'vg_uuid'

    @mock.patch('nova.api.metadata.base.InstanceMetadata')
    @mock.patch('nova.virt.configdrive.ConfigDriveBuilder.make_drive')
    def test_crt_cfg_dr_iso(self, mock_mkdrv, mock_meta):
        """Validates that the image creation method works."""
        cfg_dr_builder = m.ConfigDrivePowerVM(self.apt)
        self.assertTrue(self.validate_vopt.called)
        mock_instance = mock.MagicMock()
        mock_instance.uuid = uuidsentinel.inst_id
        mock_files = mock.MagicMock()
        mock_net = mock.MagicMock()
        iso_path = '/tmp/cfgdrv.iso'
        cfg_dr_builder._create_cfg_dr_iso(mock_instance, mock_files, mock_net,
                                          iso_path)
        self.assertEqual(mock_mkdrv.call_count, 1)

        # Test retry iso create
        mock_mkdrv.reset_mock()
        mock_mkdrv.side_effect = [OSError, mock_mkdrv]
        cfg_dr_builder._create_cfg_dr_iso(mock_instance, mock_files, mock_net,
                                          iso_path)
        self.assertEqual(mock_mkdrv.call_count, 2)

    @mock.patch('tempfile.NamedTemporaryFile')
    @mock.patch('nova.virt.powervm.vm.get_pvm_uuid')
    @mock.patch('pypowervm.tasks.scsi_mapper.build_vscsi_mapping')
    @mock.patch('pypowervm.tasks.scsi_mapper.add_map')
    @mock.patch('os.path.getsize')
    @mock.patch('pypowervm.tasks.storage.upload_vopt')
    @mock.patch('nova.virt.powervm.media.ConfigDrivePowerVM.'
                '_create_cfg_dr_iso')
    def test_create_cfg_drv_vopt(self, mock_ccdi, mock_upl, mock_getsize,
                                 mock_addmap, mock_bldmap, mock_vm_id,
                                 mock_ntf):
        cfg_dr = m.ConfigDrivePowerVM(self.apt)
        mock_instance = mock.MagicMock()
        mock_instance.uuid = uuidsentinel.inst_id
        mock_upl.return_value = 'vopt', 'f_uuid'
        fh = mock_ntf.return_value.__enter__.return_value
        fh.name = 'iso_path'
        wtsk = mock.create_autospec(pvm_tx.WrapperTask, instance=True)
        ftsk = mock.create_autospec(pvm_tx.FeedTask, instance=True)
        ftsk.configure_mock(wrapper_tasks={'vios_uuid': wtsk})

        def test_afs(add_func):
            # Validate the internal add_func
            vio = mock.create_autospec(pvm_vios.VIOS)
            self.assertEqual(mock_addmap.return_value, add_func(vio))
            mock_vm_id.assert_called_once_with(mock_instance)
            mock_bldmap.assert_called_once_with(
                None, vio, mock_vm_id.return_value, 'vopt')
            mock_addmap.assert_called_once_with(vio, mock_bldmap.return_value)
        wtsk.add_functor_subtask.side_effect = test_afs

        # calculate expected file name
        expected_file_name = 'cfg_' + mock_instance.uuid.replace('-', '')
        allowed_len = pvm_const.MaxLen.VOPT_NAME - 4  # '.iso' is 4 chars
        expected_file_name = expected_file_name[:allowed_len] + '.iso'

        cfg_dr.create_cfg_drv_vopt(
            mock_instance, 'files', 'netinfo', ftsk, admin_pass='pass')

        mock_ntf.assert_called_once_with(mode='rb')
        mock_ccdi.assert_called_once_with(mock_instance, 'files', 'netinfo',
                                          'iso_path', admin_pass='pass')
        mock_getsize.assert_called_once_with('iso_path')
        mock_upl.assert_called_once_with(self.apt, 'vios_uuid', fh,
                                         expected_file_name,
                                         mock_getsize.return_value)
        wtsk.add_functor_subtask.assert_called_once()

    def test_sanitize_network_info(self):
        network_info = [{'type': 'lbr'}, {'type': 'pvm_sea'},
                        {'type': 'ovs'}]

        cfg_dr_builder = m.ConfigDrivePowerVM(self.apt)

        resp = cfg_dr_builder._sanitize_network_info(network_info)
        expected_ret = [{'type': 'vif'}, {'type': 'vif'},
                        {'type': 'ovs'}]
        self.assertEqual(resp, expected_ret)

    @mock.patch('pypowervm.wrappers.storage.VG', autospec=True)
    @mock.patch('pypowervm.tasks.storage.rm_vg_storage', autospec=True)
    @mock.patch('nova.virt.powervm.vm.get_pvm_uuid')
    @mock.patch('pypowervm.tasks.scsi_mapper.gen_match_func', autospec=True)
    @mock.patch('pypowervm.tasks.scsi_mapper.find_maps', autospec=True)
    @mock.patch('pypowervm.wrappers.virtual_io_server.VIOS', autospec=True)
    @mock.patch('taskflow.task.FunctorTask', autospec=True)
    def test_dlt_vopt(self, mock_functask, mock_vios, mock_find_maps, mock_gmf,
                      mock_uuid, mock_rmstg, mock_vg):
        cfg_dr = m.ConfigDrivePowerVM(self.apt)
        wtsk = mock.create_autospec(pvm_tx.WrapperTask, instance=True)
        ftsk = mock.create_autospec(pvm_tx.FeedTask, instance=True)
        ftsk.configure_mock(wrapper_tasks={'vios_uuid': wtsk})

        # Test with no media to remove
        mock_find_maps.return_value = []
        cfg_dr.dlt_vopt('inst', ftsk)
        mock_uuid.assert_called_once_with('inst')
        mock_gmf.assert_called_once_with(pvm_stg.VOptMedia)
        wtsk.add_functor_subtask.assert_called_once_with(
            tsk_map.remove_maps, mock_uuid.return_value,
            match_func=mock_gmf.return_value)
        ftsk.get_wrapper.assert_called_once_with('vios_uuid')
        mock_find_maps.assert_called_once_with(
            ftsk.get_wrapper.return_value.scsi_mappings,
            client_lpar_id=mock_uuid.return_value,
            match_func=mock_gmf.return_value)
        mock_functask.assert_not_called()

        # Test with media to remove
        mock_find_maps.return_value = [mock.Mock(backing_storage=media)
                                       for media in ['m1', 'm2']]

        def test_functor_task(rm_vopt):
            # Validate internal rm_vopt function
            rm_vopt()
            mock_vg.get.assert_called_once_with(
                self.apt, uuid='vg_uuid', parent_type=pvm_vios.VIOS,
                parent_uuid='vios_uuid')
            mock_rmstg.assert_called_once_with(
                mock_vg.get.return_value, vopts=['m1', 'm2'])
            return 'functor_task'
        mock_functask.side_effect = test_functor_task

        cfg_dr.dlt_vopt('inst', ftsk)
        mock_functask.assert_called_once()
        ftsk.add_post_execute.assert_called_once_with('functor_task')

    def test_mgmt_cna_to_vif(self):
        mock_cna = mock.Mock(spec=pvm_net.CNA, mac="FAD4433ED120")

        # Run
        cfg_dr_builder = m.ConfigDrivePowerVM(self.apt)
        vif = cfg_dr_builder._mgmt_cna_to_vif(mock_cna)

        # Validate
        self.assertEqual(vif.get('address'), "fa:d4:43:3e:d1:20")
        self.assertEqual(vif.get('id'), 'mgmt_vif')
        self.assertIsNotNone(vif.get('network'))
        self.assertEqual(1, len(vif.get('network').get('subnets')))
        subnet = vif.get('network').get('subnets')[0]
        self.assertEqual(6, subnet.get('version'))
        self.assertEqual('fe80::/64', subnet.get('cidr'))
        ip = subnet.get('ips')[0]
        self.assertEqual('fe80::f8d4:43ff:fe3e:d120', ip.get('address'))

    def test_mac_to_link_local(self):
        mac = 'fa:d4:43:3e:d1:20'
        self.assertEqual('fe80::f8d4:43ff:fe3e:d120',
                         m.ConfigDrivePowerVM._mac_to_link_local(mac))

        mac = '00:00:00:00:00:00'
        self.assertEqual('fe80::0200:00ff:fe00:0000',
                         m.ConfigDrivePowerVM._mac_to_link_local(mac))

        mac = 'ff:ff:ff:ff:ff:ff'
        self.assertEqual('fe80::fdff:ffff:feff:ffff',
        m.ConfigDrivePowerVM._mac_to_link_local(mac))


text:
<?php

namespace Eole\Sandstone\Websocket\Routing;

use Symfony\Component\Routing\RouteCollection;
use Silex\Controller;
use Eole\Sandstone\Websocket\Routing\TopicRoute;

class TopicCollection
{
    /**
     * @var RouteCollection
     */
    private $routeCollection;

    /**
     * @param RouteCollection $routeCollection
     */
    public function __construct(RouteCollection $routeCollection)
    {
        $this->routeCollection = $routeCollection;
    }

    /**
     * Add a new topic route.
     *
     * @param string $pattern
     * @param callable $to
     *
     * @return Controller
     */
    public function match($pattern, callable $to)
    {
        $route = new TopicRoute($pattern, $to);
        $controller = new Controller($route);
        $routeName = $controller->generateRouteName('');

        $controller->bind($routeName);

        $this->routeCollection->add($routeName, $route);

        return $controller;
    }
}


text:
mergus-icons it's a hard-to-get set of scalable icons commonly used in Argentina

mergus-icons is a Free and Open Source project.

v1.1.0

mgi-clubcdn

mgi-clubgaf

mgi-correoarg

mgi-dinmail

mgi-dinmail-dm

mgi-mate

mgi-mergus

mgi-mhands

mgi-mlibre

mgi-mpago

mgi-oca

mgi-olx

mgi-pmc

mgi-pokeball

mgi-sintacc

mgi-subemis

mgi-patente-sq

mgi-patente

mgi-taringa

mgi-tmacro

mgi-tnaranja

mgi-tnativa

mgi-yerba

###Getting started
Install the package with:

	npm install --save mergus-icons
or

	bower install --save mergus-icons

In the  of your html, reference the location to your mergus-icons.min.css:

	<link rel="stylesheet" href="path/to/build/font/mergus-icons.min.css">

###Usage

All icons require the class **mgi** as base, followed by the individual icon class. This classes, can be combined with any helper class to style icons.

*Tip:*
You can also use the svg files individually, you can find them in the folder [/lib/svg](https://github.com/MergusDesign/mergus-icons/tree/master/lib/svg) .

###Helper classes

- **Larger icons:** The class **mgi-lg** makes the font 33% larger relative to the icon container.
**mgi-2x**, **mgi-3x**, **mgi-4x**, **mgi-5x** make the font x times larger relative to the icon container.

- **Fixed Width Icons:** **mgi-fw** sets icons at a fixed width.

- **List Icons:** **mgi-ul** and **mgi-li** are used to replace default bullets in unordered lists.

- **Bordered & Pulled Icons:** **mgi-border** creates a border around the icon and it can be combined with **mgi-pull-left** or **mgi-pull-right** to make an icon stand out.

- **Animated Icons:** **mgi-spin** makes icons rotate and use **mgi-pulse** to make the icon rotate with 8 steps.

- **Rotate & Flip:** Use **mgi-rotate-90**, **mgi-rotate-180** and **mgi-rotate-270** to rotate icons X degrees over itself.
Use **mgi-flip-horizontal** and **mgi-flip-vertical** to make icons flip horizontally or vertically.

- **Stacked Icons:** To stack multiple icons, use the **mgi-stack** class on the parent, the **mgi-stack-1x** for the regularly sized icon, and **mgi-stack-2x** for the larger icon.

- **Inverse color:** **mgi-inverse** makes icons to change its color to white.

- **Accessibility:** **sr-only** allows to add alternative information such as displays and text for screen readers.

You can also change the icons color through CSS, like with any font:

	body {
	    color: blue;
	}

###Request an icon? Yes, sure!
Just open an [**issue**](https://github.com/MergusDesign/mergus-icons/issues) with the "new icon" label. The more information and references you leave us, the better!

###License
All font files and SVG files are under [SIL OFL 1.1 License](http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=OFL)

All other files are under [MIT License](https://opensource.org/licenses/mit-license.html)

###Credits
Based on [Octicons](https://github.com/primer/octicons) and [Font Awesome](http://fontawesome.io/).

###Brand Icons

 - All brand icons are trademarks of their respective owners.
 - The use of these trademarks does not indicate endorsement of the trademark holder by Mergus Design, nor vice versa.
 - Brand icons should only be used to represent the company or product to which they refer.


text:
<?php

namespace Akamon\OAuth2\Server\Domain\Controller;

use Akamon\OAuth2\Server\Domain\Exception\OAuthError\OAuthErrorException;
use Akamon\OAuth2\Server\Domain\Service\Token\RequestAccessTokenObtainer\RequestAccessTokenObtainerInterface;
use Symfony\Component\HttpFoundation\Request;

class ResourceController
{
    private $requestAccessTokenObtainer;

    public function __construct(RequestAccessTokenObtainerInterface $requestAccessTokenObtainer)
    {
        $this->requestAccessTokenObtainer = $requestAccessTokenObtainer;
    }

    public function execute(Request $request, $processor)
    {
        try {
            $accessToken = $this->requestAccessTokenObtainer->obtain($request);
        } catch (OAuthErrorException $e) {
            return Controller::createOAuthHttpResponse($e->getHttpStatusCode(), $e->getParameters(), $e->getHeaders());
        }

        return call_user_func($processor, $request, $accessToken);
    }
}


text:
require 'linguist/file_blob'
require 'linguist/samples'

require 'test/unit'
require 'mocha/setup'
require 'mime/types'
require 'pygments'

class TestBlob < Test::Unit::TestCase
  include Linguist

  Lexer = Pygments::Lexer

  def samples_path
    File.expand_path("../../samples", __FILE__)
  end

  def blob(name)
    name = File.join(samples_path, name) unless name =~ /^\//
    FileBlob.new(name, samples_path)
  end

  def script_blob(name)
    blob = blob(name)
    blob.instance_variable_set(:@name, 'script')
    blob
  end

  def test_name
    assert_equal "foo.rb", blob("foo.rb").name
  end

  def test_mime_type
    assert_equal "application/postscript", blob("Binary/octocat.ai").mime_type
    assert_equal "application/x-ruby", blob("Ruby/grit.rb").mime_type
    assert_equal "application/x-sh", blob("Shell/script.sh").mime_type
    assert_equal "application/xml", blob("XML/bar.xml").mime_type
    assert_equal "audio/ogg", blob("Binary/foo.ogg").mime_type
    assert_equal "text/plain", blob("Text/README").mime_type
  end

  def test_content_type
    assert_equal "application/pdf", blob("Binary/foo.pdf").content_type
    assert_equal "audio/ogg", blob("Binary/foo.ogg").content_type
    assert_equal "image/png", blob("Binary/foo.png").content_type
    assert_equal "text/plain; charset=iso-8859-2", blob("Text/README").content_type
  end

  def test_disposition
    assert_equal "attachment; filename=foo+bar.jar", blob("Binary/foo bar.jar").disposition
    assert_equal "attachment; filename=foo.bin", blob("Binary/foo.bin").disposition
    assert_equal "attachment; filename=linguist.gem", blob("Binary/linguist.gem").disposition
    assert_equal "attachment; filename=octocat.ai", blob("Binary/octocat.ai").disposition
    assert_equal "inline", blob("Text/README").disposition
    assert_equal "inline", blob("Text/foo.txt").disposition
    assert_equal "inline", blob("Ruby/grit.rb").disposition
    assert_equal "inline", blob("Binary/octocat.png").disposition
  end

  def test_data
    assert_equal "module Foo\nend\n", blob("Ruby/foo.rb").data
  end

  def test_lines
    assert_equal ["module Foo", "end", ""], blob("Ruby/foo.rb").lines
    assert_equal ["line 1", "line 2", ""], blob("Text/mac.txt").lines
    assert_equal 475, blob("Emacs Lisp/ess-julia.el").lines.length
  end

  def test_size
    assert_equal 15, blob("Ruby/foo.rb").size
  end

  def test_loc
    assert_equal 3, blob("Ruby/foo.rb").loc
  end

  def test_sloc
    assert_equal 2, blob("Ruby/foo.rb").sloc
  end

  def test_encoding
    assert_equal "ISO-8859-2", blob("Text/README").encoding
    assert_equal "ISO-8859-1", blob("Text/dump.sql").encoding
    assert_equal "UTF-8", blob("Text/foo.txt").encoding
    assert_nil blob("Binary/dog.o").encoding
  end

  def test_binary
    # Large blobs aren't loaded
    large_blob = blob("git.exe")
    large_blob.instance_eval do
      def data; end
    end
    assert large_blob.binary?

    assert blob("Binary/git.deb").binary?
    assert blob("Binary/git.exe").binary?
    assert blob("Binary/hello.pbc").binary?
    assert blob("Binary/linguist.gem").binary?
    assert blob("Binary/octocat.ai").binary?
    assert blob("Binary/octocat.png").binary?
    assert blob("Binary/zip").binary?
    assert !blob("Text/README").binary?
    assert !blob("Text/file.txt").binary?
    assert !blob("Ruby/foo.rb").binary?
    assert !blob("Perl/script.pl").binary?
  end

  def test_text
    assert blob("Text/README").text?
    assert blob("Text/dump.sql").text?
    assert blob("Text/file.json").text?
    assert blob("Text/file.txt").text?
    assert blob("Text/md").text?
    assert blob("Shell/script.sh").text?
    assert blob("Text/txt").text?
  end

  def test_image
    assert blob("Binary/octocat.gif").image?
    assert blob("Binary/octocat.jpeg").image?
    assert blob("Binary/octocat.jpg").image?
    assert blob("Binary/octocat.png").image?
    assert !blob("Binary/octocat.ai").image?
    assert !blob("Binary/octocat.psd").image?
  end

  def test_solid
    assert blob("Binary/cube.stl").solid?
    assert blob("Text/cube.stl").solid?
  end

  def test_csv
    assert blob("Text/cars.csv").csv?
  end

  def test_pdf
    assert blob("Binary/foo.pdf").pdf?
  end

  def test_viewable
    assert blob("Text/README").viewable?
    assert blob("Ruby/foo.rb").viewable?
    assert blob("Perl/script.pl").viewable?
    assert !blob("Binary/linguist.gem").viewable?
    assert !blob("Binary/octocat.ai").viewable?
    assert !blob("Binary/octocat.png").viewable?
  end

  def test_generated
    assert !blob("Text/README").generated?

    # Xcode project files
    assert blob("XML/MainMenu.xib").generated?
    assert blob("Binary/MainMenu.nib").generated?
    assert blob("XML/project.pbxproj").generated?

    # Gemfile.locks
    assert blob("Gemfile.lock").generated?

    # Generated .NET Docfiles
    assert blob("XML/net_docfile.xml").generated?

    # Long line
    assert !blob("JavaScript/uglify.js").generated?

    # Inlined JS, but mostly code
    assert !blob("JavaScript/json2_backbone.js").generated?

    # Minified JS
    assert !blob("JavaScript/jquery-1.6.1.js").generated?
    assert blob("JavaScript/jquery-1.6.1.min.js").generated?
    assert blob("JavaScript/jquery-1.4.2.min.js").generated?

    # CoffeeScript-generated JS
    # TODO

    # TypeScript-generated JS
    # TODO

    # PEG.js-generated parsers
    assert blob("JavaScript/parser.js").generated?

    # These examples are too basic to tell
    assert !blob("JavaScript/empty.js").generated?
    assert !blob("JavaScript/hello.js").generated?

    assert blob("JavaScript/intro-old.js").generated?
    assert blob("JavaScript/classes-old.js").generated?

    assert blob("JavaScript/intro.js").generated?
    assert blob("JavaScript/classes.js").generated?

    # Protocol Buffer generated code
    assert blob("C++/protocol-buffer.pb.h").generated?
    assert blob("C++/protocol-buffer.pb.cc").generated?
    assert blob("Java/ProtocolBuffer.java").generated?
    assert blob("Python/protocol_buffer_pb2.py").generated?

    # Minified CSS
    assert !blob("CSS/bootstrap.css").generated?
    assert blob("CSS/bootstrap.min.css").generated?
  end

  def test_vendored
    assert !blob("Text/README").vendored?
    assert !blob("ext/extconf.rb").vendored?

    # Node dependencies
    assert blob("node_modules/coffee-script/lib/coffee-script.js").vendored?

    # Rails vendor/
    assert blob("vendor/plugins/will_paginate/lib/will_paginate.rb").vendored?

    # C deps
    assert blob("deps/http_parser/http_parser.c").vendored?
    assert blob("deps/v8/src/v8.h").vendored?

    # Debian packaging
    assert blob("debian/cron.d").vendored?

    # Prototype
    assert !blob("public/javascripts/application.js").vendored?
    assert blob("public/javascripts/prototype.js").vendored?
    assert blob("public/javascripts/effects.js").vendored?
    assert blob("public/javascripts/controls.js").vendored?
    assert blob("public/javascripts/dragdrop.js").vendored?

    # jQuery
    assert blob("jquery.js").vendored?
    assert blob("public/javascripts/jquery.js").vendored?
    assert blob("public/javascripts/jquery.min.js").vendored?
    assert blob("public/javascripts/jquery-1.7.js").vendored?
    assert blob("public/javascripts/jquery-1.7.min.js").vendored?
    assert blob("public/javascripts/jquery-1.5.2.js").vendored?
    assert blob("public/javascripts/jquery-1.6.1.js").vendored?
    assert blob("public/javascripts/jquery-1.6.1.min.js").vendored?
    assert !blob("public/javascripts/jquery.github.menu.js").vendored?

    # jQuery UI
    assert blob("themes/ui-lightness/jquery-ui.css").vendored?
    assert blob("themes/ui-lightness/jquery-ui-1.8.22.custom.css").vendored?
    assert blob("themes/ui-lightness/jquery.ui.accordion.css").vendored?
    assert blob("ui/i18n/jquery.ui.datepicker-ar.js").vendored?
    assert blob("ui/i18n/jquery-ui-i18n.js").vendored?
    assert blob("ui/jquery.effects.blind.js").vendored?
    assert blob("ui/jquery-ui-1.8.22.custom.js").vendored?
    assert blob("ui/jquery-ui-1.8.22.custom.min.js").vendored?
    assert blob("ui/jquery-ui-1.8.22.js").vendored?
    assert blob("ui/jquery-ui-1.8.js").vendored?
    assert blob("ui/jquery-ui.min.js").vendored?
    assert blob("ui/jquery.ui.accordion.js").vendored?
    assert blob("ui/minified/jquery.effects.blind.min.js").vendored?
    assert blob("ui/minified/jquery.ui.accordion.min.js").vendored?

    # MooTools
    assert blob("public/javascripts/mootools-core-1.3.2-full-compat.js").vendored?
    assert blob("public/javascripts/mootools-core-1.3.2-full-compat-yc.js").vendored?

    # Dojo
    assert blob("public/javascripts/dojo.js").vendored?

    # MochiKit
    assert blob("public/javascripts/MochiKit.js").vendored?

    # YUI
    assert blob("public/javascripts/yahoo-dom-event.js").vendored?
    assert blob("public/javascripts/yahoo-min.js").vendored?
    assert blob("public/javascripts/yuiloader-dom-event.js").vendored?

    # WYS editors
    assert blob("public/javascripts/ckeditor.js").vendored?
    assert blob("public/javascripts/tiny_mce.js").vendored?
    assert blob("public/javascripts/tiny_mce_popup.js").vendored?
    assert blob("public/javascripts/tiny_mce_src.js").vendored?

    # Fabric
    assert blob("fabfile.py").vendored?

    # WAF
    assert blob("waf").vendored?

    # Visual Studio IntelliSense
    assert blob("Scripts/jquery-1.7-vsdoc.js").vendored?

    # Microsoft Ajax
    assert blob("Scripts/MicrosoftAjax.debug.js").vendored?
    assert blob("Scripts/MicrosoftAjax.js").vendored?
    assert blob("Scripts/MicrosoftMvcAjax.debug.js").vendored?
    assert blob("Scripts/MicrosoftMvcAjax.js").vendored?
    assert blob("Scripts/MicrosoftMvcValidation.debug.js").vendored?
    assert blob("Scripts/MicrosoftMvcValidation.js").vendored?

    # jQuery validation plugin (MS bundles this with asp.net mvc)
    assert blob("Scripts/jquery.validate.js").vendored?
    assert blob("Scripts/jquery.validate.min.js").vendored?
    assert blob("Scripts/jquery.validate.unobtrusive.js").vendored?
    assert blob("Scripts/jquery.validate.unobtrusive.min.js").vendored?
    assert blob("Scripts/jquery.unobtrusive-ajax.js").vendored?
    assert blob("Scripts/jquery.unobtrusive-ajax.min.js").vendored?

    # NuGet Packages
    assert blob("packages/Modernizr.2.0.6/Content/Scripts/modernizr-2.0.6-development-only.js").vendored?

    # Test fixtures
    assert blob("test/fixtures/random.rkt").vendored?
    assert blob("Test/fixtures/random.rkt").vendored?
  end

  def test_language
    Samples.each do |sample|
      blob = blob(sample[:path])
      assert blob.language, "No language for #{sample[:path]}"
      assert_equal sample[:language], blob.language.name, blob.name
    end
  end

  def test_lexer
    assert_equal Lexer['Ruby'], blob("Ruby/foo.rb").lexer
  end

  def test_colorize
    assert_equal <<-HTML.chomp, blob("Ruby/foo.rb").colorize

module Foo
end

    HTML
  end

  def test_colorize_does_skip_minified_files
    assert_nil blob("JavaScript/jquery-1.6.1.min.js").colorize
  end

  # Pygments.rb was taking exceeding long on this particular file
  def test_colorize_doesnt_blow_up_with_files_with_high_ratio_of_long_lines
    assert_nil blob("JavaScript/steelseries-min.js").colorize
  end
end


text:
using UnityEngine;
using System.Collections;

public class DownCenterRightGuiPlacementCalculator : AbstractGuiPlacementCalculator
{
	protected override Rect placement()
	{
		float left = Screen.width / 2;
		float top = Screen.height - size.y - VERTICAL_BORDER_OFFSET;

		return new Rect(left, top, size.x, size.y);
	}
}


text:
package gitlab

import (
	"fmt"

	"gitlab.com/leanlabsio/kanban/models"
	"gitlab.com/leanlabsio/kanban/modules/gitlab"
)

// ListMilestones returns list milestones by project
func (ds GitLabDataSource) ListMilestones(board_id string) ([]*models.Milestone, error) {
	var mem []*models.Milestone
	r, err := ds.client.ListMilestones(board_id, &gitlab.ListOptions{
		Page:    "1",
		PerPage: "100",
	})

	if err != nil {
		return nil, err
	}

	for _, item := range r {
		if item.State != "closed" {
			mem = append(mem, mapMilestoneFromGitlab(item))
		}
	}

	return mem, nil
}

// CreateMilestone create new milestone on board
func (ds GitLabDataSource) CreateMilestone(form *models.MilestoneRequest) (*models.Milestone, int, error) {
	var cr *models.Milestone
	var code int
	r, res, err := ds.client.CreateMilestone(fmt.Sprintf("%d", form.ProjectID), mapMilestoneRequestToGitlab(form))
	if err != nil {
		return nil, res.StatusCode, err
	}

	cr = mapMilestoneFromGitlab(r)

	return cr, code, nil
}

// mapMilestoneRequestToGitlab transforms kanban milestone to gitlab milestone request
func mapMilestoneRequestToGitlab(m *models.MilestoneRequest) *gitlab.MilestoneRequest {
	return &gitlab.MilestoneRequest{
		Title:       m.Title,
		Description: m.Description,
		DueDate:     m.DueDate,
	}
}

// mapMilestoneFromGitlab returns map from gitlab milestone to gitlab milestone
func mapMilestoneFromGitlab(m *gitlab.Milestone) *models.Milestone {
	if m == nil {
		return nil
	}

	return &models.Milestone{
		ID:          m.ID,
		IID:         m.IID,
		State:       m.State,
		Title:       m.Title,
		DueDate:     m.DueDate,
		Description: m.Description,
		CreatedAt:   m.CreatedAt,
		UpdatedAt:   m.UpdatedAt,
	}
}


text:
package javasmmr.zoowsome.models.animals;

/**
 *
 * @author Marius Bologa
 *
 */
public class Eagle extends Bird {
	/**
	 *
	 */
	private int legs = 2;
	/**
	 *
	 */
	private String nameE = " Aquila";

	/**
	 *
	 */
	private int flightAltitude = 2000;

	/**
	 *
	 * @param maintenanceCost
	 *            How many hours per week each animal require.
	 *
	 * @param dangerPerc
	 *            How dangerous an animal is.
	 *
	 */
	public Eagle(final double maintenanceCost, final double dangerPerc) {
		super(maintenanceCost, dangerPerc);
		setMigrates(false);
		setAvgFlightAltitude(flightAltitude);
		setName(nameE);
		setNrOfLegs(legs);

	}

	/**
	 *
	 * @param name
	 *            Name of the eagle.
	 * @param migrates
	 *            Migrates or not?
	 * @param altitude
	 *            Average flight altitude.
	 * @param maintenanceCost
	 *            How many hours per week each animal require.
	 *
	 * @param dangerPerc
	 *            How dangerous an animal is.
	 */
	public Eagle(final String name, final boolean migrates, final int altitude, final double maintenanceCost,
			final double dangerPerc) {
		super(maintenanceCost, dangerPerc);
		setMigrates(migrates);
		setAvgFlightAltitude(altitude);
		setName(name);
		setNrOfLegs(legs);
	}
}


text:
ENV["RAILS_ENV"] ||= "test"
require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'
require 'minitest/pride'

class ActiveSupport::TestCase
  ActiveRecord::Migration.check_pending!
  include FactoryGirl::Syntax::Methods

  # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
  # fixtures :all

  # Add more helper methods to be used by all tests here...

  def login_as(role)
    user = FactoryGirl.create(
      :user,
      person: FactoryGirl.create(:person),
      role: role.to_s
    )
    session[:user_id] = user.id
    user
  end

  def sign_in(user)
    post "/session", user: { email: user.email, password: user.password }
  end
end


text:
from django.db import models
from django import forms
from cked.widgets import CKEditorWidget

class RichTextField(models.TextField):
    def __init__(self, *args, **kwargs):
        self.config = kwargs.pop("config", None)
        super(RichTextField, self).__init__(*args, **kwargs)

    def formfield(self, **kwargs):
        defaults = {
            'form_class': RichTextFormField,
            'config': self.config
        }
        defaults.update(kwargs)
        return super(RichTextField, self).formfield(**defaults)

class RichTextFormField(forms.fields.CharField):
    def __init__(self, config=None, *args, **kwargs):
        kwargs.update({'widget': CKEditorWidget(config=config)})
        super(RichTextFormField, self).__init__(*args, **kwargs)

# Fix field for South
try:
    from south.modelsinspector import add_introspection_rules
    add_introspection_rules([], ["^cked\.fields\.RichTextField"])
except:
    pass


text:
using System;
using System.Collections.Generic;
using System.Linq;

using Nucleo.Commands;

namespace Nucleo.EventArguments
{
	/// <summary>
	/// Represents the arguments of a command that fired.
	/// </summary>
    public class CommandEventArgs
    {
		/// <summary>
		/// Gets the optional argument value.
		/// </summary>
        public object Arguments
        {
            get;
            private set;
        }

		/// <summary>
		/// Gets the reference to the command that fired.
		/// </summary>
        public ICommand Command
        {
            get;
            private set;
        }

		/// <summary>
		/// Creates the command args with the given <see cref="ICommand"/> instance.
		/// </summary>
		/// <param name="command">The command that fired.</param>
		/// <param name="args">The arguments.</param>
        public CommandEventArgs(ICommand command, object args)
        {
            this.Command = command;
            this.Arguments = args;
        }
    }

	/// <summary>
	/// Represents the handler of a command which fired.
	/// </summary>
	/// <param name="sender">The object sending the notification.</param>
	/// <param name="e">The command details.</param>
    public delegate void CommandEventHandler(object sender, CommandEventArgs e);
}


text:
using UnityEditor;

namespace Pathfinding {
	[CustomEditor(typeof(RaycastModifier))]
	[CanEditMultipleObjects]
	public class RaycastModifierEditor : EditorBase {
		protected override void Inspector () {
			PropertyField("quality");

			if (PropertyField("useRaycasting", "Use Physics Raycasting")) {
				EditorGUI.indentLevel++;

				PropertyField("use2DPhysics");
				if (PropertyField("thickRaycast")) {
					EditorGUI.indentLevel++;
					PropertyField("thickRaycastRadius");
					Clamp("thickRaycastRadius", 0f);
					EditorGUI.indentLevel--;
				}

				PropertyField("raycastOffset");
				PropertyField("mask", "Layer Mask");
				EditorGUI.indentLevel--;
			}

			PropertyField("useGraphRaycasting");
			if (!FindProperty("useGraphRaycasting").boolValue && !FindProperty("useRaycasting").boolValue) {
				EditorGUILayout.HelpBox("You should use either raycasting, graph raycasting or both, otherwise this modifier will not do anything", MessageType.Warning);
			}
		}
	}
}


text:
import React from 'react';
import AppBar from 'material-ui/lib/app-bar';

export default class NavBar extends React.Component {
  render() {
    return (

        <AppBar
          style={{position: 'fixed', backgroundColor: this.props.color, boxShadow: 'none'}}
          title={ this.props.title }
        />

    );
  }
}


text:
var _ = require('../util').lodash,
    Property = require('./property').Property,
    Script = require('./script').Script,

    Event;

/**
 * @typedef Event.definition
 * @property {String} listen The event-name that this script will be called for. Usually either "test" or "prerequest"
 * @property {Script|String} script A {@link Script} instance that will be executed on this event. In case of a
 * string, a new {@link Script} is created.
 * @example <caption>Constructing an event</caption>
 * var Event = require('postman-collection').Event,
 *     rawEvent = {
 *         listen: 'test',
 *         script: 'tests["response code is 401"] = responseCode.code === 401'
 *     },
 *     myEvent;
 * myEvent = new Event(rawEvent);
 */
_.inherit((

    /**
     * A Postman event definition that refers to an event to be listened to and a script reference or definition to be
     * executed.
     *
     * @constructor
     * @extends {Property}
     *
     * @param {Event.definition} definition Pass the initial definition of the event as the options parameter.
     */
    Event = function PostmanEvent (definition) {
        // this constructor is intended to inherit and as such the super constructor is required to be executed
        Event.super_.call(this, definition);
        // set initial values of this event
        definition && this.update(definition);
    }), Property);

_.assign(Event.prototype, /** @lends Event.prototype */ {
    /**
     * Update an event.
     *
     * @param {Event.definition} definition -
     */
    update (definition) {
        if (!definition) {
            return;
        }

        var result,
            script = definition.script;

        if (Script.isScript(script)) {
            result = script;
        }
        else if (_.isArray(script) || _.isString(script)) {
            result = new Script({ exec: script });
        }
        else if (_.isObject(script)) {
            result = new Script(script);
        }

        _.mergeDefined(this, /** @lends Event.prototype */ {
            /**
             * Name of the event that this instance is intended to listen to.
             *
             * @type {String}
             */
            listen: _.isString(definition.listen) ? definition.listen : undefined,

            /**
             * The script that is to be executed when this event is triggered.
             *
             * @type {Script}
             */
            script: result
        });
    }
});

_.assign(Event, /** @lends Event */ {

    /**
     * Defines the name of this property for internal use.
     *
     * @private
     * @readOnly
     * @type {String}
     */
    _postman_propertyName: 'Event'
});

module.exports = {
    Event
};


text:
if [ ] # empty==false | anything-else==true
then
  echo "Running Spout-Bolt single process"
  for batchsize in 1 10 100 1000 10000
  do
    for recordsize in 100
    do
      echo "Runnig Spout microbenchmark with batch size $batchsize and record size $recordsize"
      bash runSingleSpoutBoltSingleProcess.sh $batchsize $recordsize
    done
  done
fi

# single Spout-Bolt single process (shuffle)
if [ ] # empty==false | anything-else==true
then
  echo "Running Spout-Bolt single process"
  for batchsize in 1 10 100 1000 10000
  do
    for recordsize in 100
    do
      echo "Runnig Spout microbenchmark with batch size $batchsize and record size $recordsize"
      bash runSingleSpoutBoltShuffle.sh $batchsize $recordsize
    done
  done
fi

# single Spout-Bolt
if [ ] # empty==false | anything-else==true
then
  echo "Running Spout-Bolt (multiple workers)"
  for batchsize in 1 10 100 1000 10000
  do
    for recordsize in 100
    do
      echo "Runnig Spout microbenchmark with batch size $batchsize and record size $recordsize"
      bash runSingleSpoutBolt.sh $batchsize $recordsize
    done
  done
fi

# single Spout-Bolt network
if [ ] # empty==false | anything-else==true
then
  echo "Running Spout-Bolt network"
  for batchsize in 1 10 100 1000 10000
  do
    for recordsize in 100
    do
      echo "Runnig Spout microbenchmark with batch size $batchsize and record size $recordsize"
      bash runSingleSpoutBoltNetwork.sh $batchsize $recordsize
    done
  done
fi

# single Spout-Bolt network with data rates
if [ 1 ] # empty==false | anything-else==true
then
  echo "Running Spout-Bolt network (data rates)"
  for recordsize in 100
  do
    for batchsize in 1 10 100 1000 10000
    do
      for ingestionrate in 1000 10000 100000 1000000 "inf"
      do
        echo "Runnig Spout microbenchmark with batch size $batchsize, record size $recordsize, and ingestion rate $ingestionrate"
        bash runSingleSpoutBoltRate.sh $batchsize $recordsize $ingestionrate
      done
    done
  done
fi

# effective input batch size: multiple-Spouts--single-Bolt network with data rates
if [ 1 ] # empty==false | anything-else==true
then
  echo "Running effective batch size"
  for recordsizes in "100,100"
  do
    for batchsizes in "1,1" "1,5" "1,10" "5,10"
    do
      for ingestionrates in "500000,500000" "10000,90000" "90000,10000" "30000,70000" "70000,30000"
      do
        echo "Runnig Effective-Batch-Size microbenchmark"
        bash runEffectiveBatchSize.sh "$batchsizes" "$recordsizes" "$ingestionrates"
      done
    done
  done
fi


text:
/** @jsx React.DOM */
define([
    'react', 'wingspan-forms'
], function (React, Forms) {
    'use strict';

    var options = [{ id: 'male', display: 'Male'}, { id: 'female', display: 'Female'}];

    var PrettyJson = React.createClass({
        render: function () {
            return (
{JSON.stringify(this.props.value, undefined, 2)}
);
        }
    });

    var MyForm = React.createClass({
        getDefaultProps: function () {
            return {
                value: {}, // form value
                onChange: undefined
            };
        },
        render: function () {
            var fieldInfoFirstName= {label: 'First Name'};
            return (

Form

                    <FormField fieldInfo={fieldInfoFirstName}>
                        <KendoText value={this.props.value.firstName}
                            onChange={_.partial(this.props.onChange, 'firstName')} />
                    </FormField>
                    <FormField fieldInfo={_.object([['label', 'Last Name']])}>
                        <KendoText type="text" value={this.props.value.lastName}
                            onChange={_.partial(this.props.onChange, 'lastName')} />
                    </FormField>
                    <FormField fieldInfo={_.object([['label', 'Gender']])}>
                        <KendoComboBox
                            value={this.props.value.gender}
                            onChange={_.partial(this.props.onChange, 'gender')}
                            dataSource={options}
                            valueField="id"
                            displayField="display" />
                    </FormField>

            );
        }
    });

    var App = React.createClass({

        componentWillMount: function () {
            window.app = this; // save ref for dev console
        },

        getInitialState: function () {
            return {
                forms: [
                    {
                        firstName: 'Alice',
                        lastName: 'Armstrong',
                        gender: 'female'
                    },
                    {
                        firstName: 'Bob',
                        lastName: 'Barnaby',
                        gender: 'male'
                    },
                    {
                        firstName: 'Cindy',
                        lastName: 'Crawford',
                        gender: 'female'
                    }
                ]
            };
        },

        onChange: function (formIndex, field, value) {
        	var forms = _.clone(this.state.forms);
        	var newForm = _.clone(this.state.forms[formIndex]);

        	newForm[field] = value;
        	forms[formIndex] = newForm;

        	this.setState({ forms: forms });
        },

        render: function() {

            var forms = _.map(this.state.forms, function (form, i) {
                return (<MyForm value={form} onChange={_.partial(this.onChange, i)} />);
            }.bind(this));

            var forms2 = _.map(this.state.forms, function (form, i) {
                return (<MyForm value={form} onChange={_.partial(this.onChange, i)} />);
            }.bind(this));

            var text = "function deepCopy (tree) { return JSON.parse(JSON.stringify(tree)); }\n\
var nextState = deepCopy(app.state);\n\
nextState.forms.push({});\n\
app.setState(nextState);";

            return (

{forms}

{forms2}

                        <PrettyJson value={this.state} />

Try this in the javascript console:

{text}

                        The source to this example is available here.

            );
        }

    });

    var FormField = Forms.FormField;
    var KendoText = Forms.KendoText;
    var KendoComboBox = Forms.KendoComboBox;

    function entrypoint() {
        React.renderComponent(<App />, document.getElementById('root'));
    }

    return {
        entrypoint: entrypoint
    };
});


text:
<!DOCTYPE html>

  <meta charset="UTF-8">
  <link rel="apple-touch-icon" sizes="76x76" href="/img/favicon.png">
  <link rel="icon" href="/img/favicon.png">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, shrink-to-fit=no">
  <meta http-equiv="x-ua-compatible" content="ie=edge">

  <meta name="theme-color" content="#2f4154">
  <meta name="description" content="">
  <meta name="author" content="John Doe">
  <meta name="keywords" content="">
  <meta property="og:type" content="website">
<meta property="og:title" content="分类">
<meta property="og:url" content="http://example.com/categories/index.html">
<meta property="og:site_name" content="Felix's Blog">
<meta property="og:locale" content="zh_CN">
<meta property="article:author" content="John Doe">
<meta name="twitter:card" content="summary_large_image">

  <title>分类 - Felix's Blog</title>

  <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4/dist/css/bootstrap.min.css" />

<link rel="stylesheet" href="//at.alicdn.com/t/font_1749284_ba1fz6golrf.css">

<link rel="stylesheet" href="//at.alicdn.com/t/font_1736178_kmeydafke9r.css">

<link  rel="stylesheet" href="/css/main.css" />

<meta name="generator" content="Hexo 5.4.0">

      Felix's Blog

    <button id="navbar-toggler-btn" class="navbar-toggler" type="button" data-toggle="collapse"
            data-target="#navbarSupportedContent"
            aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">

    </button>

                首页

                归档

                分类

                标签

                关于

搜索

        <button type="button" id="local-search-close" class="close" data-dismiss="modal" aria-label="Close">
          ×
        </button>

          <input type="text" id="local-search-input" class="form-control validate">
          关键词

     Hexo  Fluid

            总访问量

             次

            总访客数

             人

  <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/nprogress@0/nprogress.min.css" />


text:
This gem provides a way to easily map the functionality of an Arnoldb database to
a ruby project. The core concepts behind this gem's structure and functionality
are derived from the popular
[ActiveRecord](https://github.com/rails/rails/tree/master/activerecord) gem.

## Features

### Map Arnoldb Object Types easily through Inheritance

```ruby
class Library < Arnoldb::Mapper; end
```

Create setter and getters for each Arnoldb field.

### Set up associations

```ruby
class Library < Arnoldb::Mapper
  has_many :book
  belongs_to :city
end
```

Creates associations based off common syntax.

### Query for historic objects

```ruby
user = User.new
user.name = "Arnold"
user.id = "12345-a"
user.save # creates a new record in Arnoldb for the current time

User.find("12345-a") # retrieves record from Arnoldb
user.name = "Terminator"
user.effective_date = 467611200 # unix time
user.save # creates a new record in Arnoldb for a date in the past

user = User.find("12345-a", 467611200) # second parameter is the desired query date
user.name # -> "Terminator"
```

Enable historic Queries on objects.

### Build migrations to help manage Arnoldb updates

```ruby
class CreateUsers < Arnoldb::Migration
  def up
    create_table "users" do |t|
      t.string "id"
      t.string "name"
    end
  end
end
```

Add the ability to run migrations and also keeps track of ran migrations.

### Rebuild Arnoldb states from tracked Schema

```ruby
Arnoldb::Schema.define do
  add_table "users" do |t|
    t.string "id"
    t.string "name"
  end
end
```

The schema.rb file enables developers to quickly visualize Arnoldb's database as
a standard relational database and gives them the power to reconstruct an Arnoldb
database state.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'arnoldb'
```

And then execute:

    $ bundle

Or install it yourself with:

    $ gem install arnoldb

## POC

- Jim Walker jim.walker@namely.com

## License

The Arnoldb gem is under the [MIT license](LICENSE).