teleren/devto huggingface dataset:
Living without panels....
Tags: linux, desktop, minimal, xfce
Published: 2020-10-13 08:53:11

For literally most of my Linux life I've been using xfce as my main desktop environment. Using xfce I've always had some form of xfce4-panel around the edge of the screen & conky sitting either on the desktop or inside the panel [_"see this gist for a how-to"_](https://gist.github.com/furycd001/6d4026234b1b0797d597e8fc53a7877f).

![alt text](http://i.imgur.com/y7w5Mdo.png "Conky displayed inside xfce4-panel")

Recently I wanted to see what it would be like living without any panels or visible conky. The problem was that I still needed (wanted:?) a system tray for the likes of steam & clipman. Anyway.. I removed everything from my panel apart from the system tray & then set it to always be hidden unless I hovered over it. Next was conky. I wanted conky to output to the terminal & appear whenever I pressed a keyboard shortcut. This didn't take very long & was super easy to make. 

> [ JUST A SIDE NOTE ]  
> Conky set to output to the terminal can get messy very quickly, because it simply output's over & over.

To get things working & displaying the way I wanted I had to set conky to run only once within the config, but use the [watch command](https://linux.die.net/man/1/watch) in the script to have it run more than just once.

```bash
watch -t -n 1 'conky -q -c /home/furycd001/Dots/conky/terminal.conf'
```

With that done I decided I wanted the open window to be positioned to the top right of my external monitor. This was easily done using [xdotools.](https://www.semicomplete.com/projects/xdotool/)

```bash
xdotool getwindowfocus windowmove 2948 22
```

Finally I saved the script script & executed it using the following command linked to a keyboard shortcut.

```bash
xfce4-terminal -H --hide-menubar --geometry=38x7 --execute /home/furycd001/Dots/Gucci/conkyterminal.sh &
```

Here's the [conky config](https://github.com/furycd001/dots/blob/master/conky/terminal.conf) & complete [script](https://github.com/furycd001/dots/blob/master/Gucci/conkyterminal.sh) incase your interested.

![alt text](https://i.imgur.com/Bz7TYzp.jpg "Conky displaying inside a terminal window")

I been using this setup almost a month now & I haven't had any problems. I've also been using xfce with no window decorations for a number of years now & my system looks more minimal than ever. I don't miss my panel & I really don't miss window decorations. I can see this being my setup for quite some time now & I'll probably find it hard if I ever try going back to using a panel.
Currying Functions
Tags: javascript, functional
Published: 2020-10-13 08:51:32

`Currying refers to transforming functions with multiple arguments into a function accepting a single argument at a time.`

It is usually achieved by having the function return another function which in turn takes the next argument as its only parameter.

This is often difficult for the beginners to understand. Let us begin by understanding higher order functions.

### Higher Order Functions ###

Unlike many other languages, javascript allows functions to take another function as a parameter. It also allows a function to be returned as a result.

`A function which takes another function as a parameter or that which returns another function is a higher order function.`

#####Eg 1: Function taking another function as parameter#####

```javascript

let sayHi = function(sayBye) {
	sayBye();
	alert("Hi !!");
}

let sayBye = function() {
	alert("Bye !!");
}

sayHi(sayBye);
```
Can you predict the order in which the alerts will get prompted ? 

In the above example. sayHi() is a higher order function.

#####Eg 2: Function returning another function as parameter#####

```javascript

let sayBye = function(name) {
	return function() {
  	return "Bye "+ name + " !";
  }
}

alert(sayBye("Raj"));

alert(sayBye("Raj")());

```
Can you predict the output of the above two alert prompts ?

Here, sayBye() is a higher order function since it returns another function.

Once you are good with higher order functions, you are ready for understanding currying. Let us try a simple example for adding two numbers.

Eg 1 : Normal method - function accepts more than 1 parameter

```javascript
let add = function(a,b) {
	return a+b;
}

let result = add(10,12);
alert(result);

```

Eg 2 : Currying method - function accepts only 1 parameter

```javascript

let add = function (a) {
  return function (b) {
    return a + b;
  };
};

let result = add(10)(12);
alert(result);

```
add(10) returns a function. 
```
function (b) {
    return a + b;
};
```
for the above function, when 12 is passed as parameter, we get 22 as the result.

In the above example, both these calls are made in a single statement.

```javascript
let result = add(10)(12);
```

Let us try currying for a function which finds the power of a number.

* Without Currying
```javascript
let power = function (power, number) {
  let product = 1;
  for (let i = 1; i <= power; i++) {
    product *= number;
  }
  return product;
};

alert(power(3, 2));
```

* With Currying 

```javascript
let power = function (power) {
  return function (number) {
    let product = 1;
    for (let i = 1; i <= power; i++) {
      product *= number;
    }
    return product;
  };
};

let cube = power(3);

alert(cube(2));
alert(cube(3));
```

Hope this helped you understand currying! Continue the fun with currying!
How do you deal with content editing after the site has been shipped?
Tags: webdev, discuss, cms, productivity
Published: 2020-10-13 08:34:32

---
title: How do you deal with content editing after the site has been shipped?
published: true
description: 
tags: webdev, discuss, cms, productivity
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/084nk6suoc29yxeho0rn.jpg
---
You have most likely experienced a situation where the client asks you to develop a custom static site with general info about the business, services, and contact info. 

The client says the content will not change, so you eliminate the need to base it on WordPress, Joomla, Drupal, etc. So you write it from ground-up, deploy it on a server and the client is happy for now.

Half a year later, the client has changed the mind and decided to change some information in it, so he/she asks for some edits.

You might get down with one case, but what if you have like 50 sites? How do you deal with situations like that?

1) Do you always create some CMS that comes along in the beginning, no matter the complexity of the site and what the client assures about the content always being 'static' (as you know, it will be not), and then ship the site with access to CMS so clients can edit it later by themselves?

2) Do you prefer not to implement any CMS at the beginning for simpler sites (believing in the client) and offer to create CMS only if they start to ask for edits and then charge for the creation of CMS?

3) Or do you prefer to make an agreement with the clients on initial shipping about charging them for managing the site for X period of time, guaranteeing yourself the job, and some extra income in the long-term?
How to take a screenshot of Jira kanban
Tags: jira, screenshot, clome
Published: 2020-10-13 08:16:52

Our team is using Jira for the scrum process. We want to get a screenshot of Jira's kanban board daily. There are nice chrome extensions for taking a screenshot of the full page of a website, such as [this](https://chrome.google.com/webstore/detail/screenshot-master-full-pa/pfaljlepkegmfnidgahckeidofinndof). 
However, Jira's kanban screen disables body scrolling. Moreover, there is a scroll bar on the element of the kanban board. Those avoid full-screen snapshot of the webpage.

![Jira kanban](https://dev-to-uploads.s3.amazonaws.com/i/h4t18efx4iq4o9tpwoz6.jpg)

# Craft own chrome extension

I succeed to adjust the Jira kanban page by editing CSS via chrome developer mode, removing the unused scroll bar and reshow page's scroll bar. But it's painful to adjust it daily before taking a screenshot. How to make it easier? I found a solution from this article, https://qiita.com/dhomma/items/bb49c9f6b66ee936ff5c. The article is about how to craft a chrome extension for the purpose of editing CSS of a specific site. This is it!

#### Make directory and files
```
$ mkdir your_directory
$ cd your_directory
$ touch manifest.json
$ touch style.css
```
Finally your files same as below.
```
your_directory
├── manifest.json
└── style.css
```
#### Edit manifest.json

manifest.json
```json
{
  "name": "www.example.com css",
  "version": "1.0",
  "description": "CSS for www.example.com",
  "content_scripts": [
    {
      "matches": ["http://www.example.com/*"],
      "css": ["style.css"]
    }
  ],
  "manifest_version": 2
}
```

Please modify `www.example.com` to your jira's one.

#### Edit style.css

style.css
```css
body#jira {
    overflow: scroll!important;
    overflow-x: scroll!important;
    overflow-y: scroll!important;
}

#ghx-detail-contents, #ghx-pool {
    height: fit-content!important;
}
```

# Install your extension

1. Open the chrome extension management screen.
1. Enable `Developer mode`.
1. Click `Load unpacked`.
1. Select `your_directory`.

# Finished
You have to refresh your Jira kanban page. Enjoy!
Asserting sequence order with NExpect
Tags: csharp, testing, nexpect, tdd
Published: 2020-10-13 08:13:44

I've made a recent small addition to NExpect core which I hope will make certain kinds of tests a little easier for everyone: tests where we have to ensure that the output of our system-under-test is ordered.

Some simple examples:

```csharp
[Test]
public void ShouldAssertSimpleOrder()
{
    // Arrange
    var numbers = new[] { 4, 2, 5, 1 };

    // Act
    var ascending = numbers.OrderBy(x => x).ToArray();
    var descending = numbers.OrderByDescending(x => x).ToArray();

    // Assert
    Expect(ascending)
        .To.Be.Ordered.Ascending();
    Expect(descending)
        .To.Be.Ordered.Descending();
}
```

So you may be thinking: "this is all good and well, but what if I want to assert ordering on collections of types more complex than numbers?"

There are some strategies you can take there. First off, the underlying logic in the above assertions takes advantage of [Comparer<T>.Default](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.comparer-1.default) which relies on the `IComparable<T>` interface, meaning means that:

1. a lot of types are [already supported](https://docs.microsoft.com/en-us/dotnet/api/system.icomparable-1)
2. you could implement `IComparable<T>` on your complex type and be able to order it anywhere with LINQ
3. you can `.Select` off the interesting bit and assert on that

(3) is probably going to be your go-to, so here's an example:

```csharp
[Test]
public void ShouldAssertOrderedAscending()
{
    // Arrange
    var doggos = new[]
    {
        new { id = 1, name = "Rex", adopted = new DateTime(2020, 1, 1) },
        new { id = 2, name = "Spot", adopted = new DateTime(2019, 5, 6) },
        new { id = 3, name = "Woofles", adopted = new DateTime(2020, 4, 5) }
    };
    Expect(doggos.Select(d => d.id))
        .To.Be.Ordered.Ascending();
    // Act
    var orderedByAdoption = doggos.OrderBy(d => d.adopted);
    // Assert
    Expect(orderedByAdoption.Select(d => d.adopted))
        .To.Be.Ordered.Ascending();
}
```

The above, and first-class support for `IOrderedEnumerable<T>` is added in NExpect 1.0.181.

Happy testing!
How to setup WordPress on Raspberry Pi
Tags: linux, wordpress, beginners, mysql
Published: 2020-10-13 08:12:44

You can check the full tutorial at <a href="https://rpiproject.com/">RPi Project</a>

Learn how to setup and install the most popular CMS in the world on your Raspberry Pi.


WordPress is a CMS that is loved by more than 50% of the internet, and is serving over 60 million websites all around the world. It is the most popular CMS amongst Bloggers and small businesses.

Now coming to the tutorial, WordPress can be running on Raspberry Pi to be a development server and check out various different themes and plugins and their uses before you implement them in your real website or your money website or the website you are going to build.

Setup and implementation of WordPress on a Raspberry Pi is not that complicated as such and can be done with least amount of effort and just by following the tutorial here.

One of the main things that you have to setup before you can actually install WordPress is basically implementing an Apache server on your Raspberry Pi and installing PHP and MySQL for database of the website.

Setup of Apache Web Server, Install PHP and MySQL on Raspberry Pi.

One more thing that you need to keep in mind before you proceed with the tutorial that you should have your MySQL root password hand-ready before you initially take a step forward and create your own website on Raspberry Pi.

List of items/hardware required
The items or the hardware that are required for implementation the WordPress server setup,

Raspberry Pi 4, 3 or 2 – YOUR MAIN THING

Micro SD Card – Memory

Power Supply – Of course you need your power!

An ethernet cable or a WiFi dongle (not required for Raspberry Pi 3 or 4)

Details posted in website, go check it out! 
You can check the full tutorial at <a href="https://rpiproject.com/">RPi Project</a>
Coding with Vim on iPad
Tags: vim, ipad, ios, browser
Published: 2020-10-13 08:04:16

When you search on the web about programming by Vim on iPad, you would see either use iOS vim app or use ssh to a server that you have.
The first option, to use the iOS app, which you need to copy the file to some other devices from iOS. The second option, you need to have the server you connect to. 

I introduce [Wazaterm](https://www.wazaterm.com) here. You only need a browser to use Vim.  Let me explain how to use them.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/ahlqp3x6uxeazi9u1vvu.png)

#### 1. Follow the [Getting started page](https://www.wazaterm.com/howtos/getting-started)
  1. Go to https://www.wazaterm.com and sign up. (You may get $3 worth credits) 
  2. Purchase credits (if you could not get)
  3. Start terminal by selecting instance.
  4. Start tmux to keep the sessions. 

#### 2. Install Vim with apt

The terminal is ubuntu instance so you can use apt or apt-get to install vim.
```
$ sudo apt-get install vim
```

#### 3. Launch Vim 
You can keep the terminal running but for the cost, you can shut down the terminal every time you finish the work on the day. Wazatem has Webhook so you can use IFTTE or cron to launch or terminate the terminal. (see [here](https://www.wazaterm.com/howtos/automate-launch-halt-with-ifttt) or [here](https://www.wazaterm.com/howtos/i-cant-wait-for-2-min-to-start-terminal-every-time-is-there-any-workaround) for more detail)

```
$ vim hello_world.rb
```

_Due to iOS limitation, key repeat doesn't work :S 
I use "e" to skip the word s. I hope Apple fix this soon..._

Have a happy hacking with Vim on the iPad!
Wireless Tech used in IoT and Home Automation
Tags: iot, wireless, homeautomation, technology
Published: 2020-10-13 08:01:07

**Zigbee**
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/3tuw1gau7yivffdpfnqc.jpg)
Zigbee is a wireless technology developed as an open global standard to address the unique needs of low-cost, low-power wireless IoT networks. The Zigbee standard operates on the IEEE 802.15.4 physical radio specification and operates in unlicensed bands including 2.4 GHz, 900 MHz, and 868 MHz.

Zigbee is primarily used for home automation applications such as smart lighting, smart thermostats, and home energy monitoring. It is also commonly used in industrial automation, smart meters, and security systems

**BLE**
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/50u98ibaihwocz0cy2hb.png)
The Bluetooth Low Energy (LE) radio is designed for very low power operation. To enable reliable operation in the 2.4 GHz frequency band, it leverages a robust frequency-hopping spread spectrum approach that transmits data over 40 channels. The Bluetooth LE radio provides developers a tremendous amount of flexibility, including multiple PHY options that support data rates from 125 Kb/s to 2 Mb/s, multiple power levels, from 1mW to 100 mW, as well as multiple security options up to government grade.

Bluetooth LE also supports multiple network topologies, including point-to-point, broadcast, and mesh networking.

**Z-wave**
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/o5qf8zd4wcy3faj39v22.png)
Z-wave is one of the newest kinds of wireless technology that smart devices use to communicate with each other. You can think of it as being in a similar category as Bluetooth or WiFi, but Z-wave possesses a few unique qualities that translate into major advantages for home automation.

Z-wave technology creates a wireless mesh network, which is a collection of devices that link up and communicate with each other without wires. With Z-wave technology, devices “mesh” together by sending signals over low-energy radio waves on a dedicated frequency. (Z-wave operates on the 908.42 MHz radiofrequency in the U.S. and Canada, but the exact frequency varies by country.) Every Z-wave device has a tiny built-in signal repeater that sends and receives network information.

**Bluetooth**
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/xzc5cfospnzp3h6t3gct.png)
Bluetooth is another wireless technology standard (not a piece of plastic you stick in your ear for phone calls). Of course, the two are related, but the wireless connection between your phone and the earpiece is called Bluetooth… not the piece itself. As you can imagine, Bluetooth was developed as a way to exchange data over a short-range (like from your pocket to your shoulder) without the need for wires. That’s why Bluetooth is used for wireless headsets, hands-free calling through your car, and wireless file transfers.
[EXCEPTIONAL POST] What do you think?
Published: 2020-10-13 07:02:11

A recent study found that getting married in old age increases the risk of divorce.  According to the study, the divorce rate in the United States increases by 5% annually as a result of marriage after 32 years.  However, previous studies have shown that those who marry late have a much lower divorce rate.  "This is a big change," said Nicholas Wolfinger, a researcher at the University of Utah in the United States.  “As far as I know, the risk of divorce is due to.
Algorithmic Programming
Tags: fbb, algoprogramming
Published: 2020-10-13 06:50:43


It's 2020 and we have a plethora of programming languages each having it's own USP. For business programming, this means the business logic has to be re-written using a new programming language almost every decade to benefit from the advances. Few months back, I had started on a goal of converting an algorithm to executable code with focus on easy maintenance, code re-usability and language independence. I'm glad to share an approach that might just work. Let me know if you find it useful.

When one starts on a program, one writes the algorithm as a sequence of steps. Wouldn't it be nice if a program could convert an algorithm into program and execute it? My approach maintains a one-to-one correspondence of the initial draft with the final program. The name kind of highlights that fact. People familiar with the subject might see similarities with Flow Based Programming (FBP). Though there have been many iterations and improvements on the basic theme, I'll let the reader decide if my approach is an improvement. [This discussion](https://groups.google.com/g/flow-based-programming/c/p64alZ1Hwwo) provides a comparison between the two approaches.

To test the feasibility of this approach, I wrote some code to generate the runtime/ orchestrator (index.js) from FBP definition (init.fbp). The code is available here [https://gitlab.com/atamariya/fbp](https://gitlab.com/atamariya/fbp) .

**network.fbp (Sample FBP program)**  

    Read line from network.fbp,lineReader,network.fbp  
    Parse nodes,parseNodes  
    Append nodes,append  
    Generate code,genCode  
    Execute code,vmscript  

This is a simple CSV file with two mandatory fields:
1. Comment explaining the step
2. Identifier from a component implemented in a programming language
3. Init parameters for the component (*optional*)

You can run network.fbp (default) as

    node index.js

You can also provide an FBP file without suffix as an argument  

    node index.js init


**index.js (Sample NodeJS implementation)**  

    var packages = ["lineReader", "parseNodes", "append", "genCode", "vmscript", ];  
    var vars = [];  
    var initargs = [];  
    initargs[0] = ["network.fbp"];  
      
    var core = require("./core")();  
    var res;  
    res = core.init(packages, initargs, vars);  
    res = res.then(() => core.execute(e));  
    res = res.then((e) => {  
    console.log(e);  
    // Additional code to process res  
    // Returned value is the value of res  
    return e;  
    });  
    return res;

**Advantages**
- Inline comment makes it very clear what's happening in that particular step. So one need not look into the component to understand the flow.
- It's easier to edit with or without a GUI tool. Hence, it's beginner friendly. 
- For business logic, this seems to be a good balance between complexity and maintainability. More complex idioms are better suited for a programming language which can be implemented within a component.
- Components are simply pieces of code to be executed by the orchestrator.
- Algorithm remains totally independent of the runtime programming language.
How to Install GitHub Desktop 
Tags: git, github, webdev
Published: 2020-10-13 06:39:24

In this article, we will teach you how to install the GitHub Desktop. Here are some of the features that you get by using the desktop version.

A GitHub Desktop allows you to have complete control over GitHub from the easy access of your desktop. If you're the type of person who doesn't want to rely on the web browser, [install GitHub Desktop](https://www.discussdesk.com/how-to-install-github-desktop.htm) is spot on for you. 
It will make the whole [project ](https://www.discussdesk.com/setup-or-upload-your-local-project-to-github-using-command-line.htm)to GitHub using faster, easier, and credible.

Downloading GitHub desktop to set up GitHub terminal, we are going to dive deep into the whole process. Sit back and relax because this is going to be fun.

GitHub on the desktop is an efficient way of working.web browsers are mostly unreliable, the desktop app does the trick for you. It is the most efficient toolbox for working with Git repositories.

**New & Updated GitHub Desktop Features**

*Branch off*: They allow you to change and review your code on GitHub right within the app. And select current branches or create a new one.

*Merge and Deploy*: It merges and deploys code right from the app by sending it to the master branch.

*Collaboration Tool*: A Collaboration is made easy. You don't have to leave the app for sharing it with