teleren/devto huggingface dataset:
Что такое "Детали Машин" и с чем их едят?
Published: 2021-01-28 11:08:28

📌Одним из важнейших факторов научно-технического прогресса, способствующих скорейшему совершенствованию общественного производства и росту его эффективности, является проблема повышения уровня подготовки специалистов.

📌Решению этой задачи способствует выполнение курсового проекта по «Деталям машин» базирующегося на знаниях физико-математических и общетехнических дисциплин- математики, механики, сопротивления материалов, технологии металлов, черчения.

📌Объектом курсового проектирования является одноступенчатый редуктор -механизм, состоящий из зубчатой передачи, выполненный в виде отдельного агрегата и служащий для передачи вращения от вала двигателя к валу рабочей машины.

📌Назначение редуктора — понижение угловой скорости и соответственно повышение вращающего момента ведомого вала по сравнению с ведущим валом.

📌Редуктор проектируется по заданной нагрузке (моменту на выходном валу) и передаточному числу без указания конкретного назначения, что характерно для специализированных заводов, на которых организовано серийное производство редукторов.

📌Редукторы классифицируются по следующим признакам:
по типу передач (зубчатые, червячные или зубчато-червячные,
по числу ступеней (одноступенчатые, многоступенчатые);
по типу колёс (цилиндрические, конические, коническо-цилиндрические);
по расположению валов в пространстве (горизонтальные, вертикальные).
What is the name of this font ? [images]
Tags: help, vscode, javascript
Published: 2021-01-28 10:57:02

From this website (JEST doc) : https://jestjs.io/docs/en/snapshot-testing
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/fiwhkm7q13txs0dzxv7v.png)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/qkfq2ire81qr9dnjp253.png)
FREE 10+ Bootstrap Responsive Login Form Snippets
Tags: html, css, webdev
Published: 2021-01-28 10:49:38

In this developed world, the protection of information is essential. Due to a minor privacy issue, Google has chosen to shut down its social media administration, Google+. After the release of Cambridge Analytica, still, a large number of us are delayed using FB. As the site owner, it is our responsibility to protect our customers' data. Creating a secure login page is the first step in verifying our customer information. In this case, we have collected Bootstrap models for the login page that will enable clients to log in securely. For all the bootstrap login forms, Today in this article I share various examples of responsive login forms snippets done using HTML, CSS, JavaScript, and Bootstrap 4.

All of these bootstrap login form pages also work with modern web development frameworks, allowing you to successfully install additional layers of protection. On a site with your sensitive information, try using two-factor authentication in any location you can think of.

Get the free login forms snippets here: https://frontendor.com/blog/10-bootstrap-responsive-login-form
How to export Google Spreadsheet as MS Excel File
Tags: googleappscript, appscript, addon, googlespreadsheet
Published: 2021-01-28 10:49:11

Many times we want to send the Google Spreadsheet as a MS Excel attachment to external email id. There is one way to the file as blob as below

_DriveApp.getFileById('AASD12asdA3as').getBlob()_
but this will return the file as "PDF" by default.
So to get the file in MS Excel format, one can use below code
_var oExportedFile = UrlFetchApp.fetch(       Drive.Files.get('AASD12asdA3as').exportLinks['application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'], 
        {
          headers: {
            Authorization: 'Bearer ' + ScriptApp.getOAuthToken()
          }
        }
      );_

Well, this will give us a MS Excel file but the name will be "exports.xlsx", irrespective of the original Google Sheet name! So, to set a custom name, add below line

_var oXslFile = DriveApp.createFile(oExportedFile.getBlob()).setName('Custom File Name');_

To get MS Document or presentation file, all you need to do is to change the parameter passed to _exportLinks_ property. To know all the possible values, please visit [this link](https://filext.com/faq/office_mime_types.html)

Hope this helps you!
Regards
Migrating a Digital Ocean LoadBalancer to another Kubernetes cluster
Tags: kubernetes, digitalocean
Published: 2021-01-28 10:34:46

At [Datacake](https://datacake.co), we provide our customers with the option to white-label their IoT platform. To do this, they set their DNS to point to a Load Balancer on our Kubernetes cluster, which is running on Digital Ocean.

In an ideal world, all customers would use a `CNAME` on a subdomain or an `ALIAS` on a top-level domain. In the real world, not all domain providers support the [introduced-in-2011 ALIAS](https://blog.dnsimple.com/2011/11/introducing-alias-record/) record type, so most customers with a top-level domain resort to using a classic A-record.

Recently, we upgraded our Kubernetes to a new cluster (for various reasons we couldn’t use the old one anymore). Unfortunately, Load Balancers on Digital Ocean still don’t support floating IPs in 2021 and so we somehow had to move the existing Load Balancer to prevent our customers from having to update their DNS. Turns out, according to their support, there’s no way to do this. **Spoiler: there is.**

While going through the resource definition of the old service, I noticed an annotation called `kubernetes.digitalocean.com/load-balancer-id`. The value of this annotation looked a lot like a UUID and, as it turned out, it’s exactly what it says it is: It’s the ID of the Load Balancer object on Digital Ocean.

So I spun up a test Load Balancer, copied its ID, created a new K8S service of type `LoadBalancer` with an annotation containing the ID and voilà, the Load Balancer quickly became populated with our nodes. To prevent the old K8S from interfering with the new K8S, I first created another LB, changed the annotation on the old service to this new ID, and created a service on the new K8S containing the ID of the old Load Balancer. After that, I went ahead and deleted the old service which also removed the temporary Load Balancer.
Mission accomplished.

> Tl;Dr: You can create a Kubernetes service of type LoadBalancer with an annotation called `kubernetes.digitalocean.com/load-balancer-id`, which will tell the system to use an existing Digital Ocean Load Balancer instead of creating a new one.
Install Laravel on Ubuntu
Published: 2021-01-28 10:27:49

**install php**
```
$sudo apt install zip unzip software-properties-common
$sudo add-apt-repository ppa:ondrej/php
$sudo apt install -y php8.0 php8.0-gd php8.0-mbstring php8.0-xml php-zip
```

**Apache2**
```
$sudo apt install apache2 libapache2-mod-php8.0
```

**MySQL**
```
$sudo apt install mysql-server php8.0-mysql
```
**(optional) Upgrade composer 2.0**
```
$sudo apt install curl
$curl -sS https://getcomposer.org/installer -o composer-setup.php
$sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer
```
**Laravel installer**
```
$composer global require laravel/installer
```

**Edit Laravel path**
```
$cd~
$nano .bashrc
```
*add `export PATH=$PATH:$HOME/.config/composer/vendor/bin` to last line*

```
$source ~/.bashrc
```

**create & run project**
```
$laravel new {project name}
$php artisan serve
```

*open http://127.0.0.1:8000 on browser*

**(optional) VScode**
```
$sudo snap install --classic code
```
How to remove a sensitive file from your commit history on GitHub
Tags: webdev, github, beginners, codenewbie
Published: 2021-01-28 10:19:28

Yes! this has happened to most of us at least once in our career, especially when we are just starting. We accidentally commit sensitive data to GitHub. We forget to gitignore our config file containing database passwords or API keys or jwt secrets. And we immediately start to panic. 

This happened to me a couple of days ago. I  forgot to ignore my default JSON file that contained my database connection password and jwt secret. I had just gotten a feature to finally work and in the excitement, I immediately committed and pushed to GitHub. I only realized my error when I got a notification from GitGuardian that my latest commit contained secret keys. 

If you find yourself in the same position, the first thing you do is **change the visibility of the repo**. So, if it's a public repo, make it private. This way, you're sure no one else sees the file while you're working on deleting it.

Next thing, if you aren't already in the project folder, cd into it on git bash or whatever terminal you are using. Let's assume my project folder is My-Project and I have a file named secretFile.json I want to delete.

```
cd My-Project
```
then run the following command. You have to include the path to the file and not just the file name.

```
git filter-branch --force --index-filter \
  "git rm --cached --ignore-unmatch config/secretFile.json" \
  --prune-empty --tag-name-filter cat -- --all
```
replacing config/secretFile.json with the path to the file you want to be removed. In my case, secretFile.json is inside of a folder named config. 

**Note**: The command above deletes the file from your local repository too, so ensure you have copied the content to a notepad or whatever you use before running the command.

Then create and add your file to .gitignore so you don't accidentally push it to GitHub again. You can do that with 

```
echo "name-of-your-file" >> .gitignore
```
```
git add .gitignore
```
```
git commit -m 'add file to .gitignore'
```
Once you are satisfied with your changes, you can then push them to GitHub

```
git push origin --force --all
```
And that's it! Your repo history is clean without any trace of your sensitive file.

Thanks for reading.
Brother Printer Drivers

Published: 2021-01-28 09:58:03

Brother Printer Drivers are a dedicated piece of software programs that are vital for proper functioning of your avant-garde Printers. This software application equips your Computer with the capacity to command the Printer. It is a user-friendly communication solution between your Computer/ Laptop and Printer. It allows your Computer to efficiently execute the Printer’s functions. In short, this software allows you to experience all the functions and features of your Printer without any hassle.
For more information visit now: https://brotherprinterdrivers.live/
Micro Frontends Patterns#13: Build Time Composition
Tags: microfrontends, microservices, javascript
Published: 2021-01-28 09:50:20

Build Time Composition assembles Fragments at build time, not at client or server.

## Shared libraries

One way to do Build Time Composition is to create shared libraries using npm or similar. In this case, each Micro Frontends will use the shared library. For example, UI components used in the company are provided as component libraries.

We need to consider about how to bundle duplicate code and limit styles' scope. The interface will also need to be carefully designed to maintain consistency across applications.

Also, which team will be in charge of development should be discussed before implementation. For example, there is a distributed development pattern where everyone is a contributor, an OSS pattern where a "platform team" is set up with a main maintainer and reviewer, and a pattern where one team is in charge of all development.

It is important to be careful to make the library meaningful, following "Duplication is far cheaper than the wrong abstraction".

## SSG

This is the way to use SSG technology described in the chapter of JAMstack. For example, the following flow can be considered.

![ikc8elguwbkbkrq0umifs75ez0rv](https://dev-to-uploads.s3.amazonaws.com/i/ltz44inrg36t21foqhkq.png)
 
In this case, APIzed Fragments are converted to static content at build time.

## Bit

Bit is a tool for component-driven development that allows you to easily build, versioning, deploy, etc. from CLI.

For example, you can see which avatar component or nav-item component is being used by which component, so that you can perform appropriate versioning.

![omogfd2trl4mgdfxqjztujudkhg5](https://dev-to-uploads.s3.amazonaws.com/i/55p4uknzhrnypfhyrdnm.png)
 
One of the advantages of using Bit is that it provides a kind of framework for the development flow of Build Time Composition.


## Pros and Cons

### Pros

The advantage of Build Time Composition is that it provides SEO and performance advantages without taking server resources into account. It is only with Build Time Composition that you can enjoy the benefits of Server Side Composition while reducing the various runtime considerations.

### Cons

Build Time Composition does not allow deployments to be loosely coupled. This is a big disadvantage in terms of Micro Frontends. For example, a library that uses Build Time Composition needs to be deployed after the libraries' updates.

Also, depending on the application, it may be necessary to design the interface in such a way that it does not depend on the Framework.

## Summary

With Build Time Composition, we looked at Micro Frontends using the SSG and shared libraries. We would like to consider this as one of the options depending on the use-cases.
My first iOS development experience
Tags: softwaredevelopment, ios, xamarin
Published: 2021-05-19 12:43:26

---
title: My first iOS development experience
published: true
date: 2021-01-28 09:34:43 UTC
tags: softwaredevelopment,iOS,xamarin
canonical_url: 
---

Due to some circumstances, I came in a possession of a Mac mini. This meant only one thing - I had to create an iOS app. My way of thinking was, let’s go completely native - Swift can’t be that hard to learn. Create WatchOS app - I miss a lot of functionality on the Apple Watch. After some attempts and giving up I turned to the good old C# and Xamarin.Forms.

### iOS native development

Yes, my idea was to create a basic app and was thinking just create a native app from the XCode template, and it shouldn’t be too hard to learn Swift and SwiftUI in the process. The thing is, it’s neither so easy and with my spare time very limited these days, I couldn’t afford to go this way. In addition, my Mac mini is quite slow, and made the developemt (attempt) painfully slow.

### Xamarin.Forms

Ok, so I concluded it’s better to go the faster way. Using my primary programming language and my primary development PC should speed things up. For a basic app I wanted to created Xamarin.Forms was a good fit, I didn’t miss any functionality from native development. To be fair, the app I want to create was a port of one of my Windows Phone apps and I could reuse most of the bussiness logic code - speed++.

Using Xamarin.Forms for iOS on a Windows machine works. That’s all :) it works, job can be done but there are a lot of obstacles a native development doesn’t have. Connection to a Mac agent is unstable, often needs a machine restart and just like that you spend 10 minutes and work flow. Deploying to a simulator or a device works good enough, it is a bit slow, but doesn’t get you nervous.

### Outcome

I created a complete app, but didn’t submit it to the store due to it not being production ready, and my wish not to deal with everything that production involves - users, expectations, fixes and maintenance. The app required to have a push notification server, so I reused and expanded my [existing server](http://stipe.xyz/back-to-heroku) used for push notification with APNS support. Of course, since I didn’t work on the server for a few years, Heroku wanted me to [migrate to the new stack](https://devcenter.heroku.com/articles/upgrading-to-the-latest-stack) before I could make new deployments.

Since I’m an iPhone, Apple Watch and iPad user, and I feel the need to be able to make an app for my own needs, now that I can do it the feeling is great. The unexpected work on the server also refreshed my Node.js knowledge and I felt satisfaction upon successful migration of the server.
How to live without Docker for developers - Part 4 |  CI workflow in GitHub Actions with Buildah and Podman
Published: 2021-01-28 09:08:43

As you might already know that Kubernetes is going to drop support for Docker. Starting from version 1.20 that was recently released in December 2020 you will see a deprecation warning for Docker. Docker runtime support will be completely removed from Kubernetes in version 1.22 that will be release in late 2021. After that you will need to switch to one of the other compliant container runtimes, like containerd or CRI-O inside your clusters. Despite both containerd and CRI-O know how to pull docker images and run them and Docker Images Manifest V2 and OCI image specification are almost the same, nobody knows how long Docker images will be supported.

As developers, we need to be prepared to build either docker or OCI images in just a one click and get used to living without Docker.

Therefore I decided to create a series of videos with the common title - How to live without Docker for developers.

The [fourth episode](https://youtu.be/1V33vGXaVQo) (the last one) is already published. In this episode I will show you how you can automate the process to push an image to a container registry and create a Continuous Integration workflow using Buildah, Podman and GitHub Actions. At first, I will push my code to Git repository on GitHub. And then I will create a workflow in GitHub Actions to build my image and push it to GitHub Packages, also known as GitHub Container Registry.

Please check it out and subscribe to my channel to be notified when my new videos will be released.

Thank you in advance.

Link to video: [https://youtu.be/1V33vGXaVQo](https://youtu.be/1V33vGXaVQo)

Link to my personal blog: [https://www.anmalkov.com](https://www.anmalkov.com)

Link to the first episode: [Migration from Docker to Buildah and Podman](https://youtu.be/Fl0iLoAMdzc)
Link to the second episode: [Native approach to build an image with Buildah](https://youtu.be/CLhzNZ9ZavQ)
Link to the third episode: [Push an image to Docker Hub and GitHub Packages using Buildah](https://youtu.be/DxCSsHJlumM)
Chronology tape of the most important national events for the year 2020
Tags: react, opensource, javascript, github
Published: 2021-01-28 08:37:48

Chronology tape of the most important national events for the year 2020
شريط كرونولوجي لاهم الاحداث الوطنية لسنة 2020


https://timeline2020.netlify.app

Repo Github https://github.com/dever404/timeline2020
Learning experience with Crio’s Winter of Doing
Tags: winterofdoing, shareyourlearning
Published: 2021-01-28 08:35:17

CWoD is India's largest tech externship program for developers organized by Crio. It is a one-of-a-kind program focussed on bringing together budding engineering talent to work on challenging projects for the most exciting startups in the country like CRED, Groww, Jumbotail, aws, recko, slice, vicara. 

The program is divided into 3 stages.

In Stage1, everyone who were selected in the program can participate and the stage was for one week. And the topics were HTTP, REST APIs, Linux, Cloud, Git. It was a wonderful journey with practical experience. The bytes provide a better understanding of the Concepts and at last, we also get a flavor of Full stack development Crio Micro experience in which we build our personal portfolio websites.

The best part of crio is #learnbydoing philosophy, where you don’t simply saw video or learning syntax but doing hands-on practice by taking small steps, which most courses lag.

Thank you Crio.do for this amazing opportunity and the externship.
Criando um script de backup
Tags: powershell, tutorial, beginners, cloud
Published: 2021-01-27 13:02:24

Seguindo com a nossa serie, vamos começar a fazer projetos com coisas do dia a dia, iniciando com um script para fazer backups. 

Vamos fazer uma coisa bem básica, pegar uma lista de pasta de um arquivo e salva-las em uma pasta dentro de nosso OneDrive. 
Para ocupar menos espaço, vamos salvar cada uma dessas pastas comprimindo elas. 

**Nosso algoritmo vai ser algo como:**
1. Receber a lista de pastas
2. Criar uma pasta no OneDrive com um nome personalizado
3. Fazer a copia de capa pasta, comprimindo elas no processo

**Qual vai ser a estrutura da pasta no OneDrive?**
1. Vamos criar uma pasta geral chamada Backups 
1. Utilizando data e hora, vamos criar nela uma pasta para salvar o backup atual

Partindo do que já vimos, precisamos para esse projeto aprender duas coisas novas, como pegar informações relacionadas a datas e como comprimir arquivos. 

**Trabalhando com data e hora**
Temos uma função nativa do Powershell para receber essas informações, ela se chama [**Get-Date**](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/get-date?view=powershell-7.1), que nos retorna o dia da semana, do mês, qual o mês e ano, e a hora atual incluindo os segundos (conforme o idioma do sistema operacional). 
Mas para criar uma pasta com esse nome seria bem complicado e não seria o ideal, então vamos utilizar um parâmetro para formatar esse resultado. Utilizando o parâmetro **Format** podemos definir exatamente quais informações queremos, conforme algumas letras chave. 
Para o nosso exemplo, vamos utilizar "hhmmss-ddMMyy", assim vamos gerar um código com a hora, minuto, segundo, dia, mês e ano.

**Comprimindo arquivos**
Para comprimirmos arquivos no formato ZIP, vamos utilizar o comando [**Compress-Archive**](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.archive/compress-archive?view=powershell-7.1), sua sintaxe é bem simples, informamos qual o arquivo e qual o local onde queremos colocar o arquivo após o processo.

Certo, agora como isso ficaria em código?
{% gist https://gist.github.com/IGDEXE/80661b40861c6f3c9ba023765e909bd0 %}

Para deixar nosso código mais bonito, utilizamos uma função nova chamada **Get-ItemProperty**, com ela pegamos o nome da pasta com base nos caminhos informados. Podemos usar isso também para melhorar nossa função de Validar-Pastas, que foi ligeiramente modificada para esse projeto. 

É importante lembrar que precisamos do caminho completo da pasta em nossa lista, exemplo: C:\temp
E colocando sempre um por linha. 

Com isso, conseguimos criar uma rotina simples de backup em conjunto com o OneDrive. Recomendo fortemente que utilize a nuvem para salvar seus arquivos, isso vai te ajudar muito no caso de um problema no computador ou caso precise acessar esses arquivos em outro dispositivo. 

Existem formas muito mais praticas de fazer backups de arquivos pessoais, principalmente das pastas Documentos, Desktop, Imagens..
Mas com a ideia desse script, pode aumentar seu leque de opções.