teleren/devto huggingface dataset:
Restore Tmux Sessions
Tags: tmux, zsh, bash, terminal
Published: 2020-02-11 12:22:58

---
title: Restore Tmux Sessions
published: true
date: 2019-11-09 00:00:00 UTC
tags: tmux, zsh, bash, terminal
canonical_url: https://tech.serhatteker.com/post/2019-11/restore-tmux/
---

`tmux` is a great tool for "black panel geeks" like me.

For those who don't know [`tmux`](https://github.com/tmux/tmux), it is a
terminal multiplexer for Unix-like operating systems. It enables a number of terminals to be created, accessed, and controlled from a single screen. tmux may be detached from a screen and continue running in the background, then later reattached.

It is really great for handling terminal sessions whether local or remote.

My pain was with `tmux` when I reboot the system my sessions gone. I coded and tried many scripts that I found like below but none of those worked as I expected.

```bash
#!/bin/zsh

SESSIONNAME="script"
tmux has-session -t $SESSIONNAME &> /dev/null

if [ $? != 0 ]
 then
    tmux new-session -s $SESSIONNAME -n script -d
    tmux send-keys -t $SESSIONNAME "~/bin/script" C-m
fi

tmux attach -t $SESSIONNAME
```

Finally found a solution for this pain: [`tmux-resurrect`](https://github.com/tmux-plugins/tmux-resurrect).

## tmux-resurrect

`tmux-resurrect` plugin enables saving and restoring tmux sessions manually.
Even if you like to go one step further there is another plugin
[`tmux-continuum`](https://github.com/tmux-plugins/tmux-continuum). It saves sessions automatically. However I am more comfortable with manual savings.

### Requirements

* tmux 1.9 or higher
* bash
* [Tmux Plugin Manager](https://github.com/tmux-plugins/tpm) (recommended)

### Setup
Add plugin to the list of TPM plugins in `.tmux.conf`:

```bash
set -g @plugin 'tmux-plugins/tmux-resurrect'
```

And Hit `prefix + I` to fetch the plugin and source it.

### Use
You can save sessions with `prefix + Ctrl + s` and restore with `prefix + Ctrl + r`. For sure you can always map these binding to another keys.



All done!
What makes you different? 
Tags: discuss, career
Published: 2019-11-08 23:53:35

---
title: What makes you different? 
published: true
description: Why should a Company/Manager look at you as their best candidate ever? 
tags: #discuss #career
---


Why should a Company look at you as their best candidate ever? 

How do you provide value, to your customers or to your employert?
What Am I Doing?
Tags: codenewbie
Published: 2019-11-08 23:19:18

This is my very first post, so please excuse/advise me if there's room for improvement!

I'm new to programming, and I'm quite new to Python. In the past three years or so I have written a few programs, and really enjoyed doing so, but never truly completed them, mostly due to a lack of understanding.
At the beginning of this year I decided it was time to take it seriously and wrote a plan for the year which involved some small project ideas that would help develop my Python skills. The first mini project was to write an 8-ball program, it was successful and spurred me onto the next project - to write a program for a Rock, Paper, Scissors game. It was going well until I hit a wall where I couldn't figure out how to loop over the game until the player says they don't want to play anymore. Admittedly, I felt like it was a simple task to complete, and the fact that I couldn't work it out on my own meant I could never be a programmer. Wonderful.
So, that was it, the whole plan fizzled out. 

As months went by I read more and more articles aimed at beginners on  coding, software development, and fun things to do in Python, and I realised the urge to quit at the first hurdle, The Fear, is so common. I became inspired to throw caution to the wind and get on with it.

I've been doing this in baby steps; re-start the 100DaysOfCode challenge, be more active on Twitter, sign up to a course, do the course, practice coding, post any of my codes to blogging site for help and to track progress. The last bit has been the hardest for me because The Fear creeps it's way back in, "what if this code is rubbish? What if I'm using this function in the wrong way? I don't have a background in computer science or software development! I never even understood basic algebra!! I feel so exposed!!!"
But, as I'm sure we all know, you won't know unless you try.

With regards to my level of Python skills, I know the basics; common data types, variable assignment, lists, dictionaries, loops. With these basics, I've written some fun things like a machine learning model that works with Spotipy, a code that works with a Google Maps API, and, as mentioned earlier, games like Rock, Paper, Scissors. However, I haven't taken the time to understand what's going on to make these things work.

So, I have a plan, and this is it; I'm going to start a series called "Three Things To Do".
The aim is to write a Python program that will prompt me every morning to record three things I want to achieve that day (one major, two minor), and prompt me again in the evening to record which tasks were achieved.
With help from [the course I'm taking](https://www.udemy.com/course/complete-python-developer-zero-to-mastery/), and the community, the long-term goal is to develop this program as I go along, to build on the initial idea with whatever new Python skills I learn, week on week, starting this week.

Cool.
How i succeeded with my team.
Tags: productivity, career, discuss
Published: 2019-11-08 22:58:03

Today i'm writing my first post here to tell you how i succeeded and how you can succeed too! making your daily routine more productive you can achieve anything you have in mind.

It all started in the summer, 2 years ago, when i was writing an essay about continuous integration for the college with my best friend and university partner, he told me: "¡Hey!, ¿why don't we use your programming, writing and communication skills and my graphic design and marketing skills to let the world know that we want to make the change and deliver our own solutions in this digital era?" and that left me thinking for a while, so, i decided to listen to him and we started our brand new business: 'Digital Solutions Argentina', after thinking a lot for a name and a slogan, designing a logo and trying to stand out in social media, we finally did it! we had our initial business brand done, so, now what? and that was our blackout in the business world, we didn't knew what to do afterwards, so i started learning a lot about sales and marketing on my own and i was my own community manager, with all the work that i had to do plus this entrepreneurship i was totally exhausted, but that didn't stop me! i knew that i've put a lot of hard work into that so i didn't want to lose what i had already obtained, so i made myself a morning routine, a todo list for everyday of the week and a good work schedule that didn't made me lose time to finish my college assignments, and after all that here i am, we have a lot of work everyday, we did very good projects and right now we are about to do something bigger! so if i could you can too.

And that's about it, if you have something in your mind that you know it will change the world, just do it, fear is always with you but when you learn to overcome fear and enjoy what you are doing everything goes very well.

¿Do you have an entrepreneurship? tell me in the comments, have a good day/afternoon/night and thanks for reading my post, regards.
Angular 9 Router Tutorial – Configure Routing & Navigation
Tags: angular, angular98, routingnavigation, configureroutingnavigation
Published: 2020-02-07 09:08:14

---
title: Angular 9 Router Tutorial – Configure Routing & Navigation
published: true
date: 2019-11-08 21:43:06 UTC
tags: Angular, Angular 9/8, Routing Navigation,  Configure Routing & Navigation
canonical_url: https://www.positronx.io/angular-router-tutorial/
---

The post [Angular 9 Router Tutorial – Configure Routing & Navigation](https://www.positronx.io/angular-router-tutorial/) appeared first on [positronX.io](https://www.positronx.io).

**In this Angular 9 router tutorial, we will learn how to enable routing & navigation service in an Angular app. Routing allows users to navigate between one component to another component based on action taken by the user.**

Routing is a mechanism in modern web or mobile applications, be it single-page applications, progressive web applications, or mobile apps. A user can fetch content in the view based on the component a user wants to navigate. It can also be directly done by using the route URL in the browsers.

[click here to read more](https://www.positronx.io/angular-router-tutorial/)
The Self-Aware Developer
Tags: career, inclusion, eq, selfaware
Published: 2019-11-08 21:35:02

The hardest part, it seems, about being a developer or an expert in the tech space is being self-aware.

The various DevOps, Front-end, Back-end, Security, and SRE communities I’ve been exposed to consciously or unconsciously reinforce the principle of “you’re doing it wrong”.

Even more, once you’ve been in the game for awhile and begin speaking at conferences, you fall into the same trap of telling others that they may be “doing it wrong”.

All of this one-way communication, either top down or bottom up, creates a void in a key element towards developing exceptional emotional intelligence.

That element is self-awareness.

## What is self-awareness?

Self-awareness is your ability to recognize and understand your emotions as well as your power to control them. It is foundational to your personal growth and success.

It may sound touch-y feel-y, but a lack of self-awareness is catastrophic. It can not be solved through an algorithm or new language.

Emotion is one of those things that is uniquely human. Whether you admit it or not, handling your emotions are the most important factor to holding you back or accelerating you forward towards your goals.

How many times have you been around another person and been shocked when they criticize someone else for behavior that they themselves have exhibited?

A lack of self-awareness tells others (your team, your boss, your colleagues, potential investors, etc.) that you are unprepared for bigger things, that you have a blind spot that you are unable to fix, and that you are unwilling to invest in yourself.

Who would want to follow, promote, or invest in that person’s idea?

## Your Assumptions as a Dev

The first step to becoming more self-aware, and ultimately becoming more emotionally intelligent, is taking inventory of your assumptions. 

Continue reading on [EQ for Devs](https://eqfordevs.substack.com/p/the-self-aware-developer)...
IntelliJ style line duplication in Visual Studio Code
Tags: vscode, intellij, editor, tutorial
Published: 2019-11-08 21:33:42

Whenever I can, I use VSCode in favour of IntelliJ. It's more lightweight for my needs and more pleasing UX-wise as well.

But until now I really missed one thing from IDEA: the line/highlight duplication mechanism.

In IDEA there are two ways to duplicate code:
1. Put the cursor somewhere and hit `Ctrl + D`. This will duplicate to down the active line
2. Select a text and hit `Ctrl + D`. This will duplicate to right the selection

VSCode didn't have the second method but [just until now](https://code.visualstudio.com/updates/v1_40#_duplicate-selection)!

Now you can create keyboard binding with `editor.action.duplicateSelection` action, and after adjusting some conditions it acts like the IntelliJ.

See the following `keybindings.json` file snippet:
```json
{
  // ...

  { "key": "ctrl+d", "command": "editor.action.copyLinesDownAction",
      "when": "editorTextFocus && !editorReadonly && !editorHasSelection" },
  { "key": "ctrl+d", "command": "editor.action.duplicateSelection",
      "when": "editorTextFocus && !editorReadonly && editorHasSelection" },

  // ... 
}
```
As you can see there only difference between the `when` properties is a negation before `editorHasSelection` - if there is no text selected, work as previously, but if there is one, just copy the selection.

Because I switch between IDEA and Code regularly I often hit the combination in the wrong editor, but from now on, this will work as intended everywhere!

🎉
Day 30 : Barricade
Tags: hiphop, code, coding, lifelongdev
Published: 2019-11-08 21:33:11

_liner notes_:
- Professional : Woke up feeling no too well. Felt like there was a barricade between me and getting what I wanted to get done. Had a hard time really focusing. I'll probably get the stuff I wanted done over the weekend if I feel better.

- Personal : Since I wasn't feeling to well. Pretty much did my laundry and stayed in bed. The weather has been pretty overcast and chilly. Really hope I'm not getting sick. Still have to put together the radio show tomorrow. Going to rest up some more.

![A creek in a forest in Dolni Sokolovec, Czech Republic](https://thepracticaldev.s3.amazonaws.com/i/yachze6le23ql891lx9m.jpg)

This weekend, I don't really have a lot going on so I'll be able to focus on resting up and fight off getting sick. I'd like to have a base Sapper app up and running and play around with it.

Going to lay down. haha

Have a great weekend!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube sEX8PedezSE %}
When I go Inside
Tags: universe, creativewriting, collective
Published: 2019-11-08 21:15:55

When I Go Inside

I see the universe, expansive and inclusive 

When I go inside I see the vast openness of space, encompassing all as one

When I go inside I see ever changing bodies in motion, moving infinitely around 

When I go inside I see landscapes and oceans, shifting with moon and tide and rain and sunshine

When I go inside I see beings of light, so radiant and collective yet individual

When I go inside I see landscapes and oceans, shifting with moon and tide and rain and sunshine

When I go inside I see ever changing bodies in motion, moving infinitely around 

When I go inside I see the vast openness of space, encompassing all as one

When I go inside I see the universe, expansive and inclusive

When I go Inside
Happy Decaversary Golang!
Tags: go, silly
Published: 2019-11-08 19:52:20

---
title: Happy Decaversary Golang!
published: true
description: 
tags: golang, go, silly
cover_image: https://thepracticaldev.s3.amazonaws.com/i/pthhkq8seq92konofxgm.jpg
---

I have never used Golang, but peers who've used it speak very highly of it, and I'm excited about a modern compiled language that scales so well for so many use cases.

Today is Golang's first [double digit birthday](https://blog.golang.org/10years), and [Renee French](https://www.instagram.com/reneefrench/) (the original Golang Gopher creator) has made a drawing in celebration of the event, and it made me smile wide at the cuteness on this gloriously cold NYC Friday. 

Hope it brightens your end of week too!

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/jm1jcnidwp874gioim7b.jpg)
How to keep those darn tabs open
Tags: vscode
Published: 2019-11-08 21:13:40

I know you have done it. You're spelunking through the code trying to find that one function with that one bug and you find it! VSCode shows you the file of interest in _preview mode_.

Of course, it's so simple and if I just check to make sure it works with what I'm working on. <clicks back to your other file>. 

Then... gone. That file you spent so long trying to find was opened in preview mode and now you have to search again to find it. I know it's happened to you. Make it stop by setting both of these to false (or unchecking)

1. `workbench.editor.enablePreviewFromQuickOpen`
1. `workbench.editor.enablePreview`

Search and keep your context. Live long and prosper.
#AskAndroid Series
Tags: android, coroutines, kotlin, google
Published: 2019-11-08 20:40:30

Android Dev Summit 2019 was definitely a nice conference that was full of many technical concepts. If you an Android Developer and you haven't watched them yet, please do. It mustn't be all just pick what interest you.

###AskAndroid was a live Q&A session via twitter and Livestream on Youtube. I will be writing a blog series of videos that are available in the Videos.

First up is #AskAndroid at Android Dev Summit 2019 - Kotlin & Coroutines on Android.

https://www.youtube.com/watch?v=zbYYoL7vo9Y&t=190s

Blog coming next 🔜
C# 8.0 static local functions
Tags: csharp
Published: 2019-11-08 20:22:25

Here is a quote from the offical microsoft docs...

https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/local-functions
*Starting with C# 7.0, C# supports local functions. Local functions are private methods of a type that are nested in another member. They can only be called from their containing member.*

Basically you can define a method inside a method.  Your inner method can only be called by the parent method.  They are, by definition, private and the compiler won't let you put an access modifier on it.   As stated, this was added to C# in v7.0.   The docs have a simple example which i have added a few lines to.  I've marked thew additional lines with ******...

```c#
using System;
using System.IO;

namespace MyConsoleApp
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello Stackathon readers!");

            Console.WriteLine(GetText("C:/Temp/Sample Files/simple", "company.csv"));

            Console.Read();
        }
        private static string GetText(string path, string filename)
        {
            var methodVariable = "methodVariable set at the top of GetText method";  // ******
            var sr = File.OpenText(AppendPathSeparator(path) + filename);
            var text = sr.ReadToEnd();
            Console.WriteLine(methodVariable);  // ******
            return text;

            // Declare a local function.
            string AppendPathSeparator(string filepath)
            {
                methodVariable = "methodVariable set inside AppendPathSeparator method";  // ******
                if (!filepath.EndsWith(@"\"))
                    filepath += @"\";

                return filepath;
            }
        }
    }
}

```

The lines I've added are to prove a point.  I've defined a variable called methodVariable inside the parent method.  I've then modified the value of methodVariable inside the local method.  Finally I've writen the value to the console.  Running this will output "methodVariable set inside AppendPathSeparator method".  Basically, our local method has the context of the parent method - it has full access to all the variables in the parent.  This is a potential vector for bugs.  Well, C# 8.0 has us covered with static local methods.

```c#
static string AppendPathSeparator(string filepath)
{
    methodVariable = "methodVariable set inside AppendPathSeparator method";  // ******
    if (!filepath.EndsWith(@"\"))
        filepath += @"\";

    return filepath;
}
```

Putting static in front of our local method isolates the local method from accessing variables from the parent methods context.  The code above won't compile because the local method doesn't know what methodVariable is.  It's also worth pointing out that our local method does have access to any static members of the Program class.

This isn't going to change the world but it's a nice little feature added in C# 8.0.
Learning about how to connect a Database 
Tags: database, sql, python, beginners
Published: 2019-11-08 20:05:21


<p> Hey everyone, I've been sort of a long time lurker on this site, but felt like actually making a post today.<p>
<p>My question: <i> I have been a hobbiest developer for the past year or so and I would like to learn more about how to use databases within my programs. Does any one have good resources from which to start? </i> 
<p>I've studied SQL a bit and feel sort of comfortable with the syntax, but the whole process of connecting it in a program baffles me. I never seem to get it to work. I'm currently trying to learn python at the moment. </p>
<p> I have taken a look at resources through out the web of sort of starting points to learn this skill, but thought I would ask this community to see if any one has any resource that has helped them out in regards to this area. Thanks for taking the time to read this </p>
Quick question- what happens when you push an array into itself? 
Tags: javascript, arrays
Published: 2019-11-08 18:56:23

So today I was working on something that I had to push a value into an array, but I mistakenly pushed the array itself into itself 🤫🧐🤫. How more confused could that be... 

But then the result was stunning as I wondered what I had done wrong. 
The script returned an array of arrays which seems to be infinite. 

An array inside an array inside an array... continuously. 

Just as that was strange, but it was interesting to see what was happening there. 

However I still don't understand how that happened. So I'd be glad if anyone can explain or give me a hint what happened.
Created a handy JavaScript Label creator
Tags: html, css, javascript, webdev
Published: 2019-11-08 18:49:59

So recently a friend requested a label creator like that of the popular CSS framework- Bootstrap, semantic etc. I remembered I had started working on something like that few days ago, this prompted me to finish it up for him and others who might need it. 

This post isn't really about the tutorial on how I made it, but just to share my source code and if anyone is interested for tutorial post, I'd gladly great standard one.
See the preview below along with the GitHub repo;

 This can be helpful for anyone here. Feel free to use.



Preview: https://jeffersoniyobosa.github.io/JavaScript-Label-tags-creator/

View code: https://github.com/JeffersonIyobosa/JavaScript-Label-tags-creator

Pull: git@github.com:JeffersonIyobosa/JavaScript-Label-tags-creator.git

Redesigned it from scratch, no plugin, just HTML CSS and vanilla JS. 

I hope you find it useful. 🙌🏼
Do leave a 🌟 star 😁
Angular10 Qrcode generator library lightweight 
Tags: angular, qrcode, angular10, ngqrcode
Published: 2019-11-08 18:34:21

# an-qrcode
`an-qrcode` is Angular6-10 QR Code library to generate QR Codes in Angular 6/7/8/9/10 app.

## Demo App

You can find demo app here 
[github.com/naimmalek/an-qrcode-sample-app](https://naimmalek.github.io/an-qrcode-sample-app/).

npm url [an-qrcode](https://www.npmjs.com/package/an-qrcode)

## Installation

```
# Angular 6/7/8/9/10
npm install an-qrcode --save
```

## Basic Usage

### Import the module and add it to your imports section in your main AppModule:

```
// Main Module File: app.module.ts
import { AnQrcodeModule } from 'an-qrcode';

@NgModule({
declarations: [
  AppComponent
],
imports: [
  AnQrcodeModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
```

## Examples: an-qrcode

### Generate a QR Code from a string

here is sample code for generate qrcode

```
<qrcode [level]="1" [qrvalue]="'QR Code String'"></qrcode>
```


## Parameters

| Attribute        | Type           | Default | Description  |
| ------------- |-------------| -----|------------|
| level | Number | 1    | QR ECC level (1, 2, 3, 4) |
| qrvalue      | String | '' | Your String |
| width      | Number | 200     | Width (any value) |
| height      | Number | 200     | Height (any value) |


[Naim Malek (naimmalek.github.io)](https://naimmalek.github.io/)