teleren/devto huggingface dataset:
Flipping the coin: Should developers design?
Tags: discuss, webdev, design
Published: 2018-11-28 03:42:38

We all know and have different and loosely held opinions about designers coding. But what about the opposite?

Personally I've had uncomfortable interactions trying to navigate and 
performing critical tasks in both school and tax paying system. 

At the time there feel like Norman Doors, specially a time when I was asked to create a really strong password in order to protect critical information. After a form was submitted, no feedback was presented to the user. Upon further inspection a realized that a fetch request was made to the server and it has a ~5 second latency. If things go wrong, which they did, no feedback was presented to the user. It was really, really painful.

When you hire a developer, you don't expect her to design, however some UX or UI design is always appreciated. What's your take?
Episode 9: Building a JSON API - Filter/search
Tags: node, mongodb, javascript, docker
Published: 2018-11-28 03:34:37

---
title: Episode 9: Building a JSON API - Filter/search
published: true
description: Episode 9 covers adding filtering/searching to user, and dynamic filters to item
tags: nodejs, mongodb, javascript, docker
series: building-a-json-api-with-express
cover_image: https://thepracticaldev.s3.amazonaws.com/i/5jjr4h1ezg888teg4keq.png
---

Picking up where we left off last time, we are now going to enable our express API to be filtered/searched on. Once on an explicit property, and another on a dynamic property.

{% youtube SMrcO8A-t5w  %}

If you'd like, drop a comment with something else you'd like to see this series cover, or if you disagree with how I've demonstrated something. Thanks for watching!

Source code:

{% github NathanBland/core %}
Siddhi, 2015
Tags: hackathon, facebook, twitter, oauth
Published: 2018-11-28 03:32:09

---
title: Siddhi, 2015
published: true
description: Siddhi, 2015
tags: hackathon, facebook, twitter, oauth
---


Siddhi hackathon was conducted online during the month of October 2015, you had to register with an email ID on Hacker Earth and submit code to the hackathon during the day. It was conducted by Persistent Systems, there were 2 tracks, one for business oriented product lines, and another for environmentally oriented product lines.

I built a social media scraper tool that evaluated and profiled people based on their online interaction. It considered factors like the pages you interact with, likes you make in public, your comments on public pages, and other such factors. The idea was to make a tool for HR teams who could run the suite against potential employees, the tool would look through their publicly available online interaction, look for any red flags, and generate a scored report for the said user. This report can then be instrumental in hiring the candidate.

The main assumption behind this tool is that the confidentiality of the user will be maintained, only the algorithm or the tool would be able to look at posts made by the user, if it detects a red flag, only the acknowledgement of the red flag would be made in the report, the post that the user had originally made would not be shown/factored into the report, this way you can be sure that  there will be no partiality or unfairness between any two trials with the tool.

The tool expected you to point the candidate's name, after which it requests Facebook/Twitter for his OAuth permissions, once the user grants these permissions, the tool scrapes everything that's available through their respective APIs and runs it through a classifier that takes care of flagging any activity.

The judges loved the idea, but it was an incomplete product, I could only get permissions from Facebook and Twitter and couldn't convincingly build the machine learning algorithm, still we were invited to Taj Vivanta, Bangalore for an offline session where the top 5 teams were selected. We each had 5 minutes to showcase our idea and talk about how our idea would leave an impact on businesses.

We didn't win anything at this hackathon, but the experience of meeting Mr Mritunjay Singh from Persistent Systems was really valuable to me.
Good habits and precedure before creating a website
Published: 2018-11-28 00:11:17

---
title: Good habits and precedure before creating a website
published: true
description: habits and precedures
tags: 
---

There are so many websites in the world and many ways to create these websites. The way I will be talking about in this blog will be using html, css and Javascript to create one page website. 

Before creating a website, it is a good habit to draw out the basic format of the website. Things like where should be the location of the title, shortcuts and where the page information should be changed. this would be good for the html and the css part. Knowing how the website display is going to end up before starting to create an website helps very much. 

For the JavaScript part, since we already have the outline design of the website, we would know where to render out with the JavaScript using jquery or DOM. Starting JavaScript, it is good to first think about the easy features that are needed. Example, when creating todolist, the basic functions needed are display a list, add to a list, check if the todo has been finished and to delete the not needed todos. Just by thinking about this before creating the website, we can set how our path should go when creating a website.

It would be a good habit to write down these ideas in a paper, like brainstorming and with this it is easy to see what has to be done first.

So with this todolist example, first we would decide where the input and button box to be located. then we should decide where the todolist should be rendered. With CSS, how the display should be designed. And then we can create display function(render) first. And make a function to add the todos. Then make the function to checkout the todos that are finished and then make the function to delete the function that is checked out.
What is the future of software development pay range?
Tags: discuss, career
Published: 2018-11-27 23:50:11

Software developers are paid pretty well. In some markets, top developers are paid _extremely_ well. Perhaps they are paid commensurate to the value they bring, perhaps not.

Regardless, what do you think is the future? Will pay range widen? Will top devs make more? Will all devs make more? Will our industry become less differentiated, leading to general pay decreases?

Thoughts?
Rust Survey 2018 Results
Tags: rust, survey, 2018
Published: 2018-11-27 22:56:00

---
title: Rust Survey 2018 Results
published: true
description: 
tags: rust, survey, 2018
---

What do you want to say about Rust?

I learned a little Rust this year. I felt a little hard to learn, now I pay more Go and concern about Rust. Here's the newest survey. Their community is the best, warm , open and welcome.

>Another year means another Rust survey, and this year marks Rust’s third annual survey. This year, the survey launched for the first time in multiple languages. In total 14 languages, in addition to English, were covered. The results from non-English languages totaled 25% of all responses and helped pushed the number of responses to a new record of 5991 responses. Before we begin the analysis, we just want to give a big “thank you!” to all the people who took the time to respond and give us your thoughts. It’s because of your help that Rust will continue to improve year after year.

![](https://blog.rust-lang.org/images/2018-11-RustSurvey/1-Do_you_use_Rust.png)

[link-->](https://blog.rust-lang.org/2018/11/27/Rust-survey-2018.html)

>Challenges

>As we’ve done in past years, we asked for your comments in where Rust can improve. This year, we see some familiar themes as well as some new ones in this feedback. The top ten themes this year are:

    the need for better library support
    a more improved IDE experience
    the need for broader adoption of Rust generally
    a richer ecosystem of tools and support
    an improved learning curve
    the need for important language features and crates to be stable and supported
    support for async programming
    support for GUI development
    better documentation
    improved compile times

>New this year is the rising need to support GUI development, showing that Rust continues to grow not only on the server, but that people are feeling the need to stretch into application development.
ES6 - Template Literals
Tags: templateliterals, javascript, es6, beginners
Published: 2018-11-27 18:55:34

---
title: ES6 - Template Literals
published: true
description: 
tags: Template Literals, JavaScript, ES6, beginners

---

The one of my favorite features in ES6 or ECMAScript 2015 is 'Template Literals'. Before I learn about 'Template Literals' in my Coding Boot-camp recently, I used to use string concatenation in JavaScript as following:
<pre> 
var user = {
  name: 'Gina',
  hobby: 'Traveling',

};

console.log('Hi, I\'m ' + user.name + '! My hobby is "' + user.hobby + '".');

//Hi, I'm Gina! My hobby is "Traveling".
</pre>


Now with template literals, I can write as following:

<pre>
var user = {
  name: 'Gina',
  hobby: 'Traveling',

};

console.log(`Hi, I'm ${user.name}! My hobby is "${user.hobby}".`);

//Hi, I'm Gina! My hobby is "Traveling".
</pre>

Both examples give the same result, but do you see how readable the second example is using the 'Template Literals'?  When you are using string concatenation, you need to use the backslash(\\) to escape special characters. Because of the duplicate usage of some of the characters, reading and understanding the text could be challenging. With Template Literals, you construct the string as you are writing a plain English sentence inside back-ticks(``). If you want to add variables, just use a dollar sign followed by curly brackets.  You can even add a simple Javascript statement if it is necessary as following:

<pre>
console.log(`Two times seven is ${2*7}.`);

// Two times seven is 14.

</pre>

In addition the line breaks got much easier with Template Literals.

<pre>
With Template Literals:

console.log(`Hi Gina,
Good luck with your presentation today!
                          -your friend`)

//Hi Gina,
Good luck with your presentation today!
                          -your friend
</pre>

<pre>
Without Template Literals:

console.log('Hi Gina, \n' +
'Good luck with your presentation today! \n' +
'\t\t\t\t\t\t   -your friend')

//Hi Gina,
Good luck with your presentation today!
                          -your friend
</pre>

Do you see how easy it is to read? With template literals, you create text as you write a note to your friend without using new line characters(\n) or tabs(\t).  I have not encountered any issues with this feature so far and I really enjoy using it. If you have not tried it yet, you should definitely give a try...

Thanks for reading!
Write XSS Cookie Stealer
Tags: security, javascript, php
Published: 2018-11-27 22:13:11

---
title: Write XSS Cookie Stealer
published: true
description: ID | Write XSS Cookie Stealer. English version soon
tags: security, javascript, php
---
English version soon (maybe)
[Write XSS Cookie Stealer](http://ox.metrotvnews.com/newrevive/www/delivery/ck.php?oadest=https://abaykan.com/post/membuat-xss-cookie-stealer)
TDD: Test Drive Your Code!
Tags: testing
Published: 2018-11-27 22:03:14

---
title: TDD: Test Drive Your Code!
published: true
description: 
tags: testing
---
![img](https://cdn-images-1.medium.com/max/1400/1*U-TwjPREbLSVBG0lrowk3g.png)
In the past week we've spent a bit of time in class writing unit tests and functional tests using [Mocha](https://mochajs.org/) and [Chai](https://www.chaijs.com/), then pairing with [Sinon](https://sinonjs.org/) to mimic a server. In this post, I will cite an opensource project I've contributed to on Github, using [Jest](https://jestjs.io/) to pair with React. To look at what test-driven development means, let's take a closer look.

Test-Driven Development (TDD) is beginning the coding process by writing tests first. Writing tests before writing the corresponding code helps define the parameters and use of the function, resulting in more modular, reusable pieces of code. Done properly, good unit tests can serve as documentation to other coders by providing them with a design of how you wanted your function to behave. Good unit testing can make it easier to refactor your code and look at it objectively each step of the way.

In the following example, this unit test has one purpose: to see if the capitalized word will be tallied on a counter just like the uncapitalized match: 
![img](https://thepracticaldev.s3.amazonaws.com/i/zvrqq7lnlp9x7flp8mkl.png)
The test begins by giving us a short description of what the function should do if our circumstances are met. It then defines parameters to test and the number of times the parameters should be found. 

The above test helps define the .toLowerCase() method in the counter function found below:
![img](https://thepracticaldev.s3.amazonaws.com/i/z33y4bfqtojxdz84lwhn.png)

You can build a suite of tests in a similar fashion to isolate instances in a function, like the following:

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

This is just a short intro to writing tests. More to come! As always, questions, comments and suggestions for improvement are always welcome. Thank you for reading.
Socket.io
Tags: socketiojavascript
Published: 2018-11-27 21:50:58

---
title: Socket.io
published: True
description: Today we take a look at socket.io to see what we can get out od it
tags: Socket.io JavaScript
series: socket.io
---

   Socket.io is a node package that enables realtime communication between clients and servers. This enables us to have clients interact with each other in realtime without even refreshing the page! Lets look at how this works.

   If we were to have our app connect to the server with socket.io we would implement this code in our server:

const express = require('express');
const app = express();
const server = require('http').createServer(app);
const io = require('socket.io').listen(server);

   This sets up our server to include socket.io but we need the app to make a connection. So also in our server we need to set up a connection statement to handle client connection. We include the following.

io.on('connection', function(socket){
    console.log("we connected!");
    //more code for socket.io here
}

   This code should log "we connected!" on the backend when a client has connected. But connecting isn't enough, we want to send and receive messages. So to receive messages, inside the connection, we use:

//here we listen for an event called 'some-event'
socket.on('some-event', function(data) {
    console.log(data);
    io.emit('new-event', newData; //here newData is some contrived data
});

   Now let's look at that last line with io.emit. Thats how we send events. If we place a listener in the app files like so:

socket.on('new-event', function(data) {
    console.log(data);
});

  This code listens for the new-event and console logs it on the console on the client side. This means that we now have all the parts to make this app communicate in real time. This comes with the benefits of changing data in our database and keeping it up to date across all clients. This is only the basics. We can make several different statements to include where our messages emit to. The current statement we have emits to all users. But we can do better than that. Here is a handy cheat sheet for all the emit types we can use: 

https://socket.io/docs/emit-cheatsheet/
Growth Mindset Prompts
Tags: productivity, selfhelp
Published: 2018-11-27 21:44:50

---
title: Growth Mindset Prompts
published: true
description: 
tags: productivity, self-help
---
Some prompts I have in my notebook that I find handy, especially on the tough days.

* What did I _learn_ from today?
* What _steps_ did I take to be more successful, what can I do tomorrow?
* What _strategies_ did I use today, and how would I change them for tomorrow?
* How did I _keep going_ when things got tough?
* What did I _learn from others_?

And then a few reminders to myself:

* This is challenging, believe you _can_ do it.
* I might not have got there yet, but I will if I keep working and thinking about it
* Appreciate you gave it a good shot - sometimes that's all you can do.
* It is OK to take risks - this is sometimes how that feels.
* If you surround yourself with smart people sometimes you will feel like the dumbest person in the room. Don't let it get to you.
* Getting better takes time - and I can see myself improving
* Learn and move on

Does anyone have any other good ones that work for them?
Getting node.js and Express up and running on my...  phone?
Tags: android, mobile, javascript, node
Published: 2018-11-27 21:21:59

I installed [Termux](https://play.google.com/store/apps/details?id=com.termux) from the Play store. It's free and doesn't require root access. Sorry but if you have an iPhone, go fish.

The first thing I always do is check for updates by running these commands. If you have been away from your terminal for a while, it's good to run them again.

```bash
apt update
apt upgrade
```

To extended the keyboard to give you options to keys like `ESC`, `HOME`, `END`, `TAB`, etc. Swipe from left to right to open the Termux menu and long press on the `KEYBOARD` word.

![Termux screenshot of keyboard](https://thepracticaldev.s3.amazonaws.com/i/0zfe5hmawqsu2gc1qm57.png)

Install `nodejs`, `curl`, and `git`. I know for sure I'll need these.

```bash
apt install nodejs curl git
```

Install your favorite editor. vi is already installed, but I like nano.

```bash
pkg install nano
```

![Termux running nano with JavaScript source](https://thepracticaldev.s3.amazonaws.com/i/fxcmrog7k0crh4hlk2e1.jpg)

I had to fix npm so that I could install packages globally.

```bash
nano ../usr/lib/node_modules/npm/node_modules/worker-farm/lib/farm.js
```

set `maxConcurrentWorkers` to `1`.

I always create a dev directory to keep all my projects.

```bash
mkdir dev
cd dev
```

# Time to give it a spin

Let's fire up an example Express app to see if this thing will go.

```bash
git clone https://github.com/joelnet/MojiScript.git
cd MojiScript/examples/express-static-files
npm ci
npm start
```

![Screenshot of Termux running an express app](https://thepracticaldev.s3.amazonaws.com/i/2q2iyy2pa29k4gblhs7w.jpg)

Okay, it says it's listening on port `3000`, but I have been lied to before.

![Screenshot of a browser running express on Android](https://thepracticaldev.s3.amazonaws.com/i/4gec1uf9bgf7c2jypml2.jpg)

Awesome! Looks like it really works!

# Notes

I could get [`n`](https://www.npmjs.com/package/n) to install, but it didn't have access to `/usr` directory and fails. This wasn't important to me at this moment, so I didn't dig into a fix. Maybe if you know you can let me know in the comments.

Not all packages are compatible. So this isn't going to be replacing my dev machine any time soon. But it's nice to be able to tinker on the go.

# Summary

I was able to get node and express up and running on my Android phone using Termux. The setup is pretty fast and straight forward. I was actually surprised at how easy this was.

I use this setup to run some quick JavaScripts when I am not around a computer. This happens more than I would like to admit.

Where should I take this next? Let me know what you would do with this setup in the comments!

I did get [WarriorJS](https://warriorjs.com) up and running too!

![WarriorJS running on Termux](https://thepracticaldev.s3.amazonaws.com/i/atgstb6ti1hm2vyiptk1.jpg)

If you love Functional JavaScript, follow me here or on Twitter [@joelnet](https://twitter.com/joelnet)!

![Cheers!](https://thepracticaldev.s3.amazonaws.com/i/6jsy3a866frzp3u5oda0.jpg)
A list of useful Azure tools
Tags: azure, devops, powershell, perl
Published: 2018-11-27 21:02:57

---
title: A list of useful Azure tools
published: true
description: A list of sparrow plugins to automate Azure tasks
tags: azure, devops, powershell, perl
---

Recently I have started playing with Azure/Powershell scripts. Here is a collection of tools ready to use:

https://sparrowhub.org/search?category=azure

All the scripts are distributed through [Sparrow](https://metacpan.org/pod/Sparrow) - script management platform written on Perl.

You can use these scripts on both Windows/Linux platform.


Every script has a unified way to install and run, just `$ sparrow plg install $plugin-name` to install, and `$ sparrow plg run $plugin-name --param key=value --param key2=value2` to run.


You can memorize scripts configurations by creating tasks:

`$ sparrow project create azure-scripts`
`$ sparrow task add azure-scripts $task-name $plugin-name`
`$ sparrow task ini azure-scripts $task-name $plugin-name`
`$ sparrow task run azure-scripts $task-name $plugin-name`


I am going to add more scripts soon.

---

Thank you for reading and let me know if the scripts are useful.
Arrays in JavaScript
Tags: javascript, beginners
Published: 2018-11-27 20:05:17

---
title: Arrays in JavaScript
published: true
description: 
tags: #javascript, #beginners
---

Arrays are one of, if not the most important object in the JavaScript language. It can be used to represent and store large amounts of almost any data type that you will use for your apps or websites. At the basic level they can be used to store lists of things, such as names or numbers. Below is a simple example of an array of names. 
```javascript
let names = ["Bill", "James", "Larry", "Tim"]
```
The list of names above is being stored in a variable called names. This allows you to have access to the list in any part of your code depending on the scope or position where the variable is declared. You can access the names in the array by the position number of the items starting from left to right. Do note that positions do not start at 1, but 0 in arrays. You will also need to use bracket notation for the position. 
```javascript
let leader;
let names = ["Bill", "James", "Larry", "Tim"]
leader = names[2]; //leader is set to Larry
```
As you can see from the above example, we set the variable leader to be the name Larry from the array by accessing it's position of 2. Again, it would not be 3 because the positions start at 0. What really makes arrays great besides being able to store large amounts of data, are the built in array properties and methods(actions) that let you manipulate the data. I have included a couple in the example below. 
```javascript
let names = ["James", "Bill", "Tim", "Larry"]
names.length// returns length of array: 4
names.sort(); //items in array are sorted: ["Bill", "James", "Larry", "Tim"]
names.push("Willy");/**item is added to the end of array and the length of array is returned: 
["Bill", "James", "Larry", "Tim", "Willy"] length of 5**/
names.pop();//the last item in the array will be removed and the item will be returned: "Willy"
```
The above are just some of the many methods that you can use on arrays to help manipulate the data in the way that you need. A very good reference for the other arrays methods can be found at w3schools [here](https://www.w3schools.com/jsref/jsref_obj_array.asp).