Danywalls

Life , Coding , Father

VeeValidate is a plugin for #Vue that allows you to validate the HTML elements and show errors in an easy way, only adding the v-validate directive in the input and the validations that we need to be divided by a pipe.

VeeValidate has more than 20 validations by default, it also creates an errors objects where the references to all the validations that we have in our instance of Vue are stored.

Read more...

Many times we want to create an API Rest quickly and work beyond our localhost, then JSON-Server and Now come to the rescue.

Now allows us to publish static portals, but also applications with Node, so we will publish our API rest using JSON-server.

mkdir myfakeapp npm init -y npm install json-server --save-dev

API

To create the API using json-server, first creates a file db.json with the definition of the API so that json-server generates the verbs get, post, put and delete of the different entities that we define into the file.

{ "Games": [ { "id": 1, "vsteam": "Raptors", "date": "12/12/2017", "result": 0 } ] }

Read more...

Today I sold my Magic Mouse 2, the truth is a few months ago when I bought the main aspects beautiful mouse and could be charged with the same cable of the iPhone, it was the best solution to say goodbye to the batteries, In summary perfect.

The months passed and aside from the beauty, the functionality on the Mac was “fine”, the gestures, but ... from there .. nothing special, in my day to day I work with a Logitech Mouse of 9 euros

I have become accustomed to the behavior of Mouse Logitech, besides that when I start the virtual machine with Windows, the Magic Mouse does not have the fluency I expected or the smoothness when moving the mouse.

If you are a person who only uses Mac because you always use Magic Mouse it will be a trustworthy purchase, but if you spend 8 hours with a “normal” mouse and you only use the Magic Mouse a few hours when you are at home then I do not think it is a great purchase

For less than € 20 you have better options that work perfectly well on both Windows and Mac.

Logitech M185 GHB Optical Mouse Vertical Ergonomic Mouse

#Mac

If something I have to recognize is that #Typescript allows to have control in #Javascript and that is also thanks to the typings (tsd), but some libraries isn't typings ready, like my library rdjs and I need to create them.

Creating the typings

To create our library typings, we have to have our library installed using npm and within our project, we create a directory called typings and in another one with the name of the library that we want in my case rdjs

npm install rdjs typings / index.d.ts typings / rdjs / index.dt.ts

Typescript interprets the * .d.ts files as declaration files and these describe the methods the library exposes without implementing them.

In the typings directory, we have an index.d.ts that will contain a reference to each of our declaration files.

Read more...

These days I was working in a place where “the proxy” was not my best friend, trying to install my packages using npm or install the VSCode extensions was impossible so I need to configure the proxy in both.

From the terminal:

npm config set proxy http: // yourproxyiporaddress: port npm config set https-proxy http: // yourproxyiporaddress: port`

For VSCode extensions the “proxy” is also required:

Preferences> User Settings "http.proxy": "http: // yourproxyiporaddress: port" ` #proxy