Browserify, Babel 6, Gulp – Unexpected token on spread operator

That syntax is an experimental proposed syntax for the future, it is not part of es2015 or react so you’ll need to enable it. npm install –save-dev babel-plugin-transform-object-rest-spread and add “plugins”: [“transform-object-rest-spread”] into .babelrc alongside your existing presets. Alternatively: npm install –save-dev babel-preset-stage-3 and use stage-3 in your presets to enable all stage-3 experimental functionality.

CSS :first-letter not working

::first-letter does not work on inline elements such as a span. ::first-letter works on block elements such as a paragraph, table caption, table cell, list item, or those with their display property set to inline-block. Therefore it’s better to apply ::first-letter to a p instead of a span. p::first-letter {font-size: 500px;} or if you want … Read more

Matching strings with wildcard

Often, wild cards operate with two type of jokers: ? – any character (one and only one) * – any characters (zero or more) so you can easily convert these rules into appropriate regular expression: // If you want to implement both “*” and “?” private static String WildCardToRegular(String value) { return “^” + Regex.Escape(value).Replace(“\\?”, … Read more

ggplot plots in scripts do not display in Rstudio

The solution is to explicitly call print() on ggplot object: library(ggplot2) p <- ggplot(mtcars, aes(wt, mpg)) p <- p + geom_point() print(p) ggplot function returns object of class ggplot; ggplot2 works by overloading print function to behave differently on objects of class ggplot – instead of printing them to STDOUT, it creates chart. Everything is … Read more

Trailing slash triggers 404 in Flask path rule

Your /users route is missing a trailing slash, which Werkzeug interprets as an explicit rule to not match a trailing slash. Either add the trailing slash, and Werkzeug will redirect if the url doesn’t have it, or set strict_slashes=False on the route and Werkzeug will match the rule with or without the slash. @app.route(‘/users/’) @app.route(‘/users/<path:path>’) … Read more