teleren/devto huggingface dataset:
You have been accepted into the Udacity Technology Scholarship powered by Bertelsmann!🎁🎁
Tags: career
Published: 2019-11-16 11:24:15

I just recieved an e-mail from udacity about my admision for the  Bertelsmann Scholarship telling me that i have been accepted into the Udacity Technology Scholarship,

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/tre4a3rwsia8rw5j36ce.jpg)


I choosed the data track hoping it will be a good experience to add to my carreer after a one year gap.also I liked to share with you guys this good news so it will be my first post on Dev.to :satisfied:

Class begins Nov‍emb‍er 2‍0th, 2‍01‍9,This is where the learning begins! we will spend 3.5 months learning key components for Cloud Computing, Data Analysis (my track), or Artificial Intelligence. Top students from this initial phase will earn a full Nanodegree program scholarship. 




#50000chances #UdacityTechScholars #PoweredByBertelsmann.
Can we change the status code of a HTTP request?
Tags: ios, android, sslproxying, debuggingtools
Published: 2019-11-16 10:25:30

---
title: Can we change the status code of a HTTP request?
published: true
description: 
tags: #ios #android #sslproxying #debuggingtools
---

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/ansf6j1g9eiy3z2rpfpd.png)

Apart from using Breakpoint to edit content of requests/responses on the fly, this mini blog demonstrates how developers can use [Proxyman](https://proxyman.io/) Breakpoint to change the status code to test different cases of HTTP responses such as client error or server error.

---

### Enable Breakpoint
After you have downloaded Proxyman and enable SSL Proxying for our testing domains, those requests/responses would be captured. Moreover, we can even use Breakpoint tool to manipulate those API calls as our testing purposes.

![Enable SSL Proxying for testing domains](https://thepracticaldev.s3.amazonaws.com/i/n89bbc9e790yxkezvqbx.png)

To enable this tool → **Right Click** the URL → select **Tools** → select **Breakpoint**

![Right click URL → Select Tools → Select Breakpoint](https://thepracticaldev.s3.amazonaws.com/i/h9jnn33cp0myvyuda7vq.png)

### Add Matching Rule
Then a **Breakpoint Rule Window** will pop-up so that we can define all matching conditions there. As [Proxyman](https://proxyman.io/) auto-use the selected endpoint as the condition, you would see the endpoint https://api.producthunt.com/v1… is auto-filled. Here we want to change the status code only so let’s uncheck the Request box

![Uncheck Request box for modifying Response only](https://thepracticaldev.s3.amazonaws.com/i/8m87z6wsq8hsgo0s9cs2.png)

After hitting **Done**, we can see that new rule has been added up to the Breakpoint rules window

![New Matching Rules is added after hitting Done button](https://thepracticaldev.s3.amazonaws.com/i/780mwjdmtm30j7ymd0q5.png)

With that all set up, it’s time to modify the status code to see how our app behaves

### Change Status code
As soon as we re-send the request, that API call would be captured and a Breakpoints window would pop-up so that we can edit our queries on the fly.

![Go to tab Other → change the status code as we want](https://thepracticaldev.s3.amazonaws.com/i/pdq9mu5hquczuy6p246c.png)

The status code is separated into tab Other so you can go there and change as you want. As you can see, after changing the status code into **400** and hit **Execute**, the response is now updated with signal **Error 400** in the main window

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/hbif3ce68ujzq79iriy2.png)

### What’s next?
That’s how easy to use **Breakpoint** to modify status codes for testing purposes. We can also use this tool to [manipulate the content of requests/ responses](https://proxyman.io/blog/2019/09/Use-Breakpoint-to-intercept-and-edit-request-response-on-iOS-app.html). Hope that you would find it helpful to boost productivity :)

---

Proxyman is a high-performance macOS app, which enables developers to view HTTP/HTTPS requests from apps and domains on iOS device, iOS Simulator and Android devices. Get it at https://proxyman.io
Chrome Extension that stops your Social Media addiction
Tags: productivity, google, chrome, javascript
Published: 2019-11-16 10:07:17

---
title: Chrome Extension that stops your Social Media addiction
published: true
description: Google Chrome Extension
tags:
- productivity
- google
- chrome
- javascript
---

# Problem

How many times today did you type:

\- **f** (as faceboook)
\- **t** (as twitter)
\- **i** (as instagram)
\- **y** (as youtube)
\- **r** (as reddit)

or other?

How many times today did you open a new tab, and subconsciously, without much thinking, you are on Facebook? Again.

Things that are easy to access, are hard to avoid. And, I have been in this trap too. Here is a solution I have been working on.


# Help

I have created a **Google Chrome Extension** with a simple purpose.

\- It prevents you from visiting social media. (you can also customize the list of sites)

\- It handles your temptation of visiting social media. (or other sites you specify)

\- It makes you more productive!


# Where to get it

https://chrome.google.com/webstore/detail/stop-social-media/jdeohkoemlaidjgdhlcchdmgdghihjag


# Final thoughts

Any feedback and any thoughts on this topic very appreciated!
Thank you!
Ajax get data using search bar under option list
Tags: query
Published: 2019-11-16 09:25:49

Anyone help me???
i just need a search bar under option list that search data from list.... 

  var map = null;
                $(document).ready(function() {
                    var allCitiesList = $.ajax({
                        type: "GET",
                        url: `http:/Leop/api/Compaign/GetDestCalCity`,
                        data: "",
                        async: false
                    }).responseText;
                    var searchbar = `<input type="text" placeholder="search city" />`;
                    var cityLocationsObj = JSON.parse(allCitiesList);
                    var cityLocationsListing = `<option>Please Select City</option>`;
                    cityLocationsObj.map(x => {
                        //debugger;
                        cityLocationsListing += `<option value="${x.City_ID}">${x.City_NAME} </option>`;
                    });
                    //debugger;
                    $('#citiesList').html(cityLocationsListing);
                });
How be less stressed? 
Tags: relax, tips, productive
Published: 2019-11-16 09:11:24

---
title: How be less stressed? 
published: true
description: 
cover_image : https://thepracticaldev.s3.amazonaws.com/i/877op9wyhllkv51bxz8i.gif
tags: #relax #tips #productive
---
I decided create this post, because i see much people talk about be more "productive", setting absurd habits and goals. However, stay relaxed is very important for a good life and be more productive.

That is why, decided search about methods and habits that could help people become less stressed.

### Meditation
Yes, meditation for many  may seem bullshit, but it is not. Neither is necessary learn with an expert or spend a lot of your time. Just take a moment to do "nothing", just close your eyes and clear your thoughts. A thing that help me to clear my mind is imagine that I'm lying in  a totally white room where no have sound and other things, just me and a white room.

I normally do meditation when I wake up and when I will sleep. But feel free for make it or other meditation in any moment of your day.

Exists a lot of app that can help you with meditation, I use the [Meditopia](https://meditopia.com), it have several features like breath exercises, music for relax and guided meditation.

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/baqj5kqxgrbzv6honjbv.png)

### Breath 
Is a of my favorite methods for relax, because help to calm my mind and can take a several benefits for the health, like blood pressure balance and increased lung capacity.

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/3bn7dt38xb6gblba2rq7.gif)

among the various breathing techniques, these are my favorite : 

**``Shavasana``** : basically consists in lying down, leaving an arm extended and the other under the chest. The secret is to inflate the diaphragm like a bladder and slowly let go.

**``Bramari``** : sit on a chair with an upright posture and move mouth muscles trying to reproduce sound of a bee.

**``i like join meditation with breath exercises, because the breath help me have more focus.``**

### Music

Music, from the Greek, "the art of the muses". For me, one of the most beautiful arts. Each has a musical style, but it is know that **``Music Classic``** and **``Instrumenal``** help in concentration and stimulates the cognitive development. Other musical style that help in keep focus is **``LoFi``**, music genre that has a slower beat and the sound more grave.

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/7i53l0egiixfcf8nasn9.png)

That is why I decided make two playlists that could help people to be less stressed.

**``LoFi``** : [Low Wifi](https://open.spotify.com/playlist/5ytt07FGD03TQBRGJxAOFr?si=xzT3VL6gSK2bZ60X8rwIYQ)

**``Classic Music``** : [NoStressYesClassic](https://open.spotify.com/playlist/5q8R6Mc6iEmynhn5D0LArh?si=loH8pFYuRjmwW1xknglXYg)

### Conclusion :smile: :smiley: :satisfied:
It was a pleasure to me write about the habits and methods that I use for keep me less stressed. Feel free for share your tips with others. Thanks for all! :metal: :metal: :metal:
C# sorting - a subtle mistake
Tags: csharp
Published: 2019-11-16 08:52:16

Recently I've noticed a funny (ehm...) thing.

## The guilty

_It isn't true that the inverse of a negative number is always a positive number_. Or, equally, that ` (x < 0) -> (-x > 0)`.

You could say "Hey, -(-5) == 5". Yes, that's true. 
We can test it this way:

```csharp
[Test]
public void TestInverse()
{
    int x = -5;
    int y = -x;
    Assert.IsTrue(y > 0);
}
```

But what if we consider __edge cases__? 

```csharp
[Test]
public void TestInverse_EdgeCase()
{
    int x = int.MinValue;
    int y = -x;
    Assert.IsTrue(y > 0);
}
```

It will fail. Miserably.

## The reason

The reason is simple: __the sign occupies space__.
In fact, the range of int is _-2,147,483,648_ to _2,147,483,647_. The inverse of _-2,147,483,648_ would cause overflow, and returns the same value.

## The lesson

Why am I pointing at this? 

Imagine you are implementing a `CompareTo(x, y)` method, you know, the usual one that returns `0` if the values are considered equal, -1 if x < y and 1 if x > y.

You could use this method to sort an array.
Now you want to sort that array descending. What to do?

This edge case explains why it is a terrible idea to use `CompareTo(-x, -y)`. Results can be unexpected.

The best solution is to simply switch the parameters: `CompareTo(y, x)`.
Amazon Suspension Appeal service
Tags: amazonsuspensionappeal, amazonappealservice
Published: 2019-11-16 08:14:30

If you are looking for Amazon Suspension Appeal service, call us immediately on our toll-free number. We are available 24/7 to help our customers without delay. We have seen that many vendors have no idea of ​​the source of help that can get them out of trouble. But our team is entrusted all the time to manage any kind of concern without any delay. For more info...
https://www.proappealservice.com/amazon-appeal-service/
Convert mp4 to gif
Tags: mp4, gif, imagemagick, ffmpeg
Published: 2019-11-15 20:29:45

We, dev people, have the need to post evidence of different behaviors of our desktop in many places (issues, documentation, blogs, etc.).

In this post, We'll learn how to convert an mp4 file to gif in two simple steps.

### Requirements

- [ImageMagick][]
- [FFmpeg][]

### Instructions
First, we need to extract the frames from our video. FFmpeg can do it with the next command:

```shell
ffmpeg -i video.mp4 -vf fps=5 frames/%03d.png
```

The fps option defines the playback speed of the gif, I suggest between 5 and 6 to get closer to speed of the original video.

Then we "glue" the frames to make the gif.


```shell
convert frames/* output.gif
```

With this, we have ready our gif, but maybe it's too big, so we can do the next step. Gif optimization.

```shell
convert output.gif -fuzz 1% -layers Optimize optimized.gif
```

### Extra

1. For the naming part: `%03d.png` we need to multiply fps times seconds in the video, so, if our video lasts up to 166 seconds (2 minutes and 46 seconds) and we are using 6 fps, we can use `%03d.png`, but if the video is longer, it could be necessary change the names to `%04d.png`, in order to have the frames sorted.

2. The fuzz percentage partly determines the optimized gif quality, that's why we use only 1%, you will notice that increasing that percentage will reduce the final quality.

[ImageMagick]: https://imagemagick.org
[FFmpeg]: https://ffmpeg.org
OBS Live Stream -> Instagram Live Stream Project
Tags: electron, typescript, node
Published: 2019-11-16 06:39:57

---
title: OBS Live Stream -> Instagram Live Stream Project
published: true
description: Are you interested in doing a TypeScript/Node possibly even an Electron project with me?
tags: Electron, TypeScript, Node,Open-Source
---

The project is OBS live stream -> Instagram Live Stream, there's a PHP repository here: https://github.com/JRoy/InstagramLive-PHP which relies on this Instagram-API: https://github.com/mgp25/Instagram-API/. I thought it would be neat if I can do something similar but instead of PHP use TypeScript/Node or even Electron (I've never done Electron before).

Would anyone be interested in doing this project with me? The inspiration for this project is: I think it would be cool to be able to live stream your coding on Instagram live.
function Undefined in go
Tags: help, go
Published: 2019-11-16 06:31:07

Can any one help me why is the below code giving undefined:register error
I am trying to understand the call by reference and call by value. 

package main

import (
	"fmt"
)

type MyStruct struct {
	name string
	id   int64
}

var (
	s MyStruct
	u int
)

func (u MyStruct) register()  {
	fmt.Println(u.name, u.id)
	fmt.Println(u.name, u.id)
	fmt.Println(u)
	s.name = "vij"
	fmt.Println(u)

}

func main() {

	s := MyStruct{"deb", 11273090}
	r := register()
	fmt.Print("Inside Main****")
	fmt.Print(s)

}

./prog.go:29:7: undefined: register
What are the good practices to Node.js web app authentication and authorization?
Tags: node, react, graphql, discuss
Published: 2019-11-16 04:55:23

Hey everyone!

I'm doing a small project to learn myself a new technologies and I started to implementing the app auth stuff and I wonder if you can share the best practices for that.

To narrow down what I'm doing is the simple web app with Node.js + GraphQL with Apollo Client + Mongo as database + React as a client. Also, I'm thinking about JWT tokens and email + password for Sign_up and Sign_in.

What I'm looking is how better to store the tokens, in browser in database? When to check them? What process of generating token and expiration practices? etc.

Would love to hear anything you have!
マルチカーソルは Vim をもっと便利にできるのか？
Published: 2019-11-16 04:06:24

Vim / neovim で マルチカーソル という機能を利用してみました。 この記事では、Vim や neovim でマルチカーソルを導入する方法と使い方、その所感についてご紹介します。 Vimでマルチカーソルを利用し

つづきは[こちら](https://vim.blue/vim-multicursor/)。
[https://vim.blue/vim-multicursor/](https://vim.blue/vim-multicursor/)
Vim + VPS + SSH = モバイル最強のエディタ
Published: 2019-11-16 04:06:08

自宅のデスクトップパソコン、職場ではノートパソコン、モバイルでは iPad Pro、電車内では iPhone で緊急作業、と非常に様々な場所・多彩なデバイスを利用しています。 そうなると、全てのデバイスでまったく同じよう

つづきは[こちら](https://vim.blue/vim-vps-ssh/)。
[https://vim.blue/vim-vps-ssh/](https://vim.blue/vim-vps-ssh/)
Performance Testing using Lighthouse CI Action
Tags: google, performancetesting, lighthouse, chrome
Published: 2019-11-18 20:00:38

---
title: Performance Testing using Lighthouse CI Action
published: true
date: 2019-11-16 03:53:16 UTC
tags: Google,Performance Testing,Lighthouse,Chrome
canonical_url: 
---

Performance matters. Client-side, middleware, database, server-side whatever hop you are talking about, performance matters. Google Chrome’s Audit (Lighthouse in Chrome DevTools) helps you to improve the quality of the web page by validating critical factors like SEO, Accessibility, Performance, Progressive Web App (PWA), and Best Practices.

Running audits every time is cumbersome. You can automate running audits in CLI (command line interface) mode. There are recipes for Continuous Integration using gulp.

Running Lighthouse CI Action is absolutely free and no infrastructure required. Thanks to Treo and Google.

## Prerequisites
* GitHub Account. 
* GitHub Repository with demo web page.


But now the CI process is hassle-free using Lighthouse CI. It is an open source project available at GitHub where you can run the audits continuously running, asserting, saving, and viewing Lighthouse audit regression results.

Read further at my [blog](https://qainsights.com/performance-testing-using-lighthouse-ci-action).

The post [Performance Testing using Lighthouse CI Action](https://qainsights.com/performance-testing-using-lighthouse-ci-action/) appeared first on [QAInsights](https://qainsights.com).
How to setup node.js application on Windows
Tags: node, npm, webdev, tips
Published: 2019-11-16 03:34:45

If you are a Mac user, then [Homebrew](https://brew.sh/) is the best way to add packages.

But if you have a Windows machine, then there are two package managers that I recommend [Chocolatey](https://chocolatey.org/install) or [Scoop](https://scoop.sh/).

##Chocolatey (with LTS version)##
1. Run Windows Powershell as administrator
2. Run command 
```
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
```
3. Reopen the Powershell
4. Install the LTS version
```
choco install nodejs-lts --version=VERSION_NUMBER
```
5. Reopen the Powershell, and run the command below to test
```
node -v
```
##Scoop (with nvm)##
1. Run Command Prompt or Windows Powershell as administrator
2. Run command
```
Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')
```
4. Reopen the powershell
5. Install nodejs package and nvm
```
scoop install nodejs nvm
```
6. install node version and use it
```
nvm install VERSION_NUMBER
nvm use VERSION_NUMBER
```
7. Repoen the Powershell, and test by using command 
```
node -v
```

## If you have an error to install Chocolatey or Scoop##
Please check the execution policy on Powershell.

**Chocolatey**
```
Set-ExecutionPolicy AllSigned
```
or
```
Set-ExecutionPolicy Bypass -Scope Process
```
**Scoop**
```
Set-ExecutionPolicy RemoteSigned -scope CurrentUser
```
Compiler flags for SwiftUI codes
Tags: swift, swiftui, ios, xcode
Published: 2019-11-15 20:28:04

SwiftUI is a very interesting library introduced at WWDC 2019. It brings iOS developer community a novel way to develop UIs for iOS and MacOS apps.

SwiftUI is also the first Swift binary framework that Apple introduced despite Swift was born in 2014 and been very popular.

To integrate SwiftUI, simply importing it, right? 

```swift
import SwiftUI
```

First of all, **SwiftUI** is only available on iOS 13 and later. It's likely that your app or team's app has to support iOS 12, 11. So adding `@available` is needed.

```swift
@available(iOS 13, *)
struct ContentView: View {
  var body: some View {
    Text("Hello World")
  }
}
```

Next, to make sure your app doesn't crash at launch on iOS less than 13, you need to add SwiftUI as `-weak-framework`, the same for **Combine**, which was also introduced last WWDC. 

![](https://i.stack.imgur.com/bpEeb.png)

or 

![Imgur](https://i.imgur.com/7EzIsef.png)

But then lowering your deployment target to iOS 10 or lower and compiling to **Generic iOS Device** or archiving, this happens:

![Imgur](https://i.imgur.com/4ml5MIT.png)

the reason for this is because SwiftUI wasn't compiled for 32 bit architectures. So adding 64-bit compiler flag to every SwiftUI code is required. 

```swift
#if (arch(x86_64) || arch(arm64))
@available(iOS 13.0, *)
struct HelloWorld : View {
    var body: some  View {
        //...
    }
}
#endif
```

`canImport(SwiftUI)` won't help you solve the problem above.

Finally, SwiftUI uses many new Swift 5.1 features, like `some` keyword of opaque return types and property wrappers. So if you, at some point, wants your code to compiles to Xcode before 11, you needs to add:

```swift
#if compiler(>=5.1)
//...
#endif
```

`compiler` flag actually represents Xcode 11, because changing `SWIFT_VERSION` in Xcode project still can get SwiftUI fully functional. So adding `#if swift(>=5.1)` is not the correct way.
StudIO: The all in one coding environment for iPad
Tags: app, ios, swift, code
Published: 2019-11-16 02:34:38

---
title: StudIO: The all in one coding environment for iPad
published: true
description: StudIO is a code editor for iOS
tags: app, ios, swift, code
cover_image: https://thepracticaldev.s3.amazonaws.com/i/xp7ul89cl6xyvammuqvr.png
---

I’ve been working on a pretty cool app called StudIO that aims to provide iPad users a fully functional coding environment without compromises.

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

StudIO is an iOS app that simulates the same complete development environment that you have on macOS or Ubuntu (or other *nix OS) machine. It primarily focuses on iPad, but it does work perfectly fine on any iPhone.

The editor is based on a rewritten version of CodeMirror 6, which enables developers to write and install plugins in order to improve their experience. It is compatible with many of the tools you love and use everyday such as iSH, drag and drop, Files, and many more.

StudIO is currently the best (and probably the only) option in the market. That’s why we made it cheap (4.99$ in most countries) so it’s competitive with future apps.

It’s also the first hackable code editor for mobile devices ever created. It means that you and the community can create and install plugins, specially for StudIO. Everything within the editor frame is customizable, from the theme to the smart completion bar. Plugins should be written in languages you already know and use: JavaScript and CSS (themes only). The app will run them concurrently using the fastest engine on the market: JavaScript Core, so performances shouldn’t be too much impacted.

StudIO will enable students, developers and everyone else to code right from the tool they love and use everyday. It’s one of my firsts app, and probably the one I’m most proud of. I would recommend you checking it on the App Store by searching for: “StudIO Code”, or just going to https://studiocode.app
Reminders
Tags: productivity
Published: 2019-11-16 01:22:32

---
title: "Reminders"
published: true
description: 
tags: ["productivity"]
canonical_url: https://fdo.cr/reminders/
---

This [blog post](https://visualcosita.com/reminders/) talks about a topic/area I don't usually write much about: **#productivity**

Ideas pop in and out of existence unexpectedly, that's my experience at least. This one professor from college always comes to mind when an idea is lost because I failed to write it down. He spent a few classes discussing with us some productivity/time management methods like [Get Things Done](https://gettingthingsdone.com/), [Eisenhower Matrix](https://www.eisenhower.me/eisenhower-matrix/) and others.

Writing it down, and more specifically: **(1)** what needs to get done, **(2)** when should it be taken care of (or revisited next), and **(3)** get it done. This is an oversimplified (butchered?) version that happens to work for me, but at least I've felt a boost in productivity since using it.

The tool that I enjoy using the most is Apple's [Reminders](https://support.apple.com/en-us/HT205890). The integration feels great, after Catalina came out at least. It gives me the flexibility I need in order to run my own Frankenstein method.

I'm not endorsing/evangelizing any of the methods/techniques out there, I'm only **taking note** about how having any system in place has felt empowering compared to keeping nothing other than mental notes.

Curious to hear about other tools people use, always great to try out alternatives (I must admit I'm knee deep in the Apple world).