(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
Google Chrome Developers says:
The new WOFF 2.0 Web Font compression format offers a 30% average gain over WOFF 1.0 (up to 50%+ in some cases). WOFF 2.0 is available since Chrome 36 and Opera 23.
Some examples of file size differences: WOFF vs. WOFF2
| Uniregistry, Corp. 9 ['COUNTRY', 'CHRISTMAS', 'PICS', 'PHOTO', 'GIFT', 'LINK', 'GUITARS', 'SEXY', 'TATTOO'] | |
| Afilias Limited 8 ['BLACK', 'MEET', '\xe7\xa7\xbb\xe5\x8a\xa8 (xn--6frz82g) \xe2\x80\x93 Chinese for "mobile"', 'BLUE', 'KIM', 'PINK', 'RED', 'SHIKSHA'] | |
| United TLD Holdco Ltd. 7 ['DEMOCRAT', 'SOCIAL', 'MODA', 'DANCE', 'IMMOBILIEN', 'KAUFEN', 'NINJA'] | |
| United TLD Holdco, Ltd. 7 ['ROCKS', 'CONSULTING', 'HAUS', 'PUB', 'ACTOR', 'REVIEWS', 'FUTBOL'] | |
| Top Level Domain Holdings Limited 6 ['VODKA', 'COOKING', 'RODEO', 'HORSE', 'FISHING', 'MIAMI'] |
| import numpy as np | |
| import marisa_trie | |
| from sklearn.feature_extraction.text import CountVectorizer | |
| from sklearn.externals import six | |
| class MarisaCountVectorizer(CountVectorizer): | |
| # ``CountVectorizer.fit`` method calls ``fit_transform`` so | |
| # ``fit`` is not provided | |
| def fit_transform(self, raw_documents, y=None): |
Install ElasticSearch and Java
1 wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.0.1.deb
2 sudo dpkg -i elasticsearch-1.0.1.deb
3 sudo update-rc.d elasticsearch defaults 95 10
4 sudo add-apt-repository ppa:webupd8team/java
5 sudo apt-get update
6 sudo apt-get install oracle-java7-installer
7 java -version
| app = angular.module 'BlogExample', [] | |
| # Simple controller that loads all blog posts | |
| app.controller 'BlogCtrl', ['$scope', 'Blog', ($scope, Blog) -> | |
| # Get all the blog posts | |
| Blog.all().then (posts) -> | |
| $scope.posts = posts | |
| # Extend the $scope with our own properties, all in one big block | |
| # I like this because it looks like declaring a class. |
| angular.module('myMdl', []).config(['$httpProvider', function($httpProvider) { | |
| $httpProvider.responseInterceptors.push([ | |
| '$q', '$templateCache', 'activeProfile', | |
| function($q, $templateCache, activeProfile) { | |
| // Keep track which HTML templates have already been modified. | |
| var modifiedTemplates = {}; | |
| // Tests if there are any keep/omit attributes. | |
| var HAS_FLAGS_EXP = /data-(keep|omit)/; |
| angular.module('myMdl', []).config(['$httpProvider', function($httpProvider) { | |
| $httpProvider.responseInterceptors.push([ | |
| '$q', '$templateCache', 'activeProfile', | |
| function($q, $templateCache, activeProfile) { | |
| // Keep track which HTML templates have already been modified. | |
| var modifiedTemplates = {}; | |
| // Tests if there are any keep/omit attributes. | |
| var HAS_FLAGS_EXP = /data-(keep|omit)/; |
For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.
Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.
You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.
| // State example: | |
| // | |
| // $stateProvider | |
| // .state('state', { | |
| // url: 'state/:id', | |
| // template: stateTemplate, | |
| // controller: stateController, | |
| // // Expose parameters in display names using {:param} syntax | |
| // displayName: 'State ({:id})' | |
| // }); |