teleren/devto huggingface dataset:
Increasing productivity in tmux with a single prefix key
Tags: terminal, tmux
Published: 2017-12-05 15:12:36

---
title: "Increasing productivity in tmux with a single prefix key"
published: true
description: How to customize tmux prefix to a single key, and make it even more productive
tags: [terminal, tmux]
cover_image: https://blog.guilhermegarnier.com/images/keyboard.jpg
canonical_url: https://blog.guilhermegarnier.com/2017/12/increasing-productivity-in-tmux-with-a-single-prefix-key/
---
Originally posted in [Guilherme Garnier blog](https://blog.guilhermegarnier.com/2017/12/increasing-productivity-in-tmux-with-a-single-prefix-key/).

[Tmux](https://github.com/tmux/tmux) is a fantastic tool for improving productivity when working with a terminal. One of the first things people configure when start using tmux is changing the prefix key. The default value is `control+b`, which is not very confortable to press with a single hand. And as you'll end up pressing it a lot, for every tmux command, the most common used configuration is changing it to `control+a`.

This is much better, but you still need to press two keys simultaneously before typing any tmux command. After using this configuration for some time, I decided to change it to a single key, to make it even easier.

I though about changing the prefix to `caps lock`. Besides being rarely used, it's very well positioned. However, you can't set `caps lock` as prefix in tmux. An alternative solution is mapping the `caps lock` key to something else. In OSX, you can set it to another modifier key, like `control`, `shift` or `esc`: go to `System Preferences` => `Keyboard` => `Modifier keys`. First I tried mapping it to `esc`, and setting `esc` as tmux prefix. It works, but this setup brought another problem: as a vim user, I use the `esc` key a lot (to alternate between vim modes), so now I had to type `esc`/`caps lock` twice to send the `esc` key to vim. It was ok, but not ideal.

Then I tried another solution: I installed [Karabiner-Elements](https://github.com/tekezo/Karabiner-Elements), a Mac app which allows you to completely customize your keyboard. So I mapped the `caps lock` key to `Home` (which doesn't exist in Mac keyboard), and changed tmux prefix key to `Home`:

```sh
set -g prefix Home
unbind C-b
bind-key Home send-prefix
```

Now I have a great configuration: I use a single key (`caps lock`) as prefix, and without losing any key functionality.
The 'Just' Jar
Tags: collaboration, team, behaviour, estimation
Published: 2017-12-05 10:58:30

---
title: The 'Just' Jar
published: true
description: Changing Behaviour, £1 at a Time, or How to Fund Your Dev Team Xmas Party
tags: Collaboration, Team, Behaviour, Estimation
---

I thought I'd write a quick post to describe one of the little tweaks we recently made to our development process here at [Airfinity](https://www.airfinity.com).

Our dev team works in month long sprints at the moment and we generally take a day to estimate the top of the product backlog as a team, this is then used for a final re-shuffle of priorities by our product owner before we crack on and start building things. Of course things change over the course of the sprint, and we roll with that, the most useful information to facilitate this agility is reasonable estimations of size, complexity and duration.

One of the most common and dangerous words that I have heard when estimating or discussing software features, especially when discussing these with non-technical parties, is the word 'just'.

Many articles have been written on this so I won't bore you with why, if you build things you'll know what the problem is, but for reference two good muses on the topic are [here](https://alistapart.com/blog/post/the-most-dangerous-word-in-software-development) and [here](https://jaxenter.com/the-most-dangerous-word-in-the-english-language-for-all-developers-108018.html).

So to combat our use of the word we set up a swear jar*, or Just Jar^tm as we like to call it. Every time one** of our dev team uses the word just we cough up a pound, the proceeds of this will go towards extra drinks at our Christmas bash. 

It's a fun way to game behaviour and slowly change it, it helps us clarify our thoughts and think through estimation a little more to ensure we allow enough time, and it's fun calling people out. Plus we have about £30 in the jar after our first month, so it's pretty lucrative!


I suggest you give it a try, let me know what you think or how you get on in the comments.


James



*Obviously we still swear every now and then, the odd expletive is ok as long as it's directed at your own code.


** Edit: I should point out that I am possibly one of the worst offenders/highest contributors, but hey you lead by doing right?
TensorFlow to filter PDF files
Tags: tensorflow, machinelearning, python, discuss
Published: 2017-12-05 08:52:32

---
title: TensorFlow to filter PDF files
published: true
tags: #tensorflow #ML #python #discuss
---

Hello everyone,

So I got the idea to filter resumes using Tensorflow but I don't know how to do it o:).. I found some tutorial about training the model to recognize if on the image is dog or cat.

So what I want to do? Training the model with some keywords (let's say some kind of dictionary) -> I want to filter pdf file depend on those keywords and store it different folder.

Any help?
Dark Souls dice stats comparison app, Part 2
Tags: video, fuse, coding, ui
Published: 2017-12-05 08:02:21

---
title: Dark Souls dice stats comparison app, Part 2
published: true
description: Writing an app to compare dice roll stats in the Dark Souls boardgame
tags: video, fuse, coding, ui
cover_image: https://i.imgur.com/ZQzHse6.jpg
---

[View Part 1](https://dev.to/mortoray/dark-souls-dic-state-comparison-app-part-1-4pn)

{% youtube hWCQAlCiRJ0 %}

I continue with the dice role comparison app. I make the items generic, allowing for a modifier to be added. This will allow more expansion later, but more importantly simplifies the UX structure now.

Watch my streams live on [Twitch - Mortoray](https://www.twitch.tv/mortoray)
JUST ME
Tags: beginners, python, node, react
Published: 2017-12-05 03:24:50

---
title: JUST ME
published: true
description: A short introduction
tags: beginners,python,node,react
---

Hi! I'm David, although i love to go by the name **ioedeveloper (internet of everything developer)**.
I think i am in love with **python**, she's easy to understand, saves me a load of work and just gives me that feeling...i think its TRUE LOVE.
I like to flirt with **angularjs** and **nodejs** (shhh...python must not know about this), they make me realise how awesome i am and how much more i can achieve with less effort.
I had a thing with **PHP** for a while, but it just did not work out (it's personal).
I plan on getting to know **react**, they say she's pretty awesome and would make my life a whole lot better.
That's all you should know about me. 
Thanks to @ogwurujohnson for introducing me to this platform.
C++ Array List
Tags: c, arrays
Published: 2017-12-05 03:04:11

---
title: "C++ Array List"
published: true
description: I am trying to solve the algorithm of finding and displaying the largest age in the array. 
tags: c++, arrays
---

I am trying to solve the algorithm of finding and displaying the largest age in the array. This is what I have so far.

    #include <iostream>

    using namespace std;

    int main()
    {
	    int brothers[5] = {6,3,24,12,22};
	    int i = 0;
	    int eldestAge = 0;

	    for (int j = 0; j < brothers[i]; ++j)
        	{
	        	if (eldestAge < brothers[i])
		        {
	        		eldestAge = brothers[i];
		        }
		        else
		        {
			        // do nothing
		        }
	        }

        	cout << "Eldest Age is = " + eldestAge << endl;

	        system("pause");
    }


However the output doesn't display anything except the quote. Please let me know what am I doing wrong.
Show diff when dredd was failed by unexpected body
Tags: dredd, node, cli
Published: 2017-12-05 01:38:44

---
title: "Show diff when dredd was failed by unexpected body"
published: true
description: Show diff when dredd was failed by unexpected body
tags: 
  - dredd
  - node
  - cli
---

If dredd was failed by unexpected body, we can show some message, actual response and expected response on cli. But, diff is not shown on cli then. 

> currently there is no diff, Dredd displays expected response and the real response and leaves it up to the user to do the diff in their head

https://github.com/apiaryio/dredd/issues/765


If you want to show diff, there is a need to insert diff into `transaction.fail` like this(using node).

```javascript
var hooks = require('hooks');
var diff  = require('diff'); // need diff package

hooks.beforeEachValidation(function (transaction) {
    var real     = transaction.real.body;
    var expected = transaction.expected.body;

    if (real !== expected) {
        transaction.fail = diff.createPatch(
            transaction.id + " failed diff",
            JSON.stringify(JSON.parse(real), undefined, 4),
            JSON.stringify(JSON.parse(expected), undefined, 4),
            "real",
            "expected"
        );
    }
});
```

cf: [Failing Tests Programmatically](https://github.com/apiaryio/dredd/blob/master/docs/hooks-nodejs.md#failing-tests-programmatically)



If there is a better way, please tell me how to do it🙂

Thank you.
How do you organize all of your files?
Tags: discuss
Published: 2017-12-04 23:54:08

---
title: How do you organize all of your files?
published: true
description: file organization
tags: discuss
---

How do you organize your files in your computer? In what directories you put your files? How the directory tree looks? How the directories are structured? Do you use any additional software for example for photos and music?

My whole storage is messed up and I will soon have to organize about 1.5TB of my files and I though that it would be a nice idea to exchange some know-how about this. Also, if you're proud with your structure, you can run `tree -d` and share the result.
What are some examples of great contributor onboarding for an open source project?
Tags: discuss, opensource
Published: 2017-12-04 23:01:11

---
title: What are some examples of great contributor onboarding for an open source project?
published: true
description: 
tags: discuss, opensource
---

Looking for some examples of simple, friendly onboarding. I'd love to see examples where the instructions are clear and the community is welcome, but also projects where the technical choices make getting started easier.
My take on Net Neutrality
Tags: netneutrality, internet, centralization, decentralization
Published: 2017-12-04 22:23:24

---
title: My take on Net Neutrality
published: true
description: 
tags: netneutrality, internet, centralization, decentralization
---

https://medium.com/@nikolaevra/net-neutrality-debate-what-if-internet-went-according-to-plan-part-1-c5ee9b2bcc9c
Welcome Thread - v6
Tags: welcome
Published: 2017-12-04 20:50:44

---
title: Welcome Thread - v6
published: true
description: Introduce yourself to the community!
tags: welcome
---

![Hello there](https://media1.giphy.com/media/3ornk57KwDXf81rjWM/giphy.gif)

### Welcome!

1. Leave a comment below to introduce yourself! You can talk about what brought you here, what you're learning, or just a fun fact about yourself.

2. Reply to someone's comment, either with a question or just a hello. 👋 

**Let's go!**
Raynor-Chai
Tags: typescript, javascript, raynor, chai
Published: 2019-01-20 15:20:50

---
title: Raynor-Chai
published: true
tags: typescript,javascript,raynor,chai
canonical_url: https://horia141.com/raynor-chai.html
---

This post is about [raynor-chai](https://github.com/horia141/raynor-chai), a nifty extension/helper for [chai](https://chaijs.com), the JavaScript assertions library. It allows one to use the methods of [raynor](https://github.com/horia141/raynor) to check that certain objects behave in the way you like.

Using it looks something like this:

```
import * as chai from 'chai'
import { raynorChai } from 'raynor-chai'

class User {
    @MarshalWith(StringMarshaller)
    name: string;
    @MarshalWith(ArrayOf(IntegerMarshaller))
    scoresByDay: number[];

    totalScore(): number {
        return this.scoresByDay.reduce((a,b) => a + b, 0);
    }
}

chai.use(raynorChai);

const user = new User();
user.name = 'Raynor';
user.scoresByDay = [10, 20, 30];

chai.expect(user).to.be.raynor(new (MarshalFrom(User))()); // Assertion passes

const badUser = new User();
badUser.name = 'Raynor';
badUser.scoresByDay = [10, 20.5, 30];

chai.expect(badUSer).to.not.be.raynor(new (MarshalFrom(User))()); // Assertion passes
```

Just like raynor it’s supposed to go beyond simple type checking you’d get from typescript and instead focus on deeper properties of objects. It’s especially useful to test that objects constructed as part of a larger processes are the way they’re supposed to be. So if you’re testing your REST API you can use the same entity definitions you’re using in your application code to see that the API does what it’s supposed to do and outputs the things it’s supposed to.

There’s just one release right now, but I’ll try to evolve it as I use it and as Raynor evolves itself.
Pull Requests: a simple workflow
Tags: git, github, contributing, opensource
Published: 2017-12-04 20:19:14

---
title: "Pull Requests: a simple workflow"
published: true
description: 
tags: git, github, contributing, opensource

---

Disclaimer: I’m not a git ninja, and I’m pretty sure a lot of people have written more sophisticated things on this topic. My only qualification is having made a lot of mistakes in the past. 

So in the hope of being useful, here is my take on how to contribute simply and effectively a pull request:

- I git clone __the original repo__. `origin/master` should point to the latest and greatest, not to my soon un-maintened fork
- I hit “fork” on github and add my fork as a remote
- I contribute a failing test that showcase what you have in mind
- I open a pull-request to start the discussion

The discussion can have many outcomes: I may have requested something already possible, or outside of the scope of the project, or it’s a bad idea, or it’s good idea that the maintainers will implement ASAP, or it’s a good idea that I am ready to implement myself. 

Let’s assume the later case. I do the diligent work locally. Days or weeks later, I’m back in the pull request. I have some feedback, very good, I improve my code. 
What then happens especially well-maintained fast-moving projects is that I’m at this point way behind the commit I forked on. At this point I have been stuck in the past by having to do too heavy git gymnastics. (Looking at you git rebase!)

Here is a 4 steps workflow that gets the job done:

- Pull and merge origin/master (reminder: origin is the project’s repo,)
- Resolve conflicts, update things then commit
- `git reset --soft origin/master` then commit again.
- Force push to my repo

The commits at steps 2 and 3 will have the same content, the git history will be clean from the perspective of the maintainers of the project, and the whole thing has the nice feature to be idiot proof.

## TL;DR

Here is my idiot-proof solution for having a clean PR that is  one commit above `origin/main`

```bash
git fetch
git merge origin/main

# if conflicts
echo "resolve conflicts in your IDE"
git commit -a -m "resolve conflicts"
# end if

git reset --soft origin/main
git commit -a -m "⚡️ implement xxx"
git push --force
```
Clicking a Facebook link logs me into another person's account
Tags: security, discuss
Published: 2017-12-04 15:57:30

---
title: Clicking a Facebook link logs me into another person's account
published: true
description: I'm being logged into someone else's Facebook account when I click a link.
tags: security, discuss
---

## Background

Last week I received a forwarded message from my mom's email account.  I approach any "FWD: FWD: FWD: You have to see this!" type of email chain with skepticism. 
 But... I was curious, and I determined that if it looked safe to proceed, I would.  I moused over the "Open Facebook" link, copied the URL, and gave it a close inspection —

`https://www.facebook.com/n/?********************`

I've been around ccTLDs and have seen enough domain spoof tricks that I was confident the link was legitimate.  I decided to check out what she had sent me.

I pasted the link into the address bar, hit enter, and suddenly found myself looking **at my mom's news feed!**  Somehow I had been logged out of **my** account, and had been logged in to **her** account.

I immediately signed out and attempted to recreate this phenomenon, wondering if I was imagining things.  Lo and behold, it worked again — I was logged out of Facebook, now I was logged in as her.

## Technical Notes

- It _does not_ work in an incognito window
- It _does not_ work in a new Chrome "People" instance, even if I start off logged in on my personal account
- It only works in my specific Chrome browser
- It _does_ work if I'm already logged in to my account
- It also _does_ work if I'm signed out of all accounts
- I am 99% confident my mom has _never logged into Facebook_ on this computer

- Here's the forwarded email (personal info removed):
![](https://thepracticaldev.s3.amazonaws.com/i/apcpcwqsyjxr4n76vrs6.png)

- Every clickable link in that email logs me in; but here's the full "Open Facebook" link.  I've removed my mom's email and her friend's user ID for privacy.
`https://www.facebook.com/n/?{mom's-friend}%2Fposts%2F10212496299814942&aref=1511993084134606&medium=email&mid=55f260918c1fcG5af35c4d77cdG55f2652aec4ceG318&bcode=2.1511993084.Abxk5s8psLBCN-Sfxn4&n_m={my-mom}%40{her-domain}.com`

- Here's a GIF.  Please note that I've cropped a few frames and then used a screenshot of FB at the very end for privacy reasons.  Just didn't want my mom's email or random contacts showing up.
![](https://thepracticaldev.s3.amazonaws.com/i/u65giodjwndokoxrtcsr.gif)

## Conclusion

Given that this only works in _my specific browser window_, I'd have to think it's due to cookies or something.  I haven't cleared my cookies/cache, because I want to preserve any useful info before going to that step of the experiment.

**Does anyone know what's going on?**

PS — the video link she evidently wanted to share is that "[slippery stairs](https://www.youtube.com/watch?v=aKPz583WRpQ)" clip that's been going around :)
Where do you keep your code?
Tags: discuss
Published: 2017-12-04 15:34:37

---
title: Where do you keep your code?
published: true
description: 
tags: discuss
---

How do you organise your code on your machine? I don't mean github/bitbucket, but actually on your hard drive?

I always create a directory called "Projects" under my username:

`/Users/seanxe/Projects/`

Inside there i group into various folders:

```~/Projects
  ├── github.com/
  |   ├── username/
  |   ├── username/
  ├── project1/
  ├── project2/
  ├── playground/
  |   ├── js-test-1
```

How do you organise your code?
Technology Stack Dilemma
Tags: mobileappdevelopment, softwaredevelopment
Published: 2018-02-01 14:20:24

---
title: "Technology Stack Dilemma"
published: true
tags: Mobile app development,Software development
canonical_url: https://perfectial.com/blog/technology-stack-dilemma-explained/
---

There is a popular belief that a technology stack can either make it or break it when it comes to building your software product. That before even a single line of code gets written, you need to carefully select a technology stack that is bound to determine your product’s success.

With a wide selection of tech stacks in the development world today, choosing one that works the best for your project might seem like a daunting task. But it doesn’t have to. There are only a few aspects worth factoring in when you are caught in a technology stack dilemma.

## What’s a Technology Stack?

To refresh your memory, a quick overview of what is a technology stack.

![technology stack](https://perfectial.com/wp-content/uploads/2017/12/img1.jpg)

The **technology stack** is a combination of programming languages, frameworks, and tools that developers use to build a web or mobile app. The two main components of any app are client-side (front-end) and server-side (back-end). Each layer of the application is built atop the one below, thus creating a stack.

**Client-side** is everything users see on their screens and where the interaction is happening. The three main technologies in front-end are:

- HTML (the markup language)
- CSS (the stylesheet)
- JavaScript (the scripting language)

**Server-side** is not visible to a user. But its programming languages power the user side and create the logic of websites and applications. Frameworks for programming languages are time savers. They provide vetted implementations of common features (data access, user authentication etc.).

The only challenge is in choosing server side technologies. But is it that tough of a decision? Let’s dive deeper.

## How to Choose a Technology Stack

Choosing a technology stack that will work the best for your project might seem like a real challenge, especially if you are a [non-technical founder](https://blog.pixetic.com/non-technical-founder-ui-ux-design/). The easiest way out would be to rely on your personal preferences or previous experience. But personal preferences are subjective and can lead to wrong decisions. You can only count on it if you have a strong background in web development. Trusting your competitor’s experience or going online to find a myriad of opinions and arguments isn’t a smart choice either. In reality, there are a couple of aspects to be taken into account.


The post [Technology Stack Dilemma Explained for Non-Technical Business Owners](https://perfectial.com/blog/technology-stack-dilemma-explained/) appeared first on [Software Development Company Perfectial](https://perfectial.com).
Variadic functions of Golang
Tags: go
Published: 2017-12-04 15:27:24

---
title: Variadic functions of Golang
published: true
description: The commentary of Variadic functions 
tags: golang
---

# Three dots

Variadic functions can be called with any arguments. Three dots can take an arbitrary number of T(T is same type).

In inside function, it can be used as slice. Aspect of calling Variadic functions, user use very flexible way. Regardless of that the arguments are only one, multiple.
Here is example.
```golang
func sum(numbers ...int){
    sum := 0
    for _, num := range numbers {
        sum += num
    }
    return sum
}
sum(1,2,3) //6
sum([]int{1,2,3}...) //6
sum(1) //1
```

# Syntax is simple

If you created the function which wants to receive any number of arguments. You are better to use it.
There are two ways to resolve this situation.

```
func f(ids []int){
//
}
func service(id int){
    f([]int{id})
}
func service2(id []int){
    f(id)
}
``` 
in `service`, it needs new slice to adjust the arguments of `f`.
It's a little bit troublesome 

Let's use Variadic functions instead of slice.

```
func f(ids ...int){
//
}
func service(id int){
    f(id)
}
func service2(id []int){
    f(id...)
}
```

This time, a slice parameter needs three dots the end of name. It means to apply Variadic parameters.

Variadic functions is not only syntax sugar for taking slice parameters, but also helpless to keep the code base simply, and easy to use functions.
No-code tools to help automate your web development process. 
Tags: webapp, development, webdesign, nocode
Published: 2017-12-04 15:17:23

---
title: No-code tools to help automate your web development process. 
published: True
description:  useful infographics page about no-code tools
tags: Webapp, Development, Webdesign, nocode
---

We have just published a very useful [infographics page](https://zeroqode.com/no-code-tools) about no-code tools which would help you get things done faster and easier. [Building web applications](https://zeroqode.com/), organizing your data online, move data between your apps, test APIs and many other things can now be done without writing a single line of code. Check out [this page](https://blog.zeroqode.com/no-code-tools-that-help-automate-your-web-development-process-fc260f3ec2a1) and let us know your feedback.