teleren/devto huggingface dataset:
How to make, build or solve problem X with Y?
Tags: hacktoberfest, easypr, github, softwaredevelopment
Published: 2018-10-05 17:53:05

---
title: How to make, build or solve problem X with Y?
published: true
description: How to tackle a problem/s X very easily with a solution Y (library, framework or codesnippet)?
tags: #hacktoberfest #easypr #github #software-development
---

Hello everyone! Hope all of you are doing good.

I am Omkar from India and I have been programming (professionally) for about a year now. I think I can say I have a little experience than a neophyte developer.

One of the problems I see myself and most like me struggling with is, __*how to solve a particular problem without reinventing the wheel*__. While reinventing the wheel should not be a problem for a beginner because that is how we will learn the crux or important parts of it, but the method that we used before sticks with us for long.

*Instead if we could just know about the things that are out there with which we can do it easily (after taking the hard route once or twice), wouldn't that be great!*

You would argue that we can easily do a google search. Yes we can, but a lot of times its **difficult to search something because we don't really know what we want and if a tool or a library for it already exists.**

[**XbyY**](https://github.com/manjrekarom/XbyY) will be collection of such and other recurring issues that can be easily solved with libraries and frameworks already out there (solution need not necessarily be a library or a framework).

Check out the repository {% github manjrekarom/XbyY %}

Contributing is easy. We just have to create a markdown file with necessary details like the problem X, our solution/s (Y) and any tutorial links for this. Read more about it [here](https://github.com/manjrekarom/XbyY/blob/master/README.md). 

This can also serve as an **easy/medium pull request** for those willing to do the **Hacktoberfest Challenge**. 

Let's build a database of problems that we face generally, frustrate ourselves with :P and later have found a much better and easier way to solve it.

*Thanks for reading!*
How do you do random?
Tags: showdev, fun, webdev, discuss
Published: 2018-10-05 16:07:44

---
title: How do you do random?
published: true
description: How would you generate an random 0 to 10 integer in your favorit language?
tags: showdev, fun, webdev, discuss
cover_image: https://adventuresinspace.com/wp/wp-content/uploads/2010/08/152.jpg
---

I was watching a VueJS tutorial and was surprised at what it takes in ECMAscript to generate a random integer between 0 and 10.


```javascript
Math.floor(Math.random() * 10);
```

In PHP it takes
```php
mt_rand(0, 10);
```

In your favorite language what does it take to generate an integer between 0 and 10?
How To Add Awesome Monokai Colors For Beautiful C# Development in Visual Studio 2017
Tags: visualstudio, howto, syntaxhighlighting
Published: 2018-10-05 14:24:50

---
title: How To Add Awesome Monokai Colors For Beautiful C# Development in Visual Studio 2017
published: true
description: You’ve finally come to the right place! It IS Possible!
tags: visual studio, how to, syntax highlighting
---

Over the past few days I've been getting into ASP.NET and C# development, and getting used to using Microsoft Visual Studio 2017. 

I struggled with incorporating Monokai syntax highlighting for C# (I think I don't know how to program without it) ;)

When I finally figured it out, I wrote up a detailed how-to on Medium.

Original link from Medium is here: https://medium.com/@frewin.christopher/how-to-add-awesome-monokai-colors-for-beautiful-c-development-in-visual-studio-2017-a403a2200c25

(***I don't know if linking like this is frowned upon; I can copy the text from the article to this post if required!)
How Do You Decide on Colors in Design?
Tags: discuss
Published: 2018-10-05 15:41:38

---
title: How Do You Decide on Colors in Design?
published: true
description: 
tags: discussion 
---

This is a general discussion thread and I would love to hear what designers think about color in design.

A few questions that I personally have to start the discussion are:

- What methods do you use to find your color palette?
- How do you know it's the right palette?
- How do you determine which elements get what color?
- Do you recommend any resources for this topic?
Hi, i'm Tetri Mesquita 🤓
Tags: introductions
Published: 2018-10-05 14:44:15

---
title: Hi, i'm Tetri Mesquita 🤓 
published: true
description: my simple introduction
tags: #introductions
---

👨‍💻 I have been coding for almost 15 years.

🌐 You can find me on Github and Twitter as @tetri

🏡 I live in Cascavel (Paraná, Brasil).

💼 I work at [Datacoper Software Ltda.](http://datacoper.com.br/?ref=dev.to) as System Analyst.

🚀 I mostly program in C# and Java.

🐍 I am currently learning more about Python for personal purpose.

🤝 Nice to meet you.
My domain name and website content has been hijacked! What should I do?
Tags: help
Published: 2018-10-05 14:26:54

---
title: My domain name and website content has been hijacked! What should I do?
published: true
description: 
tags: help
---

I've been away from working in the I.T industry for quite a while now due to a personal illness. During this time my personal domain name expired and I didn't consider renewing it. I'm now slowly recovering from my illness and getting back into working with computers and was even considering getting my website back online but today I noticed my domain name and website content has been STOLEN!

My original website was running on Wordpress with a sleek custom theme but it seems the content was scraped and cloned. This isn't a direct clone as it seems whoever did this has dumbed down the content and now has backlinks to their website within my original blog posts. E.g 'C++ Mobile Development - Snapchat' links from:

http://joel-murphy.com/mobile-app-development.html to -> https://intetics.com/portfolio/technologies/c

I did a whois lookup on my old domain and it seems whoever did this bought the domain and hosts the content on Amazon s3 servers. 

I have a strong feeling this was https://intetics.com/ just for the SEO benefits but I'm unsure why they'd target me? I owned my domain name http://joel-murphy.com/ for many years and I had links to it from my CV/Resume, Business cards, LinkedIn, etc. My website did have some traffic but not enough to justify being targeted. I guess there's not much I can do other than use a different domain name in the future but I'm more concerned about the potential of my online identity being mocked or played with. Anyone been in a similar situation to this before?
Using a Bitbucket private repository in your projects
Tags: bitbucket, git, packagist, developers
Published: 2018-10-05 09:53:51

---
title: Using a Bitbucket private repository in your projects
published: true
description: Using a Bitbucket private repository in your projects
tags: bitbucket, git, packagist, developers
---


Many times you may like to use your personal private library in another project.
For example, you may have many private projects that share a common library that can't be open source for your business.
You can use **Packagist** and pay to have a private repository or you can use Bitbucket with its FREE private repositories.

To include your private **Bitbucket repository** via **Composer** you need to add this lines into your composer.json:

```
"repositories":[
     {
         "type": "vcs",
         "url" : "git@bitbucket.org:yourName/yourRepository.git"
     }
 ]
```

**VCS** stands for version control system. This includes versioning systems like git, svn, fossil or hg. 
Composer has a repository type for installing packages from these systems.

If you launch ```composer install``` now, you have to put a Consumer key into your CLI (command line interface).

This isn't a problem but if you have **continuous integration**, or your deploy system launches composer install the command, you must have an automatic system able to insert the consumer key or some magic script to manage it.

So, to avoid this problem you need to open your main repository, from Bitbucket for example, create an ssh key and copy the **public key**.

![Generate SSH Key](https://alessandrominoccheri.github.io/img/generate-ssh-key.jpg)

After that you need to open your private library from Bitbucket, add an access ssh key and paste the public key created previously.

![Add SSH Key](https://alessandrominoccheri.github.io/img/add-ssh-key.jpg)

Now if you launch ```composer install``` any request comes up into your CLI and you can have a perfect automatic deployment.
Deploying Cogear.JS-generated site to the Now.sh
Tags: node, cogearjs, bash, devops
Published: 2018-10-05 10:45:29

---
title: Deploying Cogear.JS-generated site to the Now.sh
published: true
description: Tutorial about how to deploy Cogear.JS-generated site to the Now.sh service.
tags: Node, Cogear.JS, bash, devops
cover_image: https://thepracticaldev.s3.amazonaws.com/i/231kh6x7j1udh5p8bvw6.jpg
---
[Cogear.JS](https://cogearjs.org) is an open-sourcered static websites generator built with [Node.JS](https://nodejs.org) and based on the latest [Webpack](https://webpack.js.org).

**Dev.to** members previously may read [the introduction article](https://dev.to/codemotion/cogearjs--modern-static-websites-generator-450a) and the tutorial about [how to create a blog](https://dev.to/cogear/creating-a-blog-with-cogearjs-21af) in a minutes with **Cogear.JS**.

Now it's time to talk about deploy.

When a site is designed in `development` mode and built-in `production` or `build` mode, it's time to deploy it to the remote server.

Basically **Cogear.JS** can upload it via **FTP** or **SFTP** protocols and even use [rsync](https://rsync.samba.org) (if installed).

Deploy methods speed comparsion:

&nbsp;&nbsp;&nbsp;&nbsp;Method&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Speed&nbsp;&nbsp;&nbsp;&nbsp;
:----:|:----:
FTP|slowest
SFTP|fast
rsync|fastest

You can read more about standard deploy ops in the docs:
https://cogearjs.org/docs/deploy

But now it's all about [Now.sh](https://now.sh) which provides free hosting for static sites.

# Getting Started

You need to [download](https://zeit.co/download) and install desktop **Now.sh app**. It will provide command line utility called `now`.

When it has been installed deploy procedure becomes incredibly easy.

Just compile your site (build it):
``` bash
$ cd ~/Sites/site

$ cogear build
```

It will be compiled to the `output` folder which is `./public` by default.

![](https://thepracticaldev.s3.amazonaws.com/i/jktv0tu9imsd48rllb5r.png)

Now you are ready to deploy.

``` bash
$ now --public public
```

You send the command to **Now** to upload the folder `./public`  in `--public` mode (it's required for non-paid accounts).

Within a few seconds, your site is online!

![](https://thepracticaldev.s3.amazonaws.com/i/1b7kou3t2xp7f9o6u6lx.png)

Site address has been copied to the clipboard.

You may choose an appropriate domain with `now alias` command.

``` bash
$ now alias https://public-psuaoefsus.now.sh cogear.now.sh
```

Done!

You can even use custom domain via DNS management. 

Like I do:
``` bash
$ now alias https://public-psuaoefsus.now.sh cogearjs.org
```

[Read more](https://zeit.co/dns#get-started)

[Cogear.JS official site](https://cogearjs.org) is hosted at [Now.sh](https://now.sh) absolutely for free.
How to use Siri Shortcuts in your app
Tags: ios, swift, ios12, sirishortcut
Published: 2018-10-05 09:58:28

---
title: How to use Siri Shortcuts in your app
published: true
description: 
tags: iOS, swift, iOS12, Siri Shortcut
---

# Introduction

Siri shortcut is one of the biggest update in iOS 12.
If you said to Siri about your task, Siri responds with your apps installed.
SiriKit is published in iOS 12, which make developers enable to adapt Siri to their apps.

Recently, my app had adaptive SiriKit. I introduce my code.

For using Siri Shortcut, We have tw ways. NSUserActivity, or Intents. 
Today I introduce NSUserActivity because it is very simple.

# How to use Siri Shortcuts

## 1. Regist Siri Shortcut

My code:

```
import UIKit
import Intents  // 1. import Intents framework

class CheckinViewController: UIViewController {

   override func viewDidAppear(_ animated: Bool) {
        super.viewDidAppear(animated)
        
        // 2. register Siri shortcut action when user did some of action
        userActivity = NSUserActivity.checkinActivity
    }
}


extension NSUserActivity {
    
    public static let checkinType = "com.example.checkin"
    
    public static var checkinActivity: NSUserActivity {
        let userActivity = NSUserActivity(activityType: checkinType)
        
        userActivity.isEligibleForSearch = true

        // 3. set `isEligibleForPrediction` true
        //    you should set recommend phrase to `suggestedInvocationPhrase`
        if #available(iOS 12.0, *) {
            userActivity.isEligibleForPrediction = true
            userActivity.suggestedInvocationPhrase = "Check in"
        }
        userActivity.title = "Check in to the nearest station"
        
        return userActivity
    }
}
```

This code is mostly same to Apple sample code.
When user action something, you register it to iOS with NSUserActivity.


## 2. Use NSUserActivity

Once registering Siri, user can set up at Settings app > Siri shortcuts section.

Handling user action by Siri, you implemented delegate method.

```swift
func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([Any]?) -> Void) -> Bool {
        
        if userActivity.activityType == NSUserActivity.checkinType {
            // Handle Siri Action Here
            return true
        }
        
        return false
    }
```

And write definition in your info.plist.

```
<key>NSUserActivityTypes</key>
<array>
	<string>com.example.checkin</string>
</array>
```


# Recap

In this article, I wrote how to use Siri Shortcut in your app with my actual code.
The way of using NSUserActivity is very simple and easy.

Hope this article helps anyone!

———
Looking for advice
Tags: beginners, javascript, typescript, learning
Published: 2018-10-05 06:30:21

---
title: Looking for advice
published: true
description: Looking for help to find some learning resources
tags: beginner, javascript, typescript, learning
---
Hi there everyone, first post from me here.

Its the third time I try to write this post, which is kind of funny.
I'm always getting lost in describing my situation. Let see if I can come to my point faster this time.

...
meh. I cant. Stupid head.

Let see. About me: I'm making (more trying than actual make) games now for a few years in combination with the unity engine and c#. All just for fun of course. A good friend helped me to get into that programming thingy and I learned a lot. But the human beeing that I am, I want to learn some more stuff. Looking into other languages just out of curiosity and that sort of things.

All that adventures into python, javascript/typescript and a few others were more a fail than a success. I told myself that the problem is me - which kind of is still correct I guess.
My mindset is stuck to the structure how games/apps in unity work. 

At the moment I'm trying to create my own extension for vscode or I would try the Electron thing, because I'm not sure if my idea is fitting into vscode like it is right now - because I have no clue how those programs work at all.

Of course I tried a few javascript tutorials - but they are all website-specific things. Or the examples I would create I have some buttons on a html site at the end. Problem here is: I have null interest in making a website / social media thing / or any other kind of web-app. So I'm not really freeheaded to get through those tutorials. They teach me "stuff I dont want to learn - I absolutly dont care". Question here would be: for what kind of programs, apps and web-stuff is JS made for? (a ton of different things I heard, right?)

To come to an end (I wanted to make it short...): Is there any other way to learn JS (or TS, I guess I would prefer this because of my C# knowledge) more in a normal-app way than with the website approach? It would fit my brain better than all those website stuff.
Even in combination with a library (or whatever it is called) like angular, electron or whatever it would be fine (I hope). What the most of them are lacking are talking about the JS-relativly-basics. You always jump into the library stuff instantly because "JS is so easy you already know it right?" thinking of the creator. I assume there are tutorials (in text or video format) I'm looking for, but I didnt find them 'til now. 
So I would appreciate your help with it.

Thanks everyone for reading and sorry for my terrible english :I
Common Mistakes in a Coding Interview
Tags: techinterviews
Published: 2018-10-05 04:55:16

---
title: Common Mistakes in a Coding Interview
published: true
description: summarizes the points from the tech lead video
tags: techinterviews
---

I’ve been following the Tech Lead and love some of his raw advice on tech careers. He sometimes talks lots of sarcasm and I like it. It is about being human. This sketch is a summary of what he shared on his recent video on common mistakes in tech interviews. 

![](https://thepracticaldev.s3.amazonaws.com/i/91a8721dbhxtvmpwg2y8.jpeg)

I think it’s pretty standard and generally good advice. Coding on the spot is something that always intimidates me due to lack of practice but I’m glad most folks out there share the same feeling. 

I generally feel more comfortable with companies that ask questions based on your work experiences like my current company. For college or university interviews, we generally ask more algorithms and data structure questions. It’s reasonable because they might lack the work experience. But what do you think? Is it better to do one approach over the other? Which one do you prefer?

In terms of the topic, what other mistakes have you seen in coding interviews? 

YouTube video by the Tech Lead
{% youtube pV7XIZnsbgM %}
Woocommerce Hooks
Tags: woocommercehooks
Published: 2018-10-05 03:28:58

---
title: Woocommerce Hooks
published: True
description: Woocommerce Hooks
tags: Woocommerce Hooks
---

Hello to dev, here are Woo-commerce hooks and hope it will help you.
I am just sharing this because of knowledge sharing purpose.

[woocommerce-hooks](https://therichpost.com/category/woocommerce-hooks)
[woocommerce](https://therichpost.com/category/woocommerce)


Thank you
Therichpost
1MB - Free Website Hosting
Tags: showdev, free
Published: 2018-10-05 02:52:18

---
title: 1MB - Free Website Hosting
published: true
description: Free hosting for your next idea as long as it’s not over 1MB.
tags: showdev, free
---

Today I’d like to introduce you all to a project of mine. It’s called 1MB (one megabyte). It’s a platform for creating what I like to call “micro sites”. What is a micro site?

- A micro site’s source code cannot exceed 1MB in size.

- A micro site is powered by only one HTML file (unless you’re using third party stylesheets and scripts).

You even get your very own subdomain to share your code. Mine is https://dalton.1mb.site :)

There is also an open API for editing your site just in case you wanna use your own code editor or automate something.

You can try out 1MB at https://1MB.SITE
If I knew then what I know now
Tags: beginners, dev, discuss, career
Published: 2018-10-05 02:24:15

---
title: If I knew then what I know now
published: true
description: If can go back in time, this is what I will tell to my younger (dev) self
tags: beginners, dev, discussion, career
cover_image: https://thepracticaldev.s3.amazonaws.com/i/stlp5von2zdmdst59xgs.jpg
---

Yesterday, there's a discussion (here at dev.to) on "What is your best advise to a junior software developer".

{% link https://dev.to/sergiotapia/what-is-your-best-advice-for-a-junior-software-developer-32gn %}

I responded with 15-item, somewhat, tounge-in-cheek, list. Apparently, some people liked it. So, here it is now in post form, shareable and all.

{% devcomment 612i %}

Don't forget to visit the original post by Sergio Tapia, there are other comments in there; it's still going, I think.
How to write tests for an android app?
Tags: kotlin, java, android, discuss
Published: 2018-10-05 01:36:54


---
title: How to write tests for an android app?
published: true
description: 
tags: kotlin, java, android, discuss
cover_image: https://thepracticaldev.s3.amazonaws.com/i/rfmvtwpzvgzkjl5alphk.png
---

I have an app that I built recently [the repo](https://github.com/sduduzog/slim-launcher). Its even live on the play store but I'm worried that there's not even a single test written for it. Even unit tests will bring peace to my heart and the problem is...ever since I've started android development, I've never had to write tests, web dev included.

In my defence: I'm self taught, I have about 4 years of experience in both web and android development and with most resources I use, its about solving a problem, and rerunning a piece of code always made me feel like I'm testing it already and I pass.

This is a very bad habit apparently and it makes me doubt myself as a developer. I'd really appreciate a heads up of any sort, whether a reply here, link to resources or a pull request as a jump start. Thank you
Beginner's Guide to JavaScript Inheritance and Prototype
Tags: javascript, webdev, beginners
Published: 2018-10-05 01:32:21

---
title: Beginner's Guide to JavaScript Inheritance and Prototype
published: true
description: Beginner's guide to JavaScript Inheritance and Prototype
tags: javascript, webdev, beginners
---

Wow, this is one of the best explanations on JavaScript inheritance and prototypes I've seen. It also covers JavaScript Classes. Big ups to @tylermcginnis and his great content!

https://tylermcginnis.com/beginners-guide-to-javascript-prototype/
Dev.To Review #2: Top 7 Of The Week, Discussed
Tags: discuss, audio, top, popular
Published: 2018-10-05 00:58:19

---
title: Dev.To Review #2: Top 7 Of The Week, Discussed
published: true
description: User milkstarz and I discuss the top posts of the week
tags: discuss, audio, top, popular
canonical_url: https://soundcloud.com/malikanddan/dev-to-review-episode-2
series: DEV.TO Review
---

[Malik](https://dev.to/milkstarz) and [I](https://dev.to/dangolant) got together again to chat about the top 7 articles on dev.to for the week of 10/01/2018. Also available on Soundcloud:

 {% soundcloud https://soundcloud.com/malikanddan/dev-to-review-episode-2 %}

If you want to read and hear more posts like this, follow us here on dev.to, or on Twitter at [@dangolant](https://www.twitter.com/dangolant) and [@milkstarz](https://www.twitter.com/milkstarz).

# The top 7 discussed this week were: 

{% link https://dev.to/theoutlander/how-can-you-swap-two-variables-without-using-a-third-2f30 %}

{% link https://dev.to/jorge_rockr/my-development-environment-setup-part-1-4a33 %}

{% link https://dev.to/joelnet/why-async-code-is-so-damn-confusing-and-a-how-to-make-it-easy-3441 %}

{% link https://dev.to/lethargilistic/you-deserve-to-be-a-software-developer-14l8 %}

{% link https://dev.to/aspittel/intro-to-generative-art-2hi7 %}

{% link https://dev.to/jhotterbeekx/my-solution-is-the-best-1pjk %}

{% link https://dev.to/bgadrian/16-free-toolsservices-that-any-developer-should-use-4e7e %}
Which cache engine to choose between redis or memcached and varnish.
Tags: help
Published: 2018-10-05 00:37:03

---
title: Which cache engine to choose between redis or memcached and varnish.
published: true
tags: help
---

Hi mates, my team and i are building a web platform (Social network and Ecommerce), and we are are planning to receive a lot of traffic and i want to know which caching system will be the best between varnish, redis and memcached ? Varnish act like a load balancer (from what i read) is it a good idea to use it ?