teleren/devto huggingface dataset:
Daily Challenge #111 - 99 Bottles of Beer
Tags: challenge
Published: 2019-11-08 14:40:30

---
title: Daily Challenge #111 - 99 Bottles of Beer
published: true
series: Daily Challenge
description: Recreate the classic song with a twist!
tags: challenge
---
You all know the lyrics to the song "99 Bottles of Beer on the Wall", right? If not check out this [link](http://99-bottles-of-beer.net/lyrics.html).

Instead of removing just one bottle in each iteration, we want to remove one more bottle than in the previous iteration (i.e. start with 99, then 98, then 96, 93, 89, etc.)

The Challenge: Write a method that takes the initial number of beers on the wall and returns the number of iterations needed to remove all the bottles, in addition to providing the number of bottles removed in the last iteration. (as a tuple or as a string).

Bonus — do the math, not just a simple loop (because that wouldn't be much of a challenge, would it?)

Good luck!
***
_This challenge comes from @peledzohar here on DEV. Want to propose a challenge idea for a future post?  Email **yo+challenge@dev.to** with your suggestions!_
Ruby of Python voor web project? (Dutch)
Tags: ruby, rails, dutch, nederlands
Published: 2019-11-08 15:13:14

Dus moet je gaan met <a href="https://python.org">Python</a> of <a href="https://ruby-lang.org">Ruby</a>?  

Als je alleen werk zoekt, is Ruby (on Rails) een goede keuze. Dit is natuurlijk afhankelijk van waar u zich bevindt.

Beide zijn goede talen en hebben bibliotheken voor het bouwen van web apps. Voor Ruby is dat "Ruby on Rails", ook wel RoR genoemd. Voor Python is er Django en Flask.

Gemiddeld zijn er meer Python johs, maar als je de Ruby-on-rails kant op gaat kun je er zeker van zijn dat het ok is. Voor Python-jobs is het overal te vinden, want het is ook populair voor machine learning, data mining en andere meer wetenschappelijke toepassingen.

<img src="https://thepracticaldev.s3.amazonaws.com/i/pols5ssddxg8l9rcgk5k.png" width="30%">

## Het maken van webapps

Tegenwoordig is Ruby min of meer gestabiliseerd in populariteit. Terwijl Pyton-webontwikkeling een beetje populairder is geworden. 

Voor Python is Django popular, voor Ruby rails. Beide zijn prima.

<img src="https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fqph.fs.quoracdn.net%2Fmain-qimg-3ca1666848392e5dc7701f1a11af7024&f=1&nofb=1">

Dus hoe zit het met Flask?  Naar mijn mening is Flask de meest eenvoudige module van allemaal, omdat het een micro framework is dat eenvoudig is in te stellen en te gebruiken. Maar hoewel het gemakkelijk is, komt het niet met alle functies (standaard) die Rails of Django hebben.

Uiteindelijk hangt het af van wat u wilt doen. Beiden zijn goede hulpmiddelen voor het bouwen van web apps (inclusief SaaS).


**Read more**
* <a href="https://ruby-lang.co">Ruby programming tutorial</a>
* <a href="https://rubyonrails.org/">Ruby on Rails: Web Apps with Ruby</a>
* <a href="https://www.djangoproject.com/">Django Web Framework Project</a>
jsSocial Share Button
Tags: jssocial, sharebutton, sharejs
Published: 2019-11-08 15:10:45

[View jsSocial Full](https://www.adminspress.com/onex/view/tsnXKk)
<section class="jssocial">

<div class="container">

<div class="row text-center">

# Js Social

</div>

<div class="row">

<div class="col-md-12">

## Basic

</div>

<div class="col-md-12">

## Icons Only

</div>

<div class="col-md-12">

## Share Round Icons

</div>

<div class="col-md-12">

## Share Button Label

</div>

<div class="col-md-12">

## Icon With Popup

</div>

<div class="col-md-12">

## Custom Logo

</div>

</div>

</div>

</section>
Python over Ruby for Web Development?
Tags: ruby, rails
Published: 2019-11-08 15:09:29

So should you go with <a href="https://python.org">Python</a> or <a href="https://ruby-lang.org">Ruby</a>?  

If you are looking purely in job terms, Ruby (on Rails) is a good choice. Of course this depends where you are geographically located.

Both are good languages and have frameworks for building web apps. For Ruby that's "Ruby on Rails", also named RoR. For Python there's Django and Flask.

On average there are more Python jobs (in my location), but when you go the Ruby road you can be sure it's rails. For Python jobs it's all over the place as it's also popular for Machine Learning, Data Mining and other more scientific applications.

<img src="https://thepracticaldev.s3.amazonaws.com/i/pols5ssddxg8l9rcgk5k.png" width="30%">

## Making web apps

These days, Ruby is more or less stabilized in terms of popularity. While Pyton web development has become a bit more popular. 

You can Tango with Django or get on the track with rails. Both are fine. 

<img src="https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fqph.fs.quoracdn.net%2Fmain-qimg-3ca1666848392e5dc7701f1a11af7024&f=1&nofb=1">

So what about Flask you ask?  In my opinion Flask is the most easy frameworks of all, because it's a micro framework it's easy to setup and run. But while it's easy, it doesn't come with all of the features (by default) that Rails or Django have.

In the end, it depends on what you want to do. Both are good tools for building web apps (including SaaS)

**Read more**
* <a href="https://ruby-lang.co">Ruby programming tutorial</a>
* <a href="https://rubyonrails.org/">Ruby on Rails: Web Apps with Ruby</a>
* <a href="https://www.djangoproject.com/">Django Web Framework Project</a>
Day 6 of⚡️ #30DaysOfWebPerf ⚡️: Self-hosted fonts
Tags: webperf, fonts, resourcehints, webdev
Published: 2019-11-08 14:56:36

{% twitter 1192817334559354880 %}
{% twitter 1192817342507626496 %}
{% twitter 1192817348547403776 %}
{% twitter 1192817355371491330 %}
Explain the State of WebAssembly to Me
Tags: explainlikeimfive, webassembly, webdev, javascript
Published: 2019-11-08 14:31:53

I'm not looking for an explanation of WebAssembly, but more the WebAssembly ecosystem. What kind of support structure is in place for the technology as of November 2019?

{% link https://dev.to/captainsafia/why-the-heck-is-everyone-talking-about-webassembly-455a %}
Swipe actions in swift
Tags: swipe, uiviewcontroller, uiview, swift
Published: 2020-01-21 21:05:00

---
title: Swipe actions in swift
published: true
date: 2019-11-08 13:24:33 UTC
tags: swipe,uiviewcontroller,uiview,swift
canonical_url: 
---

Hi reader,

This is my first post on Medium, if you have any tips please comment.

### The issue:

Gestures, delegates, it can be a big struggle (especially for beginners).

If you use a lot of gestures then you’ll need to implement it over and over.  
One of the problems is, that code what you write will not apply to other views in your application.  
If we use a lot of swipe actions, in different places within our application we want to have reusable code.  
But then we see ourselfs overloaded with issues, can it be made more easy?

> Yes!

### How can we make it more easy?

Using a UIView extension.

> Why not a UIViewController?

> “Because we also want to support other applications which have a UIView.”

### How do we start?

In this post we’ll start with a UIView extension, to make it reusable for other applications (e.g. UIImageView, UIView, …).

In my case it didn’t work on a UITableViewController.

Psuedo code:

```
import Foundation
import UIKit

extension UIView {
// psuedo code continues
```

We also need a variable, but simply var myVariable = ... does not work, since we are working in an extension.  
There is a workaround, and it may be more easy than you think.  
We’ll use a struct and that will solve all our variable problems.  
We want to reuse the data, so we make a static var.

Psuedo code:

```
// .... psuedo code to above blocks
struct gestureClosures {
 static var up = ...
 static var down = ...
 static var left = ...
 static var right = ...
}
```

We also need to create a function, to make it work!

Psuedo code:

```
func swipeAction(
 swipeDirection: UISwipeGestureRecognizer.Direction,
 completionHandler: @escaping ()-\>()
 ) {
 // Add a swiper
 let swiper = .... #selector(self.invokeTarget(\_:))
 // give the direction as in swipeDirection
 swiper.direction = swipeDirection

// add to the view 
 self.addGestureRecognizer(swiper)

// save the completionHandler
 switch swipeDirection {
 case .up:
 gestureClosures.up = completionHandler
 case .down:
 gestureClosures.down = completionHandler
 case .left:
 gestureClosures.left = completionHandler
 case .right:
 gestureClosures.right = completionHandler 
 default:
 print("Nothing") 
 } 
}
```

But we still need to respond on the swipe actions!

Yup, pseudocode:

```
@objc func invokeTarget(...) {
 // disamble 
 switch swipeDirection {
 case .up:
 gestureClosures.up()
 case .down:
 gestureClosures.down()
 case .left:
 gestureClosures.left()
 case .right:
 gestureClosures.righ() 
 default:
 print("Nothing") 
 }
}
```

And if we translate it to functional swift code.

Then the output looks similair to above.

### The complete solution:

{% gist https://gist.github.com/wdg/20bd16cb5692573e28b870484b0a6860 %}

Thanks for reading, if you like this “story” please share!  
Any ideas, tips, recommendations?  
Please comment!
Side Project Awards
Tags: productivity, java, javascript, python
Published: 2019-11-08 13:48:19


For those of you who know us, Codemotion's Platform team is constantly trying hard to get its head wrapped around the "next big thing for devs". Recently we came up with a tool that might be very interesting to the developers.


We created a developer project curation, feedback and voting platform for developer side projects. We called it Codemotion Agora.



Since the dawn of the bytes, developers just wanted to make life easier for themselves and humanity by creating smart solutions.



Twitter, Twitch, Slack, HubSpot and Github once started as a "side project". But not every developer gets to have their project freely evaluated, curated and possibly funded. That is exactly what we did.



We launched the project at Codemotion Milan on 18th October 2019 and so far we have more than 250 active contributors and 35 projects published.



Our first Project Awards sprint started on the 18th of October and will be closed on the 16th of December 2019. The current prize for the most voted project is €5.000.



You can have a look at the site here: myproject.codemotion.com
What is the "best" merge request flow?
Tags: git, codequality, discuss
Published: 2019-11-08 13:45:52

---
title: What is the "best" merge request flow?
published: true
description: How does your company deal with merge request and the wait for their approval?
tags: git, codequality, discuss
---

We all have been there where we want our merge request to be checked but no one is responding because they are either busy or don't check their messages. What do you do in these situations?

![Time to merge](https://media.giphy.com/media/cFkiFMDg3iFoI/giphy.gif)

Who has the power to approve your teams merge request? Do you check each others code within a team or do you only let the other team check your code to prevent tunnel vision?

Who is the lucky one to pick up? First come first serve, randomly assigned or do you communicate within the team to share the work load?

How do you deal with your project manager looking at you weird once you tell him you had to check 20 merge request all day and that's why you couldn't finish a story?

Can you expect the person who left feedback to check again immediately after you applied the feedback?

## What do you think?

I would love to hear some of your answers to these questions. What kind of processes do you have in place to prevent frustration around merge requests and their approvals?

![Seal of approval](https://media.giphy.com/media/13zeE9qQNC5IKk/giphy.gif)
List common use cases for generator functions in JavaScript
Tags: discuss, javascript, webdev
Published: 2019-11-08 13:37:38

Hey 👋,

Recently, I finally found a use case for generator functions in JavaScript. But, it was quite particular. I wrote a cli that extracts information from GitHub. 

I wanted to split the fetching logic from what I do with it to make it more reusable. Due to rate limit imposed by the GitHub API I had to make multiple calls to get all data I need. Each time, I get a result I want to send it to the caller so It can do something with it. To achieve it I used a pattern called [Inversion of control](https://en.wikipedia.org/wiki/Inversion_of_control). Generator functions fits well with this pattern. You can see my usage of it [here](https://github.com/Zenika/github-insights/blob/master/src/index.js#L38).

I was wondering if it exists more common use cases for generator functions ?
Is Ruby On Rails Still Worth Learning In 2020?
Tags: ruby, rails
Published: 2019-11-08 13:36:39

Ruby on Rails is a web application framework written in Ruby under the MIT license. Rails works on MVC, (Model View Controller) structure, bestowing default structure for a database and web pages. 

The initial release of Ruby on rails was on 13 December 2005 and in its initial years, it greatly affected the web app development through new features that comprise Seamless database table creation, a scaffolding of views to allow the rapid application development.

ROR or Ruby on Rails is older and mature technology to use but in the last couple of years, it has been facing a difficult time as many new technologies came over by taking over this sector. Some people say Rails is dead and it isn’t worth it but here we are going to see why it’s worth learning in 2020.

Where Has ROR Been The Best
Rails have been the talk of the town and it is quite an old language. There are a few reasons that make the Rails best and really tough to compete. So, we would be looking for those reasons.

Simpler business logic Execution
ROR has a simple and fast process of implementation for difficult business logic. For example, you need API for your application at the earliest so you can ask the developer. Rails developers can develop it really fast. You have to put the front- end framework like React and Vue and you are done.

for more details, you can read this article:- https://codersera.com/blog/ruby-on-rails-in-2020/
Deploy a GatsbyJS blog on GitHub Pages
Tags: gatsby, react, github
Published: 2019-11-08 13:24:50

*This article was originally written for [my blog](https://hugogeorget.github.io/blog/first-blog-post-how-to/). This can explain the way this post is written. The technical point still stand on its own though.*

## Introduction

Hi there !

What better way to start my blog than by explaning how it works ?

This blog was built using the [gatsby-starter-blog](https://github.com/gatsbyjs/gatsby-starter-blog) starter.  
[**GatsbyJS**](https://www.gatsbyjs.org/) is a static site generator using the [React](https://reactjs.org/) JavaScript framework. This framework allows us to easily deploy our site to various platforms, such as [Netlify](https://www.netlify.com/) or in our case [**GitHub Pages**](https://pages.github.com/).

The following Github Pages configuration will allow you to deploy your own blog in a path (*username*.github.io/*reponame*).

This setup allows you to deploy your own blog for **free**, how cool is that ?

### Prerequisites

If you want to do the same thing as I did, here is what you need :

- A version of [Node JS](https://nodejs.org/en/)>=8.11.3
- The [Gatsby CLI](https://www.gatsbyjs.org/tutorial/part-zero/#using-the-gatsby-cli). Follow the link for instructions on how to install
- A free [GitHub](https://github.com/) account

## Local installation

Gatsby provides different starters that will help you start developing your site.  
You can even submit your own starters to be featured in the [Starter Library](https://www.gatsbyjs.org/starters/) !

To create a new local repository containing the Gatsby Starter Blog, use the following command :

```shell
gatsby new blog https://github.com/gatsbyjs/gatsby-starter-blog
```

This command will create and put the project files in the `blog` folder, as well as run the `npm install` command.

After that, execute the following commands and start coding !

```shell
cd blog
gatsby develop
```

*If you need more information on Gatsby starters, here is a [link](https://www.gatsbyjs.org/docs/starters/) to the Gatsby documentation on the subject.*  
*This tutorial only covers the deployment of the site.*

## GitHub Pages setup

To deploy your local Gatsby site to GitHub Pages, you will need to add the `gh-pages` package to your project.

```shell
npm i gh-pages --save-dev
```

Additionally, you will need to specify the deployment folder in which your site will be in `gatsby-config.js`.
For our example (*username*.github.io/*reponame*), add a path prefix as follows.

```js
module.exports = {
  pathPrefix: "/reponame",
}
```

Finally, add the following script to your `package.json`.

```json
{
  "scripts": {
    "deploy": "gatsby build --prefix-paths && gh-pages -d public"
  }
}
```

Now you can run the `npm run deploy` command to build your site and deploy the content of the `public` folder to your `gh-pages` branch.

*If this tutorial doesn't suit your GitHub Pages deployment case, more information is available in the [Gatsby documentation](https://www.gatsbyjs.org/docs/how-gatsby-works-with-github-pages/).*

That's it ! Your site should be available to the desired path !
📢 #2 Visual Studio Code Vega Viewer 📈
Tags: showdev, vscode, vega, viewer
Published: 2019-11-08 13:06:05

---
title: 📢 #2 Visual Studio Code Vega Viewer 📈
published: true
description: VSCode extension for Interactive Preview of Vega & Vega-Lite maps 🗺️ & graphs  📈 
tags: #showdev #vscode #vega #viewer
---

[Vega Viewer](https://marketplace.visualstudio.com/items?itemName=RandomFractalsInc.vscode-vega-viewer) provides language support & Interactive Preview of [Vega](https://vega.github.io/vega/) & 
[Vega-Lite](https://vega.github.io/vega-lite/) JSON spec graphs 📈

You can use it in disconnected mode, unlike other online dataViz devTools, to prototype your maps 🗺️ & graphs 📈 on a go, on a ✈️, on a 🚄, on a 🚤, in a 📦 with a 🐐, and no `d3` `py` `plotly` || `rstats` required! :)

![Box Plot](https://github.com/RandomFractals/vscode-vega-viewer/blob/master/images/vega-viewer-boxplot.png?raw=true 
 "Vega Viewer Box Plot Preview")


# 📈 Features

- Create Vega Spec JSON documents
- Vega & Vega-Lite Graphs Preview
- Local & http(s) data files support
- SVG & PNG Graph Export options
- Over 580 built-in Vega & Vega-Lite Examples
- [Vega Themes](https://twitter.com/search?q=%23vegaThemes&src=typed_query) Preview
- Referenced CSV & JSON data display via [Data Preview 🈸](https://marketplace.visualstudio.com/items?itemName=RandomFractalsInc.vscode-data-preview)

# 📈 Settings

Install [Data Preview 🈸](https://marketplace.visualstudio.com/items?itemName=RandomFractalsInc.vscode-data-preview), or change Vega Viewer Data Preview Command Setting to `vscode.open` to open referenced CSV & JSON data files with the default vscode source code editors for those data file types.

![Vega Viewer Data Preview Command Setting](https://github.com/RandomFractals/vscode-vega-viewer/blob/master/images/vega-viewer-data-preview-command-setting.png?raw=true 
 "Vega Viewer Data Preview Command Setting")

# 👀 more info here 😉 ...

{% twitter 1184858728308326407 %}
Key Components of Accessibility
Tags: a11y, beginners, 100daysofa11y
Published: 2019-11-08 12:33:05

---
title: Key Components of Accessibility
published: true
description: Main Components of Web Accessibility
tags: a11y,beginners,100daysofa11y
cover_image: http://images.unsplash.com/photo-1501504905252-473c47e087f8?ixlib=rb-1.2.1&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=1080&fit=max&ixid=eyJhcHBfaWQiOjEyMDd9
series: Web Accessibility
---

#Introduction
Web accessibility is a necessity to ensure functionality can be operated by all individuals. It is for this reason that the W3C Web Accessibility Initiative (WAI) has put together key components in ensuring how these key components can facilitate in improving web accessibility. These components include:-
  
     1. Content
     2. Web browsers
     3. Assistive Technology
     4. Users
     5. Developers
     6. Authoring Tools.
     7. Evaluation Tools

##Content
Content refers to the information in a web page or web application.It also includes aspects of natural information such as text,sound and images. It also entails the markup or code that describes the structure, presentation as well as the interaction.

##User Agents
User Agents refer to the tools, technologies and applications locate,retrieve and display the content of a web page/pages. This includes browsers, browser extensions, plugins text readers and  media players. User Agents ensure web functionalities can be operated by everyone.

##Assistive technology
Assistive Technology entail software and hardware tools that ensure that individuals with disability can access and interact with the web. Examples include Screen readers, alternative keyboards, switches and scanning software.

## Authoring Tools 
These are tools that facilitate in the creation and editing of web content.
Examples include Content management systems such as Wordpress, Joomla, Drupal and Wix; HTML editors such as notepad and visual studio code and finally social media platforms.

##Evaluation Tools
These are tools that assist in determining if web contents meet accessibility guidelines. Some of the tools include HTML and CSS validators. Examples of such tools are detailed here on Web Accessibility Evaluation Tools List [website](https://www.w3.org/WAI/ER/tools/).

##Users
Individuals who use the web have various levels of knowledge, experiences, and skill levels that has a significant impact on accessibility. For instance, a user may or may not know how to access the alternative text from their user agent and/or assistive technology as required.

##Developers
Developers need to understand and implement accessibility. This also includes designers, authors, managers and anyone who is involved with developing content as well as applications, authoring tools, evaluation tools, browsers and other user agents.

Any suggestions? Drop them in the comments section
##HAPPY CODING!!
Building Communities with Questions, Not Answers
Tags: community, communitybuilding
Published: 2019-11-08 12:12:21

---
title: Building Communities with Questions, Not Answers
published: true
description: 
tags: community, community building
---

We live in a world where we expect and demand answers. People come searching for answers and blueprints, but leave disappointed when they don't find exactly what they are looking for. Sometimes they think they've found the perfect answer, only to find out later that it doesn't really solve their problems.

Answers close down discussions. Questions open them up, the possibilities become endless.

Questions is something I've been thinking about a lot recently. I've been practicing asking questions since day one of community building. And it is only now that I realise that asking questions is key to building community.

We ask questions not necessarily to get to an answer, but to open up a new future of new ideas and possibilities.

On a practical day to day basis these days they mostly come in the form of forum discussions and social media posts. Less often it is face to face (irl or virtually).

As a community leader you'll find me asking questions more than giving out advice. I have experience, but I don't have the answers. When you see me or the Indie Hackers social accounts asking questions it's because we want to help you think about the questions you should be asking yourself so that you can discover new things and come to your own conclusions.

Having this focus on 'questions' has given me a new sense of focus. Now whenever I read anything from the IH community, or anything business related I write down ideas for questions.

Originally posted over at Indie Hackers - https://www.indiehackers.com/post/building-communities-with-questions-not-answers-dd36de1735