web
Is it possible to integrate MaterializeCss into Bootstrap
Materialize is not based on Bootstrap nor just a “visual layer”, using both frameworks may lead to a lots of incompatibilities or at least overlap a lot as most of their functionalities are redundant (grids, menus, icons, etc). I personally use this project Bootstrap material design which is a theme for Bootstrap and works very … Read more
Creating common controller functions
The way to define common code in angular is through Services. You would define a new service like so : .factory(‘CommonCode’, function ($window) { var root = {}; root.show = function(msg){ $window.alert(msg); }; return root; }); In your controller you would inject this service..like so function MainAppCtrl($scope,CommonCode) { $scope.alerter = CommonCode; $scope.alerter.show(“Hello World”); } Just … Read more
How to get the raw content of a response in requests with Python?
After requests.get(), you can use r.content to extract the raw Byte-type content. r = requests.get(‘https://yourweb.com’, stream=True) r.content
Using Sphinx to write personal websites and blogs
I’ve done it at http://reinout.vanrees.org/weblog. The key trick is to add a preprocessor step. I’ve got my blog entries in a weblog/yyyy/mm/dd/ folder structure. A script iterates through that folder structure, creating index.txt files in every directory, listing the sub-items. The normal Sphinx process then renders those index.txt files. I added a custom Sphinx processor … Read more
Angular 2 Errors and Typescript – how to debug?
Assuming you’re using Chrome, you can put breakpoints in the “sources” tab in your console. Those breakpoints can be set on the ts files. If you need informations from the js file, you can uncheck Javascript sourcemaps in the console settings: this will allow you to put breakpoints in the js files. On a breakpoint, … Read more
Spring boot + thymeleaf in IntelliJ: cannot resolve vars
Update TL;DR: skip to accepted answer below: https://stackoverflow.com/a/44804086/474034 As mentioned in the comments by multiple people, this solution is not correct. The Thymeleaf documentation (see http://thymeleaf.org/doc/tutorials/3.0/usingthymeleaf.html), have in all their examples a version with www. included: <html xmlns:th=”http://www.thymeleaf.org”> See also the Standard-Dialect.xml on Github, which declares namespace-uri as: namespace-uri=”http://www.thymeleaf.org” Original Answer I had two different … Read more
Ruby on Rails error “cannot load such file — less”
I guess you are using sass instead of LESS. Have you tried the twitter-bootstrap-rails gem? gem “therubyracer” gem “less-rails” gem “twitter-bootstrap-rails” https://github.com/seyhunak/twitter-bootstrap-rails
Difference between “maxlength” & “size” attribute in html?
The maxlength (not max-length) attribute specifies the maximum length of the input string in characters or, more exactly, in code units. The browser is expected to enforce this, by refusing to accept more characters. However, this is not meant to act as a security measure, since it can be overridden trivially. Rather, it tells the … Read more