teleren/devto huggingface dataset:
Free cloud hosting services available to developers and open source projects
Published: 2020-08-09 12:50:19

fosshost.org is a recognized and not-for-profit provider of free to use and accessible cloud-hosting services to the free and open source software community.

For more info visit https://fosshost.org

We exist through the kind philanthropy of the hosting industry. The project and infrastructure is managed and coordinated by our founding owner, and a group of highly talented volunteers.

These reciprocated values of sharing resources with open source projects help to support, promote and advance the learning and knowledge of free software within our ecosystem.

We provide virtual private servers, dedicated servers, storage, domain registration and operate a shared mirror service to a diverse range of open source projects including ActivityPub (W3), Manjaro, XFCE, Xubuntu, The GNOME Project and Xiph.Org Foundation.

All of our infrastructure and networking is kindly donated and provided to the project for free. We could simply not operate without these contributions to the project and fosshost.org is extremely grateful for the kind generosity of our supporters.

We believe in providing maximum transparency with our services and we are very proud to list those who have helped fosshost.org

RapidSwitch.com, iomart Group PLC
DediServ.eu, Dediserv Dedicated Servers Sp. z o.o.
Jolt.co.uk, Host Lincoln Ltd
FDCservers.net, FDC Servers.net, LLC
HostKey.com, HOSTKEY B.V. of Amsterdam

https://fosshost.org/donate/
Dart & Flutter Easy Wins 1-7
Tags: flutter, dart
Published: 2020-08-09 11:50:26

---
title: Dart & Flutter Easy Wins 1-7
description: Easy ways to improve your Dart & Flutter code. Published weekly.
published: true
tags: flutter, dart
canonical_url: https://codewithandrea.com/tips/dart-flutter-easy-wins-1-7/
series: Dart & Flutter Easy Wins
---

I recently started a series of [daily tweets](https://twitter.com/search?q=from%3Abiz84%20Easy%20Win&src=typed_query&f=live) about easy ways to improve your Dart & Flutter code. I called this **Easy Wins**. 

To make these easier to find, I'll be sharing 7 tips every week here.

Without further ado, here are the first 7 tips.

## 1. Prefer const over final over var

![Prefer const over final over var](https://codewithandrea.com/tips/2020-08-09-dart-flutter-easy-wins-1-7/images/001.const-final-var.png)

## 2. Use type annotations for safer code


![Use type annotations for safer code](https://codewithandrea.com/tips/2020-08-09-dart-flutter-easy-wins-1-7/images/002.type-annotation.png)

## 3. Use underscores for unused function arguments

![Use underscores for unused function arguments](https://codewithandrea.com/tips/2020-08-09-dart-flutter-easy-wins-1-7/images/003.underscores_unused_arguments.png)

## 4. Functions are first class citizens in Dart, and they can be passed directly as arguments

![Functions are first class citizens in Dart, and they can be passed directly as arguments.](https://codewithandrea.com/tips/2020-08-09-dart-flutter-easy-wins-1-7/images/004.function-arguments.png)

## 5. You can use collection-if and spreads with lists, sets AND maps

![You can use collection-if and spreads with lists, sets AND maps](https://codewithandrea.com/tips/2020-08-09-dart-flutter-easy-wins-1-7/images/005.collection-if-spreads-maps.png)

## 6. Use the cascade operator to modify mutable variables

![Use the cascade operator to modify mutable variables](https://codewithandrea.com/tips/2020-08-09-dart-flutter-easy-wins-1-7/images/006.cascade-operator.png)

## 7. You can catch and handle exceptions by type with multiple `on` clauses

![You can catch and handle exceptions by type with multiple `on` clauses.](https://codewithandrea.com/tips/2020-08-09-dart-flutter-easy-wins-1-7/images/007.catch-exception-by-type.png)

More tips coming next week. [Subscribe via RSS](https://codewithandrea.com/rss.xml) for updates!

Happy coding!
Why we need to represent a state transfer
Tags: rest, webdev, http
Published: 2020-08-09 12:41:53

REST(Representational State Transfer) has pretty much become the norm now. But, as with anything else, it's crucial to understand its motivation. Why did we come up with REST? What was the situation before REST? 

Well, picture this - This is the 90s. You've built software that interacts with the oracle database. All's well. You have the desktop application installed on all the computers of your company. It comes bundled with oracle client libraries and everything's running smoothly. 

Now, oracle releases a new version of their database that include some critical security bug fixes. You have no choice but to upgrade. You update your code to use the newer version of oracle. Maybe that merely involves a version change, or maybe there are some backward incompatible changes which force you to rewrite few lines of code. You take the database down, upgrade it, and then push out your software update. Now, you need to make sure that all the computers use the latest version of your software, otherwise they won't work (since you have upgraded the database). You make sure you install patches on all the machines, and only then, you can go back to sleep, hoping that you didn't break anything. It's ok, don't worry. I'm sure you've followed test driven development practices strictly.

Well, if you look at this situation closely, you'll realise that there is a tight coupling between the client application and the server. The client is very aware of the version of the database used by the server. This is a clear breach of [separation of concerns](https://en.wikipedia.org/wiki/Separation_of_concerns). So, what do we need? Hmm, it would be nice if client could just express what it needs via some standard protocol and get the information back in some particular format, without having to worry about how the server retrieved that information. 

Well, that's what REST is. It's the transferring of "representations" of resources. As opposed to directly dealing with the resource, you deal with "representations" of it. You use a "representation of a resource" to transfer resource state which lives on the server into application state on the client. You make a GET HTTP request with an `id` (the representation of the resource that you want), and retrieve the complete state of the resource that the server is aware of.

Such a separation of concerns is what made it possible to achieve high scale. For example, it doesn't matter if you're building an application for a mobile, a desktop or a tablet, you can use the same representations to send and receive data. 

Sources
- [Hussein Nasser's video](https://www.youtube.com/watch?v=1o7bB4hUPew&list=PLQnljOFTspQU6zO0drAYHFtkkyfNJw1IO&index=18)
- [Stack Overflow <3](https://stackoverflow.com/a/10421579)
Using Netlify to host a static website
Published: 2020-08-09 12:37:51

When you created a static website, whether it's a project with client or just for portfolio, you usually want to make it online. One of modern hosting especially for a static website is Netlify. Netlify is nice to hosting from a very simple web, or generated website using [Gatsby](https://www.gatsbyjs.org/) or [Gridsome](https://gridsome.org/), and it's free to get started. There are very simple steps to host your website to Netlify.

![Netlify Logo](https://dev-to-uploads.s3.amazonaws.com/i/u3bl2qcsf6nce26njkg3.jpg)

#### 1. Sign Up
You can sign up with your GitHub, GitLab, or Bitbucket account to easily connect your repository later.

![Signing Up](https://dev-to-uploads.s3.amazonaws.com/i/2x22bl1el32pmo1z4npy.jpg)

#### 2. Select Git provider
After you sign up, you can start to deploy your website. First select the git provider where you put your website project. Select one and authorized Netlify to access your repository list. I personally use GitLab.

![Select Git Provider](https://dev-to-uploads.s3.amazonaws.com/i/1g5py6b5g83fwp45gdqa.jpg)

#### 3. Select Repository
Now after you authorized Netlify to your git provider, all your repository will showed up. Select which repository that you want to deploy.

![Select Repository](https://dev-to-uploads.s3.amazonaws.com/i/619v3g1802ue3o4y9rgi.jpg)

#### 4. Setting the build option
You can choose which branch that will deployed to the hosting, so it's not always have to master branch.

![Build Options](https://dev-to-uploads.s3.amazonaws.com/i/nf5jq0orvwhcv5t6v0i1.jpg)

If you deploying a generated site with such as Gridsome, you need to add *gridsome build* in **Build Command**, and *dist* in **Publish directory** to automatically start building the website right after you push to the branch that you choose to deploy before.

![Additional settings](https://dev-to-uploads.s3.amazonaws.com/i/ztdhll574y4qvsoqdem7.jpg)

And that's it! Now your website is published and can access via internet with yourwebiste.netlify.app domain. You can use your custom domain by setting the DNS configuration. Read the [official documentation](https://docs.netlify.com/domains-https/custom-domains/) to know more how to do that. From now, when ever you want to make a change to your website, just push your change to the branch that you choose and Netlify will build the change for you. Thank you for reading :)
Make up for Rails console
Tags: rails, awesomeprint, ruby
Published: 2020-08-09 12:36:52

Peeps!!!! i felt that i should have done this earlier... Being a ROR dev i really feel uncomfortable to examine this default rails console. A linter or formatter for this problem might be a solution. Now comes the magic..scroll bottom !!!!
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/05ey19iut5irvgc24kz6.png)
                            **##### BOOOM #####**
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/7pxamxikqpqi6e7pgovj.png)

Just follow these 3 steps and make the magic happen!!!

* Just add awesome_print gem in development group in `Gemfile` which is located in root path of your application.
``` 
group :development do
   gem 'awesome_print'
end
```
* Add this code block in by doing `vim ~/.pryrc`
```
require "awesome_print"
AwesomePrint.pry!
```
and save it by `:wq!`
* This file is called when our rails console starts. so no need of running `source ~./pryrc`

Here you go.. just play around rails console now . PEACE
For more details you can refer documentation `https://github.com/awesome-print/awesome_print`
Melhores bibliotecas p/ construir console apps com .NET CORE
Tags: dotnet, dotnetcore
Published: 2020-08-09 12:30:06

### Updates:
10 de Outubro de 2020 - Typin adicionado.  

# [Gui.cs](https://github.com/migueldeicaza/gui.cs)
GUI.CS é uma biblioteca idealizada por Miguel de Icaza (#MONO, #GNOME, #XAMARIN, #MICROSOFT). 
Acelera o desenvolvimento de console apps em .NET, .NET Core, e Mono, rodando em Windows, Mac, e Linux/Unix.

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

###Controles visuais:
Button
CheckBox
ComboBox
Dialog
OpenDialog
SaveDialog
FrameView
Hex viewer/editor
Label
ListView
Menu
MessageBox
ProgressBar
Radio buttons
Time & Date Fields
TextField
Text Editor
ScrollView
ScrollBarView
StatusBar
Window

Github: https://github.com/migueldeicaza/gui.cs


# [Spectre Console](https://github.com/spectresystems/spectre.console)

Facilita estilização de texto, e acesso a uma paleta de cores padronizada.

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

# [Typin](https://github.com/adambajguz/Typin)

Declarative framework for interactive CLI applications. 

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/4ar064xa9y804maxfs1x.png)
Internal Implementations of List.extend() and List.append() operations in Python
Tags: python, algorithms
Published: 2020-08-09 12:28:26

Let’s take a deep dive into the internal implementation of **List.extend()** & **List.append()** operations:

Suppose the list **nums[]** contains 7 integer elements, and we're about to execute lines as below:

**Sample 1**
```
result=[]
    for i in range(n):
        result.append(nums[0])
        result.append(nums[1])
return result
```
**Sample 2**
```
result=[]
    for i in range(n):
        result.extend([nums[0],nums[1]])
return result
```
## Analysis of Internal Implementation
### Sample 1
* When we execute **result.append(nums[0]),result.append(nums[1])**, the internal implementation will be like as below:
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/0nhnqa08b4k1up5nxum6.png)

1. List **result** get reference to num[0]which actually pointed to the integer instance 'int1'
2. Then list **result** get reference to num[1]which actually pointed to the integer instance 'int2'

### Sample 2
* When we execute **result.extend([nums[0],nums[1]])**, the internal implementation will be like as below:
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/0tims2z0wb5vfiv6hywv.png)

1. Contents inside the parentheses of **.extend()** function can be treated as a **temp list** which actually pointed to the same integer objects as list **nums**
2. Then, the list **result** receive those references to those integers through that **temp list**


This post is also a complement to my previous post:
https://dev.to/effylh/leetcode-1470-shuffle-the-array-3ok5
100 Paying Customers
Published: 2020-08-09 12:21:23

Proxies API was the most unlikely project that I ever thought would bring me success. The secret this time was doing a product that I know everything about. I have been web scraping pretty much ever since I started programming so this is my love. In fact I had paid for a competing service before and I felt I could do a better job if I had the time someday. Today I have 100 paying customers. I can hardly believe it. Some of them came from my little posts and updates here and I am very grateful. Thank you dev.to.
Proxies API does what it says in the name. It is a rotating proxy api for web scrapers. We pass web page fetch requests through a network of over 2 million high speed, residential proxies and render pages, solve CAPTCHAs, handle sessions, cookies and other issues so you never get blocked.
Finally Came Up With A Name And Logo
Published: 2020-08-09 12:17:16

Earler I had called it SiteABlaze and even made a weird looking (in hindsight) logo for it. I woke up sweating in the middle of the night yesterday and changed it. This name just came to me, EdgeNet. EdgeNet.app was available and a couple of hours later I had the logo as well. EdgeNet is going to be a SAAS service that converts your website into a static one and deploys it on a world wide CDN automatically. It also detects content changes and automatically syncs it.
Daily Developer Jokes - Sunday, Aug 9, 2020
Tags: jokes, dailydeveloperjokes
Published: 2020-08-09 12:00:28

---
title: "Daily Developer Jokes - Sunday, Aug 9, 2020"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
cover_image: "https://private.xtrp.io/projects/DailyDeveloperJokes/thumbnail_generator/?date=Sunday%2C%20Aug%209%2C%202020"
published: true
tags: #jokes, #dailydeveloperjokes
---

Generated by Daily Developer Jokes, a project by [Fred Adams](https://xtrp.io/) ([@xtrp](https://dev.to/xtrp) on DEV)

___Read about Daily Developer Jokes on [this blog post](https://xtrp.io/blog/2020/01/12/daily-jokes-bot-release/), and check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/).___
### Today's Joke is...
![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e1258bb6df5f.png)

---
*Have a joke idea for a future post? Email ___[xtrp@xtrp.io](mailto:xtrp@xtrp.io)___ with your suggestions!*

*This joke comes from [Dad-Jokes GitHub Repo by Wes Bos](https://github.com/wesbos/dad-jokes) (thank you!), whose owner has given me permission to use this joke with credit.*

<!-- 
Joke text:
___Q:___ What did the spider do on the computer?

___A:___ Made a website!
 -->
Technical Debt as a Tool
Tags: devops, productivity, startup, codequality
Published: 2020-08-09 11:57:37

It's pretty hard to get away from the term technical debt these days; the bane of development projects, to be avoided at all costs. I prefer to think of it a little differently - as a tool. 

Businesses use financial debt as a tool - why not technical debt? Financial debt works best when it bridges a short-term gap, when it helps a business achieve an outsized return that far exceeds the cost of borrowing.

We can use technical debt in the same way; a quick hack here, a bit of tight coupling there - it may offend the "purist" in your team, but it could be the difference between getting a revenue generating service online (and paying down that technical debt), or never actually getting to market.

Just make sure you don't miss your repayments.
Mute Spotify Ads On Mac
Tags: bash, sideprojects, showdev
Published: 2020-08-09 11:50:14

I use Spotify on my computer from time to time but I hate when the Ads start playing.

The first solution I was using was blocking Spotify Ads DNS's, but that stopped working after a while.

I don't mind having a **break** between a few songs, but I don't wanna hear the Ads, so I decided to create a small script to hack it.

The script does the following:

1. Using OSX log system I can listen to Spotify events.
2. Read the events and check if an Ad is about to be played.
3. If the event is an Ad about to be played **automatically mute system audio**.
4. If the next event is a song, **unmute system audio**.

# How to install it

1. Open a new terminal (use Spotlight search and type **terminal.app**)
2. Inside the new window paste this command and then hit enter 
  
    ```
    mkdir -p ~/MuteSpotifyAds && curl https://raw.githubusercontent.com/gdi3d/mute-spotify-ads-mac-osx/master/NoAdsSpotify.sh > ~/MuteSpotifyAds/NoAdsSpotify.sh
    ```

3. This will create a new folder inside your Home folder called `MuteSpotifyAds` and will place a new file called `NoAdsSpotify.sh`
4. To run the program just copy and paste the code below in the terminal and hit enter 
    
    ```
    sh ~/MuteSpotifyAds/NoAdsSpotify.sh
    ```

5. To exit the program just **close the terminal app or press Ctrl+c**

# Website

[https://gdi3d.github.io/mute-spotify-ads-mac-osx/](https://gdi3d.github.io/mute-spotify-ads-mac-osx/)

Here's the repo if you want to know more:

[https://github.com/gdi3d/mute-spotify-ads-mac-osx](https://github.com/gdi3d/mute-spotify-ads-mac-osx)


*Photo Credits: (https://www.pexels.com/@burst)[https://www.pexels.com/@burst]*
TL;DR:  DNS Cache Poisioning;
Tags: security, computerscience, beginners
Published: 2020-08-09 11:48:21


- Impersonating an Authoritative nameserver and forging a reply to the DNS server requesting for information, 

- Reply gets cached (meaning DNS server ends up caching wrong information)

- e.g DNS server ask for IP address of a Domain name Attackers forges a reply with the wrong IP and wrong IP gets cached


### Extras:

#### a) What is a DNS Server :
DNS translates domain names to IP addresses so browsers can load Internet resources. the DNS Server handles this task of finding the right IP address for the domain name entered

#### b) What is a Nameserver:
They hold information about domain names and their associated ip addresses
How to add text to an HTML element with JS
Tags: javascript, tutorial
Published: 2020-08-09 11:42:19

In this example, we will change the text in the 'th' element
```html
...
<th id="dt_emissao"></th>
...
```
```javascript
var dt_emissao = document.getElementById("dt_emissao");
dt_emissao.textContent = "Example";
```
How to add a global SCSS file to your Gridsome project
Tags: vue, gridsome, javascript
Published: 2020-08-09 11:40:02

I love Gridsome for it's easy setup, themes and over all developer experience. One thing I decided to do as soon as I set up my project was to add a global SCSS/SASS file for my global styles. This was I did not have to write global styles on my components which is not optimal if you want to keep a good separation of concerns. Here's how to do it:

# Tell gridsome to load your scss in `gridsome.config.js`

Go to your `gridsome.config.js` file and write this:

```
module.exports = {
  ...
  css: {
    loaderOptions: {
      scss: {
        prependData: '@import "./src/assets/style/index.scss";'
      }
    }
  }

}
```

In case you are using sass instead of scss remember to change "scss" to "sass" below loaderOptions.

Restart your server and that's it, you will be able to write use your scss variables in your components.

Have a good day ✌✌

## Find me on [Twitter](https://twitter.com/jordienr)
Map API🌎
Tags: github
Published: 2020-08-09 11:36:47

<p>Using an already existing API to our advantage is far better and easier than creating one from scratch.</p>

<p>I have used this on my website and it is super easy and free.</p> 

---

## How to get Google Map API🌎

1. Go to the [Google Cloud Platform](https://console.cloud.google.com/google/maps-apis/new?project=portfolio-283012&folder=&organizationId=) Console.

2. Click the project drop-down and select or create the project for which you want to add an API key.

3. Click the menu button and select APIs & Services > Credentials.

4. On the Credentials page, click Create credentials > API key.

5. The API key created dialog displays your newly created API key.

6. Click Close.

7. The new API key is listed on the Credentials page under API keys. (Remember to [restrict the API](https://developers.google.com/maps/documentation/javascript/get-api-key#restrict_key) key before using it in production.)

---

### Add the API key to your request😉

<p>You must include an API key with every Maps JavaScript API request. In the following example, replace YOUR_API_KEY with your API key.</p>

```html
<script async defer src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap" type="text/javascript"></script>
```

---

## Steps in Detail

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

2. Press the 'Get Started' button. In the window that opens, tick both 'Maps' and 'Places'. Press Continue. At this stage, you will be asked to create a Google account or log in to your existing one. ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/o2xhojhme5ohddu3ahxz.jpg)

3. In the updated window, choose 'Select a project' and enter the project name (e.g. Set Compass) in the box below. Then click Next.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/hlp201kzxb7re69ebtgx.jpg)

4. In the updated window, click Create Billing Account

5. After clicking Next in Step 2, will be offered to enable your APIs. Press Next.

6. You will see a new window with your API key in the box. Save the key to be able to use it and press Done. ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/hw2h9ewelc66bnq2i1ps.jpg)

7.(Optional) To protect your API Key and prevent anyone else from using it, click on credentials in the left pane then click on the project name as shown below. ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/6iwper3hyay0784uhj5g.jpg)

8.(Optional) From Application restrictions select HTTP referrers (Web sites), enter https://setcompass.com/* in the Accept requests from these HTTP referrers (Web sites). Then click Save. ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/zsbl34ogrk9bi4wip6ia.jpg)

9.Finally go to the registration page at setcompass.com, fill in all the fields and paste your copied Google Maps API Key as shown below. ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/a339qnla9yk9bw57zcgz.jpg)

---

## Reference📚

[Google API](https://developers.google.com/maps/documentation/javascript/get-api-key)