teleren/devto huggingface dataset:
GitHub actions with Docker and Nix
Tags: github, automation, docker, clojure
Published: 2020-06-12 17:32:47

---
title: GitHub actions with Docker and Nix
published: true
date: 2020-06-11 00:00:00 UTC
tags: github,automation,docker,clojure
canonical_url: https://www.lafuente.me/posts/github-actions-docker-nix
---

I created my first GitHub action: [clojars publish action](https://github.com/jlesquembre/clojars-publish-action).

 

To see an example in action, you can go to [jlesquembre/dummy-clj](https://github.com/jlesquembre/dummy-clj) and take a look to the actions tab.

 

GitHub actions can run in Docker containers, so I created a Docker image. At first, I went to Docker hub and looked for the clojure images, but I realized that I also needed to install maven. There is also a maven image, but since I need maven **and** clojure on the container, the only option was to create my own image based on the official ones and install the other dependency manually.

 

Then, I remembered about an interesting project I hear about, [Nixery](https://nixery.dev/). With it, you can create Docker images based on [NixOS](https://nixos.org/), and it makes really easy to install dependecies. In my case, I just needed this:

 
```
FROM nixery.dev/shell/maven/clojure
```
 

Done, you alredy have a container with some basic linux utilities, maven and clojure. If you need to install something else, just add `/other-dep`.

 

Since I'm already a [NixOS](https://nixos.org/) user, it is a really good solution for me. It gives me an easy way to install dependecies, on the linux distribution I know the best.
Google authentication with Go Language and Goth
Tags: go, sociallogin, oauth
Published: 2020-09-10 05:46:31

---
title: Google authentication with Go Language and Goth
published: true
date: 2020-06-11 00:00:00 UTC
tags: Go,SocialLogin,OAuth
canonical_url: https://www.loginradius.com/engineering/blog/google-authentication-with-golang-and-goth/
---

In this blog, we’ll be implementing authentication via Google in a Go web application. For this, we’ll be using Goth - Multi-Provider Authentication Package for Go Before You Get Started This tutorial assumes you have: Basic knowledge of HTML/CSS A basic understanding of Go…

   
[Read On](https://www.loginradius.com/engineering/blog/google-authentication-with-golang-and-goth/)
How to round decimals numbers in JavaScript?
Tags: javascript
Published: 2020-06-11 00:00:00

---
  title: How to round decimals numbers in JavaScript?
  published: true
  tags: JavaScript
  date: Thu Jun 11 2020 05:30:00 GMT+0530 (India Standard Time)
  canonical_url: https://melvingeorge.me/blog/round-decimals-javascript
  cover_image: https://melvingeorge.me/_next/static/images/main-31bccb6bbeea8670619da91ea20f0fc7.jpg
  ---
  [Originally posted here!](https://melvingeorge.me/blog/round-decimals-javascript)
  
Decimal numbers can be rounded using the `toFixed()` function.

---

Let's say you have a decimal number like this.

```javascript
const number = 467.8945645672283838;
```

You can round the number to 2 decimal places by providing `2` as the argument to `toFixed` function.

```javascript
const number = 467.8945645672283838;
number.toFixed(2); // 467.89 - Only 2 numbers after decimal point is returned.
```

- Argument `2` passed to `toFixed` function is _optional_.

- If you don't give the `toFixed()` function any argument, only the integer part of the number is returned without the decimal part.

```javascript
const number = 467.8945645672283838;
number.toFixed(); // 467 - No decimal part
```

### Important Note:

- The `toFixed` function always returns string type and not a number type.
- You may need to convert it to a number type before you can do some numerical calculation with it.
- A string can be converted to a number using `Number()` function.

```javascript
const number = 467.8945645672283838;
const roundedNumberString = number.toFixed(2); // returns string type
const roundedNumber = Number(roundedNumberString); // converted to number type
```

### Feel free to share if you found this useful 😃.

---
React Native 2 : creacion de proyecto
Published: 2020-06-10 23:48:03

md reactnative (crear la ubicacion de mis proyectos)
npx react-native init citas (creacion del proyecto)
npx react-native run-android (ejecutar en un celular , el dispositivo debe tener modo depuracion activado)

comandos utiles:
ctrl+M = lanza modo debugger de Chrome/web

opcional:
https://github.com/jhen0409/react-native-debugger/releases es un debugger para react
try coding me
Published: 2020-06-10 23:28:02

js : document.querySelector('body').addEventListener('mousemove', eyeball);

function eyeball(){
  let eye = document.querySelectorAll('.eye');
  eye.forEach(eye=>{
    var x = (eye.getBoundingClientRect().left)+ (eye.clientWidth/2);
      var y = (eye.getBoundingClientRect().top)+ (eye.clientHeight/2);
    let radian = Math.atan2(event.pageX - x, event.pageY - y);
    let rot = (radian * (180 / Math.PI) * -1)+ 270;
    eye.style.transform = "rotate(" + rot+ "deg)"
  })
}

css : *{
  margin:0;
  padding:0;
  box-sizing:border-box;
}
body{
  display:flex;
  justify-content:center;
  align-items:center;
  background:rgb(82, 49, 0);
  min-height:100vh;
}

.face{
    width:300px;
    height:300px;
    border-radius:50%;
    background-color:#ffcd00;
    display:flex;
    justify-content:center;
    align-items: center;
    position:relative;
  }

.face::before{
  content:'';
  position:absolute;
  top:180px;
  width:150px;
  height:70px;
  background:#b57700;
  border-bottom-left-radius:70px;  border-bottom-right-radius:70px;
  transition:0.5555555s;
}

.face:hover::before{
  content:'';
  position:absolute;
  top:210px;
  width:170px;
  height:20px;
  border-radius:500%;
  background:#b57700;
   border-bottom-left-radius:0px;  border-bottom-right-radius:0px;
}

.eyes{
  position:relative;
  top:-40px;
  display:flex;
  
}

.eye{
  position:relative;
  width:80px;
  height:80px;
  border-radius:50%;
  disp;ay:block;
  margin:0 15px;
  background:rgb(255, 255, 255);
}

.eye::before{
  content:'';
  position:absolute;
  top:50%;
  left:25px;
  transform:translate(-50%,-50%);
  background: rgba(0, 0, 0);
  border-radius:50%;
  width:40px;
  height:40px;
}

HTML: <div class="face">
<div class="eyes">
  <div class="eye"></div>
  <div class="eye"></div>
  </div>
</div>
The very simple reason why i don't use vim but prefer nano
Tags: vim, rant, dev, nano
Published: 2020-06-10 23:15:37

First of all, i know this might be an unpopular opinion of mine, but i had to say this: i prefer nano over vim, did you hear it right Richard? yes of course you did.<br>
The first thing you might wonder is why is this random guy trolling on dev, but trust me i'm not.<br>
First of all, let's make something clear, **i have used vim before** but i've encountered some little annoyance each time i try to learn it,now let's see the whys of this post.
* [Vim is hard to learn](#Hard)
* [I don't have time, i might as well use an IDE](#WTF??)
* [Nano is better](Nano)
* [I broke my q letter on the keyboard and can't exit vim](#The real reason)
<br>
* Hard
------
Vim is, let's face it, hard to learn, it's facts that's all.
* WTF??
-------
I don't have time to learn how to use vim to it's full extend might as well use an IDE or even better **nano**<br>
* Nano
------
Come on, nano is waaay easier to exit and more user friendly than vim or all these IDEs, **Long Live Lord Nano**
* The real reason
-----------------
Ok, now's time for the revelation,i've never ever preferred nano over vim,it's just that,😳,i broke my q key on the keyboard and without it, i simply can't exit vim(**This is the truth,this is not a joke at all**),<br> So in all my anger and frustration i have to use the likes of nano or Vscode, i mean, who in their sane mind uses them?babies? Come on, real men use vim(or don't)<br><br><br>
Hope you enjoyed reading my rant,<br> From the kitchen, @juju
PCF WebApi execute
Tags: d365, pcf, powerapps, dataverse
Published: 2021-04-21 19:05:26

---
title: PCF WebApi execute
published: true
date: 2020-06-10 23:05:42 UTC
tags: D365,PCF,PowerApps,Dataverse
canonical_url: http://www.oliverflint.co.uk/2020/06/11/PCF-WebApi-execute/
categories:
  - Power Apps Component Framework
  - PCF Tips 'n' Tricks
description: Yep, execute is missing from the docs and the type definitions but it's there and it works!
excerpt: Yep, execute is missing from the docs and the type definitions but it's there and it works!
---
## The PCF WebApi execute method is lurking in the background!

Yep, missing from the [docs](https://docs.microsoft.com/en-us/powerapps/developer/component-framework/reference/webapi) and the type definitions but it's there and it works!

![](http://www.oliverflint.co.uk/2020/06/11/PCF-WebApi-execute/pcf-webapi.png)

### execute

```typescript
(context.webAPI as any).execute(request).then(successCallback, errorCallback);
```

_see the `execute` Client API [docs](https://docs.microsoft.com/en-us/powerapps/developer/model-driven-apps/clientapi/reference/xrm-webapi/online/execute) for more info_

### executeMultiple

```typescript
(context.webAPI as any)
  .executeMultiple(requests)
  .then(successCallback, errorCallback);
```

_see the `executeMultiple` Client API [docs](https://docs.microsoft.com/en-us/powerapps/developer/model-driven-apps/clientapi/reference/xrm-webapi/online/executemultiple) for more info_

Enjoy!
Ollie

_Disclaimer!_
_Some of the tips 'n' tricks in the [PCF Tips 'n' Tricks](http://www.oliverflint.co.uk/categories/Power-Apps-Component-Framework/PCF-Tips-n-Tricks/) category are to be used with caution. Although they may work at the time of writing, they may or may not be officially supported by Microsoft_
Job Search Week 16
Tags: makers
Published: 2020-06-10 23:04:37

I spent this week doinng job applications I got 20 done in total as well as doing a cover letter for each. I was asked recently why I do them all at the end of the month the main reason is at the end of the month I know more about coding so I feel I can write a better cover letter.

Day 1

So I started the week by looking for jobs that would suit me. It took a bit of time because there's so many different job site, the main ones I use are Otta, LinkedIn, TotalJobs and Indeed. I mainly went for JavaScript jobs because that's what I've been practising recently.

Day 2

On Tuesday I started typing up cover letters for each of my job applications. Some of the applications would only let you add on document but one of my friend taught me a neat trick to just put your cover letter on top of your CV. Which meant I could get a cover letter in for every job.

Day 3

Wednesday I continued to look for jobs and type cover letters for the jobs that I had found. It was a lot easier to do with a template but it was difficult to decide what the most important points were. I would mainly got over the points that the application had down as essential and typed a short description of were I've used and learned those skills.

Day 4

I started sending off some of my applications on Thursday. I did manage to find some good jobs in places I'd like to work in or ideas I'd like to work on. Although I think sometime my cover letters don't convey my skill as a developer as well they should which is why I put my GitHub at the bottom so they can see proof on my skill as a developer instead of taking my word for it.

Day 5

I decide to continue to look for jobs and finish up the last few cover letters on Friday and decided I would send the rest off over the weekend. I was happy to get all those cover letters done and I definitely feel like I'm better at typing up cover letters thanks to it.

Summary
I got a lot of applications done this week which I'm happy about and I think my new system is working well. I would like to get some feedback on my portfolio so I might as my brother or some other developers.
Day 151 : No Fear
Tags: hiphop, code, coding, lifelongdev
Published: 2020-06-10 22:59:50

_liner notes_:
- Professional : I did it! Got the workshop videos recorded, edited, rendered, uploaded and submitted. There was a pretty bad storm yesterday that hampered my ability to work. So I got up super early to finish it up. I had to do some other work and attend video calls on my Chromebook because my work MacBook was struggling to render the video recordings. Sat in on a couple of talk prep sessions. Got an introduction on SwiftUI. Pretty good day. Had a lot on my plate, but no fear, we got it done.

- Personal : Didn't do too much. It was storming. Went to bed early because I had to get up early to finish the videos.

![Above the clouds shot with mountain tops in Mt. Teide, Canary Islands](https://dev-to-uploads.s3.amazonaws.com/i/ua5x82qpe9ndtnfu25lq.png)

Whew, once I found out that everything was good with my workshop video, I fell right to sleep and caught like the best nap ever. It was so good, that when I woke up, I thought all the madness happening in the world, was a horrible nightmare. Nope. Probably eat dinner and go to sleep.

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube xUDNMmbYtkw %}
SignalR WebSockets ChatHub ASP.NET Core 3.1 (github example)
Published: 2020-06-10 22:19:21


Our 7th article in this series and the result:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/dn5xadl4egn6nedr1xzq.gif)

And the [GitHub project which includes some work on a CSS parser](https://github.com/Javaman2/dslParser)
A Mediocre Dev Idea (feedback welcome)
Tags: idea, validation, community, sideprojects
Published: 2020-06-10 22:05:53

---
title: A Mediocre Dev Idea (feedback welcome)
published: true
description: 
tags: idea, validation, community, sideproject 
---

This idea has been floating around my head for a few months now, but I'm wondering if it is at all worthwhile.

What do you think of an online community for software devs, architects, sys admins... really any type of IT role with the focus of the community around mistakes made and lessons learned? The tentative name floating around my head is MediocreDev.

I was at work a couple months ago talking shop with some of my more senior engineer colleagues, and they had so many hilarious horror stories about seemingly innocuous coding errors and erroneous system configs that had disastrous effects when deployed into production. I realized that not only were these stories very entertaining, but they were also pretty informative. They learned many lessons from these mistakes and were now imparting that knowledge to me so that I would not repeat the same mistakes that they had already made in the past. Of course, being engineers, we had good debate about possible solutions and remedies to these mistakes, resulting in good dialog about best practices as it related to those mistakes.

After this discussion, I thought it would be kinda cool to turn this interaction into a website. I mean, every person in IT has made or seen at least a few mistakes during their career that had a negative net effect, whether it be on business operations, product development, or whatever. We should be sharing these stories with each other to help make each other better engineers. If enough users use the community, it could potentially even turn into sort of a best practices platform that other IT people can search just to get perspective around a particular technology or strategy before they attempt it. Pie in the sky stuff I know, but I do see some value in engineers sharing this kind of information with each other.

I haven't attempted to start building this idea for a couple reasons:

1) Time: I just haven't had time to sit down and try to plan how to build this
2) Validation: I'm not sure if this is something other IT people would even be interested in using.
3) Motivation: I'm not super excited about attempting to build an online community. Mainly because I don't think I'd have the patience necessary to build up the community. That being said, if this community existed, I would use it. Though I don't think that is enough of a reason to try to build something like an online community.

I was hoping to get some feedback about this idea. Would any of you all use an online community like this? Do you know of any other online communities already out there similar to this? What would it take to get any of you IT guys and gals to consistently visit and participate in a community like this?

Thanks and stay safe
Documentar uma API em Laravel com o Apirus Ferramenta visual
Tags: laravel, php
Published: 2020-06-10 21:58:00

- Útil para você, considere me pagar um café. Obrigado!
- Useful for you, consider buying me a coffee. Thanks!

ETH:
0xdfaf8F1bCaaB513A14E5a0B8C2D0bF7EE6ECabbc 

<a href="https://www.bitcoinqrcodemaker.com"><img src="https://www.bitcoinqrcodemaker.com/api/?style=ethereum&amp;address=0xdfaf8F1bCaaB513A14E5a0B8C2D0bF7EE6ECabbc" alt="Ethereum QR Code Generator" height="300" width="300" border="0" /></a>



Referência:
https://github.com/vaneves/apirus

Crie um novo projeto Laravel,dentro dele, adicione a Apirus ferramenta ao projeto, digite o comando de instalação:

``` composer create-project --prefer-dist vaneves/apirus ```

Se for instalar fora de um projeto Laravel,use o comando:

``` composer create-project --prefer-dist vaneves/apirus meu_projeto```


Entre na pasta **apirus**.
Altere o nome do arquivo .env.exemple para .env

```cp .env.example .env```



No arquivo .env altere as variáveis de ambientes.

``` 
API_URL=http://example.com/api

SOURCE=
DIST=
THEME=
HIGHTLIGHT=  

```

Entre na pasta **apirus**,e depois em DOCS,será nesse diretório que devemos enviar a documentação da nossa API,no formato markdown,para que o interpretador nos forneça uma interface visual e de fácil manipulação e teste.

Dentro do diretório /docs atualize sua documentação enviando seu novo diretório com os arquivos.


![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/98q6twjnwywskubmcbm0.png)

Dentro da sua pasta **DOCS**,deve ter algo como isso.Arquivos em 
**Markdown** .md que irão formatar os código para que a interface gráfica da ferramenta,possa nos fornecer uma documentação e teste mais amigável.


![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/1pq1hotfdzbx5ejqmcqs.png)


Após fazer o processo,precisamos buildar as atualizações,digitaremos os seguintes comandos:

Entre na pasta apirus

-localhost/apirus

### Digite o comando inicial

Incialmente:

``` php apirus```

### Digite o comando de finalização

E para atualizar a documentação digite esse comando após atualizar seu diretório em /docs. Comando:

``` php apirus --src docs -h monokai```



![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/ibdk1i01d760s1xo18cm.png)



Pronto,tudo certo,podemos ter como resultado a documentação da api em:

``` http://localhost/meu_projeto/public/ ```


![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/6tl179cdoe2b49yebrnn.png)


Em desenvolvimento/finalização
Vídeo Tutorial:
https://www.youtube.com/watch?v=qKJX56K6QdY
IndieHackers light theme
Tags: showdev
Published: 2020-06-10 21:54:27

I built a light theme extension (Chrome for now) for [indiehackers](https://www.indiehackers.com/), for the few people like me who prefer a light background :)

![](https://res.cloudinary.com/ximg/image/upload/w_732,h_500,c_limit/f_auto/whoami/4a595384/post/WXVRIOkQWhLrfyWY.png)
<figcaption></figcaption>
I really enjoy reading people's stories over there, and actually find the current look quite pleasing. My problem though is I prefer to code with a light background in my IDE, and if spend enough time on this site my eyes adjust, and then switching back its like staring into the sun.

This extension adds a very basic light theme, and you can quickly toggle back for a session by clicking the extension icon. (it will toggle back to dark for the current tab)

Hope someone finds it useful: The code is open source (MIT) and available from <https://github.com/lpellis/IndieHackers-Light-Theme>

 Originally published at <https://loftie.com/post/indiehackers-light-theme>
SignalR : Invoking Server Methods (non-proxy)
Tags: angular, signalr, typescript
Published: 2020-06-10 21:52:12

**Client Side Without Proxy**

This series up to now has not discussed the Client Side Hub Proxy as we are just becoming familiar with SinglarR. We'll discuss the Client Side with a proxy after this section.

The interface for a HubConnection to Invoke a server side method is:
```typescript 
invoke<T = any>(methodName: string, ...args: any[]): Promise<T>;
```

But what does this part mean?
```typescript
...args: any[]
```
Here's what it doesn't mean
```typescript
this.connection.invoke("SendMessage", ["p1", "p1"]);
// rather
this.connection.invoke("SendMessage", "p1", "p2");
```

The number of parms must match the server side. Which is most likely why the interface allows for strongly typed objects.  We were not using strong types when we discovered this. 

**Server Side Implied Methods**

This code, on the server side, implies that the clients need to hook up to the Receive message event handler. There doesn't seem to be any contracts (if not using classes or interfaces) so don't forget to look into the Hub code for their "implied methods"

```csharp
public Task SendMessage(string user, string message)
{
// Clients must have an eventhandler for ReceiveMessage
 return Clients.All.SendAsync("ReceiveMessage", user, message);
}
```
Here's what the Client Side Event Handlers look like

```typescript
  // Yes we hook up to the implied message method this way.
  this.connection.on("ReceiveMessage", (msg, msg2) => {
      let now = Date.now();
      let time = new Date(now).toLocaleTimeString();
      this.messages.unshift(`${time}  |  ${msg}  : ${msg2}`);
      this.stringified = this.messages.reduce((acc, item) => {
        return acc + "\n" + item;
      });   
    });
```
**Client Side With Proxy**
[Generated Proxies](https://docs.microsoft.com/en-us/aspnet/signalr/overview/guide-to-the-api/hubs-api-guide-javascript-client#the-generated-proxy-and-what-it-does-for-you)

In short, Proxies allow you to see the server side Hub's methods, you don't have any magic string stuff going on as shown above.

Recommendations:

✔️ Use strong types, its just is easier. 
✔️ Use proxies for automatic server-side API discovery.
✔️ Store messages in an Array then convert to strings for display.
✔️ Filters and sorting work great on JavaScript arrays.
You can now web-monetize your DEV posts! (But don't get your hopes up too quickly)
Tags: webmonetization, gftwhackathon, coil, meta
Published: 2020-06-10 21:44:46

...You won't make a lot of money right away with this new feature, but _you_ can now enable web monetization by adding a "payment pointer" to your account.

## **👉 [settings/misc](/settings/misc) to add a payment pointer**

It's also in beta so there may be some kinks to work out.

Full details of how payment pointers in this other post...

{% link https://dev.to/devteam/dev-is-now-web-monetized-21db %}

I just wanted to mention how happy I am personally that we were able to ship functionality. It allows individual authors on DEV to get on board — right through their settings! As more [Forems](https://dev.to/devteam/for-empowering-community-2k6h) pop up, platform creators and individual members may be able to share in the pie. A lot of adoption has to happen for this to work out, but it's a future we're happy to be pushing.

Web monetization is not baked into browsers yet, but it may be sometime soon. Mozilla's support for Grant for the Web is cool to see. This could be an important part of content-driven web in the future.

{% devcomment oj9n %}

[Coil](https://coil.com?ref=dev) is the company principally behind web monetization. You can support web-monetized content creators by spending $5/month through their service.

_Disclaimer: that's a [Coil](https://coil.com?ref=dev) referral link_.

Happy monetizing 🤑