Vue ‘export default’ vs ‘new Vue’

When you declare: That is typically your root Vue instance that the rest of the application descends from. This hangs off the root element declared in an html document, for example: The other syntax is declaring a component which can be registered and reused later. For example, if you create a single file component like: … Read more

Cross-Domain Cookies

I have two webapps WebApp1 and WebApp2 in two different domains. I am setting a cookie in WebApp1 in the HttpResponse. How to read the same cookie from HttpRequest in WebApp2? I know it sounds weird because cookies are specific to a given domain, and we can’t access them from different domains; I’ve however heard … Read more

Python for C++ Developers

I never really understood the “Language X for Language Y developers” approach. When I go looking to learn Language X I want to learn how to program in it the way that Language X programmers do, not the way Language Y programmers do. I want to learn the features, idioms, etc. that are unique to … Read more

Using custom fonts using CSS?

Generically, you can use a custom font using @font-face in your CSS. Here’s a very basic example: Then, trivially, to use the font on a specific element: (.classname is your selector). Note that certain font-formats don’t work on all browsers; you can use fontsquirrel.com‘s generator to avoid too much effort converting. You can find a … Read more

‘if’ in prolog?

A standard prolog predicate will do this. will evaluate to true if you call it with 5 and fail(return false) if you run it with anything else. For not equal you use \= Technically it is does not unify, but it is similar to not equal. Learn Prolog Now is a good website for learning … Read more