teleren/devto huggingface dataset:
How to forbid the creation/linking of subtask for a card in YouTrack
Tags: javascript, scrum, agile, kanban
Published: 2020-04-13 08:25:27

If you are using [JetBrains YouTrack](https://www.jetbrains.com/ru-ru/youtrack/) as your Task tracker, you are probably already familiar with Workflows. This is an event-based code snippet that allows you to perform some routine tasks automatically or on schedule. These workflows are written in JavaScript, so most of the team could easily create routines they need.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/u2x7qo74gaqi9dv0u2al.png)
**Problem**: I would like to forbid the situation when someone creates a card with type “User Story” and marks it as “subtask of” another card.


In our case, User Story is a top hierarchy card, so it can't be a subtask of any other card. But sometimes people forget that and link two cards with that type of link instead of __“relates to”__ or __“depends on”__. So, how would you forbid creation or linking as subtask certain card type in Youtrack? Here is the code snippet:
```javascript
var entities = require('@jetbrains/youtrack-scripting-api/entities');
var workflow = require('@jetbrains/youtrack-scripting-api/workflow');
exports.rule = entities.Issue.onChange({
  title: workflow.i18n('Task default description'),
  guard: function(ctx) {
    var issue = ctx.issue;
    return issue.links["subtask of"].added.isNotEmpty() | issue.links["subtask of"].isNotEmpty();
    
  },
  action: function(ctx) {
    var issue = ctx.issue;
    var issue_type = issue.fields["Card Type"].name;
    if (issue_type === "US" | issue.becomes("Card Type", "US")) {  
      workflow.check(!issue.links["subtask of"].added.isNotEmpty() & !issue.links["subtask of"].isNotEmpty(),
"User Story can`t be subtask of any other card, only as standalone card.");
    }
  },
  requirements: {}
});
```

I hope that helps!
**Simon Osipov**
[Web](https://simonosipov.github.io/)
[Twitter](https://twitter.com/OsipovSimon)
[FB](https://www.facebook.com/osipov.simon)
[GitHub](https://github.com/SimonOsipov)
[LinkedIn](https://www.linkedin.com/in/simon-osipov/)
[Telegram](https://t.me/SimonOsipov)
[Data Engineering TG channel RUS](https://t.me/ohmydataengineer)
Where do you host a full-blown docker-compose? Costs and free-tier limitations?
Tags: help, docker, discuss, webdev
Published: 2020-04-13 08:09:43

Also, do you need a credit card?

I want a desktop app to be accessible on mobile, so I made a web app. Actually, this one.

{% github patarapolw/rep2recall no-readme %}

In fear of both security and paid-tier, I want to made it accessible only by me, that is, single user. (It is better, though, if I can monetize the app, but I cannot be sure.)

There are three components, at the very least, in this app. But I really want to reduce the authorization part.

- Server
- MongoDB
- Firebase Auth

Now, I have one new idea. Audio / Video player that I can use files from local; and I can freely edit the metadata, and search through the metadata database.

I would probably need,

- Database, but probably not firebase, with an ODM or ORM.
- Google Cloud Storage, or even MongoDB GridFS
- Hosting

If not for database, I can easily go for firebaseapp...

I don't need a real domain name, even `https://a-Math.random().blahblah.com` might be OK. Actually, I don't even want to bother naming the app.
SailorMoon pose recognition signup/login: part 1
Tags: machinelearning, javascript, webdev
Published: 2020-04-13 07:43:16

### Introduction
I've been working on a small side project called "Sailormoon Pose Signup/Login". It is a signup/login strategy using a machine learning implementation in javascript. Using posenet and ml5.js. The project for now is at [here](https://sailormoonlogin.herokuapp.com/)

![SailorMoon Homepage](https://dev-to-uploads.s3.amazonaws.com/i/8twmnny8y0as9jouh75a.png)

### Phase 1 involves the following steps:
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/gtpu3xzxkz3lthhfqkyq.png)

Took me a day to finish the above + read on posenet and have it running on a local server. My webcam on my laptop isn’t all that great but should suffice for the time being. Below are steps for the project so far:

 1. Use the getUserMedia method  of the web media API to detect a webcam and get permission from the user to stream video from the webcam
 2. Use the setInterval() method to countdown from 3 till 0
 3. On the count of 0 trigger drawing of current video frame on the canvas using context.drawImage()
 4. Do this 3 times as there are 3 separate poses or images of poses
 clearInterval() between each count and disable the start button after the countdown begins, because the setInterval() method messes up the global window object

### Result

![sailormoon gif](https://i.imgur.com/pf8gnAz.gif)

### Check it out 

 The project for now is at [here](https://sailormoonlogin.herokuapp.com/)
String Number Boolean
Tags: javascript, beginners
Published: 2020-04-13 07:42:14

---
title: String Number Boolean
published: true
description: core concept
tags: javascript, beginners
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/0v6rl6n6vejrqyp573py.jpg
---
#String

-String is a plain text in javaScript and you can write it like this:
```const singleQuoteMarks = 'Hi I am a single quote marks string';
   const doubleQuoteMarks = "Hi I am a double quote marks string";
   const templateLiterals = `Hi I am a template literals string`;
  const withApostrophesTemplateLiterals = `I'm a string with apostrophes`
   const withApostrophesSingolOrDoubleQuoteMarks = 'I/'m a string with  apostrophes';```

#Number

-Number in JavaScript can be like a string or normal math number:
```const stringNumber = '1';
   const stringNumberOne = "2";
   const sumStringNumber = stringNumber + streingaNumberOne; // '12' result
   const number = 1;
   const numberOne = 2;
   const sum = number + numberOne // 3 result
   const sumMath = 2 + 2; // 4 result
   const substraction = 10 - 3 // 7 result
   const multiplying = 6 * 6 // 36 result
   const dividing = 36 / 6 // 6 result
   const remainder = 115 % 10 // 5 result```

#Boolean

-Boolean is like a child the world is black or white on or off:
```const married = true; // Is important not use quote marks!!
   const rich = false; // Quote marks trasform boolean into string```
This the code that checks user reg. before download
Published: 2020-04-13 07:26:43


		var formdata ='musicid='+id;
			formdata += '&action=miraculous_music_download';
        $(".ms_ajax_loader").show();
		if(id){
			$.ajax({
				type: 'post',
				url: frontadminajax.ajax_url,
				data: formdata,
				success: function(response){
					var result = JSON.parse(response);
					$(".ms_ajax_loader").hide();
					if( result.status == 'success' && result.mp3_uri != '' ) {
						var link = document.createElement("a");
						    link.download = result.mp3_name;
						    link.href = result.mp3_uri;
						    link.click();
					}else{
						if(result.status == 'true' && result.plan_page != ''){
						    window.location.href = result.plan_page;
						}else{
							toastr.error(result.msg);
						}
					}
				}
			});
		}else{
			toastr.error("Something went wrong on file.");
		}
		

HOW DO I OVERRIDE IT TO ENABLE USERS DOWNLOAD WITHOUT NEEDING TO REGISTER
AM NEW TO PHP HELP!
How to Set Up Comcast Email Using IMAP?
Published: 2020-04-13 07:18:27

Comcast email is one of the professional emailing platforms that come up with numerous exceptional features. Most importantly, setting up your Comcast account using IMAP is wise. However, you can easily enable IMAP for your Comcast email by logging using your Comcast credentials. All you need to apply some changes in the [**Comcast Email Settings**](https://www.emailsupport.us/blog/comcast-email-settings/) so that you can do so easily. Apart from that, you should keep some information in mind before you begin to switch Comcast POP to IMAP.

##Things to keep in mind:

* POP doesn’t connect to the Comcast server.  
* With POP, you can’t sync with multiple devices.
* IMAP connects to the Comcast server.
* With IMAP, you can easily sync with multiple devices.  

##Here’s How?
Go through the steps discussed below:

* On your very first step, you should visit the official sign up page of the Comcast.
* Enter you should enter the login credentials such as email address and password.
* Navigate to the setting option and change the Comcast email to IMAP.   
* Once you are done successfully, you will have to re-add your email to your account to the device you’re using.   

##How to setup Comcast Email on your iPhone?
Setting up the Comcast Email on your iPhone is as easy as a piece of cake. Here are the quick guidelines via which one can easily set up Comcast email set up in IOS. Check out the steps and implement carefully: 
  
* First of all, you should open the ‘Settings’ application on your iPhone.
* Now, you have to select the option that says ‘Mail, Contacts, Calendars’.
* After that, you will have to choose the ‘Add Account’ option.
* Next, you should select the ‘Other’ and then select the ‘Add Mail Account’ option.
* Here, you should enter your Comcast email address along with the password.
* Tapping the ‘Next’ option will be your next step. 
* Congrats! You can now leverage your Comcast Email at its best.
After login to the Comcast, you should check and configure the [**Comcast IMAP Settings**](https://www.emailsupport.us/blog/comcast-email-settings/) so that you can smoothly work on it.
Podcast - Sharing data across multiple SwiftUI views
Tags: podcast, swift, swiftui
Published: 2020-04-13 07:03:43

In episode 21 of the CompileSwift podcast I do my best to explain how I learned to set up a data source in a SwiftUI based application and access that data across multiple views.

It turns out, it's actually kinda cool the way it works with so little code.

https://anchor.fm/compileswift/episodes/Sharing-Data-Across-Multiple-SwiftUI-Views-ecnhb2
Happy Easter from Ruby 2.7.1
Tags: ruby, watercooler
Published: 2020-04-13 07:00:45

---
title: Happy Easter from Ruby 2.7.1
published: true
description: There's an Easter egg in Ruby 2.7.1
tags: ruby, watercooler
---

[Ruby 2.7.1 was released recently](https://www.ruby-lang.org/en/news/2020/03/31/ruby-2-7-1-released/) and while it included a couple of security fixes it also brought with it a little bonus.

[Discovered on Reddit](https://www.reddit.com/r/ruby/comments/fx0efn/easter_egg/), there is an Easter egg that has been hidden in Ruby 2.7.1. You can trigger it a couple of ways. If you don't want to know how, stop reading here!

First, open IRB for Ruby version 2.7.1

```bash
$ ruby -v 
ruby 2.7.1
$ irb
```

Then either enter `RubyVM` and press `TAB` twice or sneakily send the private method `easter_egg` to `IRB`: `IRB.send(:easter_egg)`.

It may not actually be to do with Easter at all, but I couldn't help point it out since it was released so close.

I hope you enjoyed your Easter and had fun with this bit of [developer whimsy](https://dev.to/philnash/developer-whimsy-llamas-in-pajamas-232i) new to the Ruby codebase.
BEST CSS BORDER STYLE
Tags: css, svg, tutorial, beginners
Published: 2020-04-13 06:55:28

---
title: BEST CSS BORDER STYLE
published: true
description: 
tags: #css #svg #tutorial  #beginners
---

<h1>check out More Example</h1> [<h1><b>GSCODE</b></h1>](https://gscode.in/)

<p><b>1. </b>First in series of pens where I just want to make a library of useful tricks I have used for websites. In this one, the key trick is multiline underline with any color I want. This is shown using a random gradient so I could practice some more javascript.</p>

{% codepen https://codepen.io/Wking/pen/BdmpVx %}

<p><b>2. </b>Features:</p>

<p>1) Clip-path for image masking rectangle border (webkit only).</p>

<p>2) Blend-mode for this mask.</p>

<p>3) Smart color system, just put your color name and value into sass map and then add proper class with this color name to elements and everything will work!</p>

<p>4) Cool credits side-menu (click small button in the center of demo).</p>

<p>5) Vanilla js with just &lt; 200 lines of code (basically it's just adds/removes classes).</p>


<p>6) Reusable/configurable. I will add some comments to css/js code if I don't forget about it :D</p>

<p>P.S. - background-attachment: fixed does not working with transforms, so I tried to achieve completly static bg-image during mask movement with translateY, but bg-image was "jumpy", so right now bg-image simply goes up when mask rotates, which is ok for me.</p>

{% codepen https://codepen.io/suez/pen/wMMgXp %}


<p><b>3. </b>Sass button border hover effect mixin</p>


{% codepen https://codepen.io/giana/pen/xdXpJB %}

<p><b>4. </b>single element animation icon~</p>


{% codepen https://codepen.io/Rplus/pen/lEDBj %}


<p><b>4. </b>Animating border-radius</p>

{% codepen https://codepen.io/nickylew/pen/GYMoKM %}


<p><b>5. </b>CSS-only border animation on hover. It needs a solid background in order to work.</p>

{% codepen https://codepen.io/DannyJoris/pen/BrMgza %}
Java Find and Highlight Text in Word Document 
Tags: java, word, office
Published: 2020-04-13 06:29:07

When manipulating Word documents, it's inevitably that we will use the search function if we want to find the specific text quickly. And in order to facilitate ourselves or others to notice it, we can highlight the specific text with background color. In this article,I will introduce how to use [Free Spire.Doc for Java](https://www.e-iceblue.com/Download/doc-for-java-free.html) to realize the function of finding and highlighting text in Word in Java application.

# Installation
First of all, you need to download the latest [Free Spire.Doc for Java](https://www.e-iceblue.com/Download/doc-for-java-free.html) and unzip it. Then you need to add Spire.Doc.jar to your project as dependency.
![add dependency](https://user-images.githubusercontent.com/63445660/79097101-6ebf9280-7d91-11ea-8487-05c6ab6dacb2.png)

 If you use maven, you can refer to this article
[https://www.e-iceblue.com/Tutorials/Licensing/How-to-install-Spire.PDF-for-Java-from-Maven-Repository.html](https://www.e-iceblue.com/Tutorials/Licensing/How-to-install-Spire.PDF-for-Java-from-Maven-Repository.html)


# Find and Highlight Text

We can use the findAllString() method to find all of the matched text in the Word document and then highlight them. Here’s an example of it: 

```java
import com.spire.doc.*;
import com.spire.doc.documents.TextSelection;

import java.awt.*;

public class FindAndHightText {
    public static void main(String[] args){
        //Load Word document
        Document document = new Document("Input.docx");

        //Find all “Nicholas” text
        TextSelection[] textSelections = document.findAllString("Nicholas", false, true);

        //Set highlight color
        for (TextSelection selection : textSelections) {
            selection.getAsOneRange().getCharacterFormat().setHighlightColor(Color.YELLOW);
        }

        //Save the document
        document.saveToFile("FindAndHightText.docx", FileFormat.Docx_2013);
    }
}
```
![find and highlight](https://user-images.githubusercontent.com/63445660/79097221-c100b380-7d91-11ea-99dd-917e893d4e3c.png)
Coronavirus
Tags: react, nextjs, covid
Published: 2020-04-13 06:10:54

Today is the sixth week of lock down in Italy because of covid. We are not allowed to go out without a valid reason (i.e. health, food shopping or necessary onsite work). Let me tell you that it sucks. Unfortunately, the lock down will last at least until the first week of May.

A common problem is food shopping. There is no shortage of food, but staying in a queue in a supermarket is not ideal if you want to avoid contagion. So many people are looking for home delivery services.

Big supermarkets offering this sort of service are stuck. They increased their offer, but, understandably, they cannot do much. Small local shops are working better and many started to offer home delivery.

There are several apps and maps listing shops offering this service. Since I have not found an open source app, I built one. It does not make sense to implement the same thing several times.

It is [a simple React app](https://github.com/mstn/aah) that lists shops and farms offering home delivery service. [Here](https://mstn.github.io/aah/) is a version with some real data released by the province where I live. There are [a few bugs](https://github.com/mstn/aah/issues), but it works decently.

The code is aGPL, so you can take it, change it and use it freely for your country, town or neighborhood. You need just a list of shops in JSON and a `i18n` file for your language. It is 100% static and works also on Github pages.

I wanted to build something that could work also during a zombie apocalypse. Very low tech, no complex infrastructure required, no Internet necessary.

At the beginning, I was going to use GCP for hosting and backend services. Then, I had some problems with my credit card on Google. I called their support, but they are slower than usual because of Covid. At that point, I realized that advanced technologies (GCP is a very interesting piece of machinery!) are fragile. So I refactored the code in such a way that it  could work even offline (thanks to nextjs).

So you may argue that I should not have used React, since React is not exactly low tech. Some static HTML generated by a dump script would have been more resilient. Probably, you are right. There are two reasons why I used React. The first one is that I already had a React app with a GraphQL data layer that I was going to deploy on GCP. The second reason is that, ideally, I would like to build something useful even after the epidemic is over.

We changed our habits and discovered new living styles. This is not necessarily bad. The supermarket model is a social and environmental pest. If we can find alternatives to the supermarket, it would be better for humanity. So maybe there is something we can learn from this experience. How can we continue to buy local and build social bonds with our neighbors even after the crisis is over? 

I do not have answers, but let me know what you think in comments!
Why One needs to have Professional SEO Services?
Tags: seocompanyinnoida, digitalmarketingcompanyinnoida
Published: 2020-04-13 05:42:38

Online presence of the website is important as it will position your website amongst the top rankings of the major SERPs. If your website is positioned at the top rankings of the major search engine like Google, Yahoo, etc, then it will have a maximum number of visitors. In other words, a well-optimized website is the need of the hour in the cut-throat competition.

Here comes the need of the services of the leading <b><a href="https://www.ogeninfo.com/seo-services-company-noida.html">SEO Company in Noida</a></b>, to get good and strong online presence and to rope in umpteen numbers of target customers to the website. Before making up your mind for SEO services, one needs to understand what professional SEO services developed by leading SEO experts do for your online business?

• Majority of the web traffic is from search engines. Web visitors type the search keywords in the search engines and click the sites which search engines present in front of them. But if they do not find your website in the first few searches, they will never be able to trace you and will not know who you are.

• There are umpteen numbers of websites on the internet acumen. The market is competitive and everyone is here with something different. Search engines also love to recommend the best quality sites which could help the visitors to make good decisions. Well formulated SEO practices make the site optimized for search engines, which will ensure their position amongst the top rankings.

• Professional SEO experts of the leading <b><a href="https://www.ogeninfo.com/digital-marketing">Digital Marketing Company in Noida</a></b> help the client get insightful thoughts. The experts showcase the details of activities initiated by the incoming traffic to the website and this will help the client understand what the target audience actually expects. The client gets to know their preference, likes, and expectations, which will help in improving the site in a thoughtful way.

• Good SEO marketing strategy is cost-effective when compared with other means of advertising and it takes less time and less money to deliver quality results.

• A professional SEO firms track down the moves and nerves of the competition accurately. SEO experts pinpoint the real story of the success of your competitors. They can track the right keyword, targeted audience, and practices followed by your competitors. With these findings, you can get a fair picture of competition, market and future plan of action clearly.

<b>It is advisable to hire the SEO firm that:</b>

• It is experienced enough to track down the right set of keywords that matter the most.
• Can easily track down the accurate set of keywords, that matters the most
• SEO Company that is using legal and ethical practices to rank the website.
• Ropes in revenue-generating traffic to your website.

A good SEO firm not only elevates the online presence of the website but also ensures that your site is accessible to the majority of the target audiences easily.
An if else alternative
Tags: javascript, todayilearned
Published: 2020-04-13 05:00:31

## Introduction
This post is about suggesting an alternative to the traditional if else statement.

Consider this if else block
```javascript
let block= 'j',
    name= '';
if ( block === 'j' )
    name = 'JavaScript';
else if ( block === 'k' )
    name = 'KnockoutJS';
else
    name = 'Guest';

```
Now, the alternative would be this
```javascript
let block = 'j';
let name = ({
 j: 'JavaScript',
 k: 'KnockoutJS',
})[block] || 'Guest'
console.log(name);

//Output:
JavaScript
```
It delivers the same functionality. We are fetching a value from an object literal based on it's key.

We will break it down for understanding.
Consider,
```javascript
let setValue = 'second';
let points = {
 first: 1,
 second: 2
};

let plot = points[setValue] || 3;
```
We use this in day to day coding so we can easily relate to the alternative.

The property values can be function too.
```javascript
let test = 'b';
let fn = ({
a: () => { console.log('first')},
b: () => { console.log('second')}
})[test] || (() => {console.log('outside defined values')})

fn();
//output:
second
```
Since the properties are functions , you need call the properties as function.

We can also include this in an IIFE.
```javascript
let test = 'x';
( ( {
    a: () => {
        console.log( 'function a' );
    },
    b: () => {
        console.log( 'function b' );
    },
} )[ test] || ( () => { console.log( 'default function' ); } ) )();

//Output:
default function
```
Thanks for reading this post.
Cheers !!!
View, a solution to slow complex queries?
Tags: sql, mongodb, discuss
Published: 2020-04-13 04:16:21

I have heard about this before in SQL, but never tried it.

Now I have a complex aggregate in MongoDB, and I stored it in a server-side function (not inside the database), and it is ridiculously slow (takes 4-8 sec / query).

So, I have found [MongoDB views](https://docs.mongodb.com/manual/core/views/) and [$merge](https://docs.mongodb.com/manual/reference/operator/aggregation/merge/), and I hope it make things faster. But,

- It takes space, actually, double the space it used to take...
- Has to update the view "every time" I make C-UD.
  - It is only easy? before I have ODM (mongoose)'s hook. Not a native database's.

I wonder if it is the same in SQL, esp SQLite?