teleren/devto huggingface dataset:
MongoDB ransoms in 2017
Tags: 100daysofcode, security, mongodb
Published: 2017-01-18 08:24:53

---
title: MongoDB ransoms in 2017
published: true
description: A lack of common sense in data security 
cover_image: 
tags: 100daysofcode, security, mongodb
---

You've almost certainly heard the news of the [MongoDB ransoms](https://nakedsecurity.sophos.com/2017/01/11/thousands-of-mongodb-databases-compromised-and-held-to-ransom/) that are going on. It's been a long time coming, and there's no reason for it at all.

We learnt a long time ago that it's completely unsafe to have workstations on the internet without some form of protection. Essentially, you need a firewall to keep your desktop or laptop safe.

It's also old knowledge that you should have separation of your front and back end systems. 

Finally, it's common sense that your data is the single most important part of your company.

From this, I find it ludicrous that the databases a) aren't backed up, and b) aren't secured.

Backups are essential. If the data isn't backed up it might as well not exist. What's more, backups are only as good as the last time they were successfully restored. So, if you don't make backups And test them, you might as well not have the data in the first place.

This gets you to being able to get your data back, but it doesn't stop the bad guys getting their hands on it too. For that, you need to stop them getting into the database in the first place. This means a firewall and decent authentication. The database server should never be externally accessible - ever. If you need admin access, use a VPN. Simple as that.

The really ludicrous part of this is - if I understand it correctly, MongoDB supports authentication by use of x.509 certificates. This means that an attacker would need not a username and password - that can be brute forced - but an SSL certificate that is correctly signed. These are significantly more difficult to crack - to the point that if someone can reliably do so, MongoDB is the least of our worries.
The Marvelous Misadventures Of My Career: Pilot
Tags: life, career, somesmoothsailing
Published: 2017-08-16 18:11:15

---
title: "The Marvelous Misadventures Of My Career: Pilot"
cover_image: http://s2.storage.akamai.coub.com/get/b119/p/coub/simple/cw_timeline_pic/ffb5c5d3834/60cd9b5e04966a911f64a/big_1474006815_image.jpg
published: true
description: The Marvelous Misadventures Of My Career, Ep.0
tags: life, career, some smooth sailing
---
Before I got the current job that I love, I faced many interesting trials, mishaps and failures. The journey was filled with undulations, existential crises and imposter syndrome experiences.

While still back in university, a friend of mine sent me an SMS explaining an internship being offered at the university and it dealt with software development. At the time I was at home recovering from the cramming of exams. I read his text and rushed off to the place. It was a startup that built health solutions with a Health NGO. My friend and I were hired. It was fun, rigorous and engaging building IT health solutions that were actually being used on the ground in rural areas. I could see my tech skills building. The director of the NGO encouraged openness, hard work and growth. He always did his best to light up the place when he came to the office. This internship went on for a year and later it became a job after our final year. Just after graduation, the Health Solutions NGO decided to change things up a bit and offer us a paid master scholarship. Some of my friends jumped on the idea but I had none of it. I wanted to develop solutions not be in class. Plus I had already taken a diploma and degree in the same university. I needed a break. So I rejected the offer and one lecturer had a sit down with me explaining why taking a masters now is important and all that paraphernalia. I knew he was pushing the university’s agenda to have as many people in the newly made masters programme. They way he presented the programme was like we should either take the masters or take the masters. I looked the other way, and a good job was dropped by my hand. But I was determined to get a new job.

Tune in for Ep.1: [Ghost Software Development](https://dev.to/hawicaesar/the-marvelous-misadventures-of-my-career-ep1-ghost-software-development)
Hi, I'm Dave Ceddia
Tags: introductions
Published: 2017-08-16 15:36:42

---
title: Hi, I'm Dave Ceddia
published: true
description: My introduction post
cover_image: 
tags: introductions
---

Looking through my drafts I realized I never published my intro, so hey! Here it is.

ðŸ‘‹ I'm Dave :)

I have been coding for something like 10 years professionally, and probably more like 20 years total.

I mostly program in JavaScript right now, and in the past I've worked with Ruby and Rails, Java, C/C++, and a few others.

A couple years ago I started writing a [blog](https://daveceddia.com), initially about Angular, but now focused on React. And then a year ago I wrote a [book](https://daveceddia.com/pure-react/) that teaches React.

I live near Boston, MA. In my day job I'm building UIs with React.

I am currently learning more about Elixir + Phoenix, and getting more into functional programming. Modern JS + React has really changed my mind about FP. Turns out it's not just for university classes ðŸ˜„

You can find me on Twitter as [@dceddia](https://twitter.com/dceddia)

Nice to meet you.
What apps, software, or tools do you use and why?
Tags: discuss, tools
Published: 2017-08-16 03:47:09

---
title: What apps, software, or tools do you use and why?
published: true
description: application, software or tools used to program or stay productive or you find useful.
tags: discuss,tools
---

What are some of your favorite/useful/recommended application, software or tools used to program or stay productive or are just plain awesome.
How I chose my Code Editor
Tags: codeeditor, beginners
Published: 2017-08-16 03:13:43

---
title: How I chose my Code Editor
published: true
description: The text editor is your main weapon. Choose the right one is the key.
tags: code editor, beginners
cover_image: https://thepracticaldev.s3.amazonaws.com/i/ktaf6t0wptr218g8p5z1.png  
---
## My first love

I'm a student and as such, I'm always looking for what's best for learning. The first time I wrote .html, I used [Notepad++](https://notepad-plus-plus.org/download/v7.5.html), great and small but very powerful editor. I really love it but has limitations. So why I used it? Because my notebook was a Sony Vaio Win7-Starter 32-bits with 2GB RAM. Power wasn't a great stuff and Notepad++ was the perfect option.

## My second love (and the lover)

Eventually, I moved on to a bigger laptop and instead of looking for the old code editor, I was making a course in Coursera and saw the instructor used [Sublime Text](https://www.sublimetext.com). I downloaded and loved it. Beautiful and light, *what a powerful combination!* I said to myself, still love it. 

Later that year, when I sign up at Github something called my attention: a code editor made by Github team, let's give it a try I said and it was so beautiful, I was willing to forget Sublime and move on with my life. I'm still running [Atom](https://atom.io) for certain projects directly related to Github but, again life is strange and I switched again.

## My current(s) Code Editor(s)

I started FreeCodeCamp and saw this show -Daily Programming- where the developer worked in some kind of cool themes and where I fall in love with Atom was in those times. My love with Atom was certain, secure, rock solid...or that was my thoughts.

I started to talk beautiful things about Atom and how cool was to work with it until a friend appears from nowhere and introduce in my life [Visual Studio Code](https://code.visualstudio.com/). Don't get me wrong, I love Atom and Notepad++ (yes, not so fan of Sublime, sorry not sorry) but VSC is a thing from another world. I really (REALLY) like to work with it and is lighter than Atom and have all the cool stuff Atom has and...I can't decide until today which one is my code editor.  

## Decide what's the best thing for you

Until today, I don't know what is going to be my last choice but one thing is certain: you have to decide what's best for you, regardless what people and reviewers and YouTubers and other devs tell you. This is not a direct advice from me, it's an opinion built with many errors and bugs. The most secure thing is that I'm mistaken.

### I would like to know your Code Editor history
Be one of the first to use THE NEW developer platform built for agile teams! https://www.pipefy.com/developers
Published: 2017-08-15 22:02:35

---
title: "Be one of the first to use THE NEW developer platform built for agile teams! https://www.pipefy.com/developers"
published: true
description: "Be one of the first to use THE NEW developer platform built for agile teams!
Track stories in burndown charts, integrate natively with Slack and GitHub, and plan sprints in a platform designed for software developers like you."
tags: 
---
Welcome Thread - v2
Tags: welcome
Published: 2017-08-15 17:14:48

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

Hey there! Welcome to dev.to!

![Magician dog waving hello with wand](https://media.giphy.com/media/3o6ZtpxSZbQRRnwCKQ/giphy.gif)
<figcaption>`var developer = magician`

Our [last welcome thread](https://dev.to/thepracticaldev/welcome-thread---v1) was even better than the first. It's gotten a bit long again though. Let's get this started one more time!

Please introduce yourself to the community! You can start by sharing your favorite programming languages, what you're interested in learning next, or your latest and greatest side project. No rules, just make yourself at home! ðŸ˜€

Leave a comment below to introduce yourself! âœŒï¸

Also, here's a random question to get you started:

> What's your favorite project that you've worked on?
O means open. Simple CLI tool to open repository in browser.
Tags: bash, cli, git, github
Published: 2017-08-15 16:27:26

---
title: O means open. Simple CLI tool to open repository in browser.
published: true
description: Simple CLI tool to open repository in browser.
tags: bash, cli, git, github
---
Here is my small bash function! When you run it from the terminal it opens the GitHub/BitBucket/GitLab page in your browser for the git repository you are currently in. It has a short simple name `o`. I find myself doing this quite a lot as I am working with multiple repositories at the same time and switching to a browser, searching for correct link, etc.

Just type `o` :)

### How to install

```
curl https://raw.githubusercontent.com/plutov/o/master/install.sh | sh
```

### Contribution

I have a plan to improve it to support remotes with usernames inside, and to support custom Git remotes. If you have more ideas you're welcome on [this GitHub page](https://github.com/plutov/o/).

[Original post in my blog](http://pliutau.com/o_simple_cli_to_open_repo_in_browser/)
Elixir Pattern Matching in a nutshell
Tags: patternmatching, development, elixir, coding
Published: 2018-06-08 07:58:18

---
title: Elixir Pattern Matching in a nutshell
published: true
tags: pattern-matching,development,elixir,coding
canonical_url: https://engine.expert360.com/elixir-pattern-matching-in-a-nutshell-d7188ac68912
---

![](https://cdn-images-1.medium.com/max/549/1*dFrM0yAq52YuJ4FzfHG_tA.jpeg)

Before being introduced to [Elixir](http://elixir-lang.org), a functional programming language built on top of [Erlang](https://www.erlang.org/), I had no idea what pattern matching was. Hopefully, by the end of this article you will have at least a rudimentary understanding of how awesome it is.

In most programming languages, you will assign a value to a variable using something like:

```
const myVariable = 'my value';
console.log(myVariable); // 'my value'
```

Now, myVariable is bound to the value you assigned to it and you can continue living your life.

When you need to check the value of a variable, in most other languages you would use conditional “if statements”, which can get unreadable as soon as you add more than 2 or 3. This is because it’s difficult to see the flow of logic, especially if the function spans many lines.

Technically you can do the same thing in Elixir, but how the compiler interprets it is significantly different. The = sign is actually called the ‘match’ operator. It will use the value on the left and compare it to the value on the right to determine if they are a match.

Tuples are used frequently in Elixir code to enable returning multiple values from a function. Typically, you would come across a {status, value} tuple, for example:

```
{:ok, return\_value} = do\_stuff()
```

do\_stuff() must return a tuple which matches that structure (otherwise Elixir will raise a ‘MatchError’), and return\_value is now bound to the second item in the tuple returned from this function.

This is basically how pattern matching works, but the real beauty is how you use it in various contexts, for example:

- When a function can return multiple values, such as the {status, value} tuple we came across earlier:

```
case do\_stuff() do
 {:ok, value} -> value
 {:error, \_} -> raise "Oh no!"
end
```

- In function heads you can pattern match on parameters, to only run when particular requirements are met:

```
def my\_func({:ok, value}), do: value
def my\_func({:error, \_}), do: raise "Oops!"

IO.puts my\_func({:ok, "hello"}) # "hello"
```

- You can even match on lists:

```
[first, second, third] = [1, 2, 3]
```

- And decompose data structures

```
%{value: value} = map\_func()
```

There are so many examples of pattern matching in Elixir because it’s incredibly useful and powerful, and also very performant when compared to traditional methods.

In a nutshell, that’s pattern matching!

* * *
What is RxJS when seen from a mile away?
Tags: javascript, rxjs, reactiveprogramming, learning
Published: 2017-08-15 08:23:18

---
title: What is RxJS when seen from a mile away?
published: true
description: Short description of RxJS and its uses seen without detail
tags: javascript, rxjs, reactive programming, learning
---

Say I move my mouse on a website and every location in the path is collected and stored in an array. By the end of the visit, you have a huge array with the entire path my mouse took while I was visiting your website. 

Now let's say that I have access to that data in real time, as the mouse is moving across the screen. You can see this information as a *stream* of data that at any given time, it tells you where my mouse is. 

Now that have access to a *stream* of data, we just need to do something to *react* to this stream (aka, do something every time a new mouse movement is recorded).

To keep this simple, we will just log to the screen what the X and Y coordinates of the mouse are on the website.

In RxJS, it looks something like this:
```javascript
//The *stream*
const mouseMovement$ = Rx.Observable.fromEvent(document, 'mousemove');
//The *do something with it*
mouseMovement$.subscribe(position => console.log(`(${position.cilentX}, ${position.cilentY}`));
```

Great! But... can't we just do this with event handlers?

Well...

```javascript
document.body.addEventListener('mousemove', (event) => {
	console.log(`(${event.clientX}, ${event.clientY})`);
})
```

In this simple case, yeah - and it's quite simple too... But then what if we want to modify the information before we handle it:
```javascript
//I want the distance from the center of the page
const mouseMovement$ = Rx.Observable
    .fromEvent(document, 'mousemove')
    .map( event => {
        const posX = event.clientX - document.body.clientWidth/2;
        const posY = event.clientY - document.body.clientHeight/2;
        return Math.sqrt(posX*posX + posY*posY);
    });
//The *do something with it*
mouseMovement$.subscribe(radius => console.log(`Radius: ${radius}`));
```

Or want to limit how often we get information from the stream:
```javascript
//I want to know where the mouse pointer is 2.5 seconds and not more often than that
const mouseMovement$ = Rx.Observable
    .fromEvent(document, 'mousemove')
    .debounceTime(2500);
//The *do something with it*
mouseMovement$.subscribe(position => console.log(`(${position.cilentX}, ${position.cilentY}`));
```

RxJS makes is easy to do actions *over time* over the information we get at different points in time. When we see everything as a stream of data we want to do something with over time, RxJS starts to make more and more sense. 

In my next post, we will make a typeahead using RxJS! Since I am writing this as I am learning it, the post will be with some mistakes I make in the process. *[Oh hey here is the post!](https://dev.to/sammyisa/rxjs-in-practice-how-to-make-a-typeahead-with-streams)*

---
*Thank you [Toolsday](https://twitter.com/toolsday) podcast for the inspiration and [davidkpiano](https://twitter.com/DavidKPiano) for the help!*
Poker 3 Mechanical Keyboard for Mac
Tags: macos, tools, mechanicalkeyboard
Published: 2019-04-07 13:55:14

---
title: Poker 3 Mechanical Keyboard for Mac
published: true
tags: MacOS, Tools, mechanical keyboard
canonical_url: https://kaspars.net/blog/poker3-mac
---

Recently I got my first mechanical keyboard [Poker 3 with the Cherry MX Brown switches](https://kaspars.net/go/poker3-keyboard). Here is how I configured the keyboard to match the familiar Mac layout:

[![Mac Layout for Poker 3 Mechanical Keyboard](https://kaspars.net/wp-content/uploads/2017/08/poker3-mac-layout-800x280.png)](http://www.keyboard-layout-editor.com/#/gists/a7fa3da73ef9361789d91a34bd8cb4d4)

- Use `FN`, `PN`, `Ctrl` and `Shift` as arrow keys. You’ll have to learn to use the left `Shift` for capitalising letters which I’m still getting used to.
- Map `CapsLock` to `FN` because `FN` is now the left arrow key.
- Map left `Alt` to `Command ⌘`.
- Map left `Win` to `Option ⌥`.

## Keyboard Layers

The keyboard has three programmable layouts or layers. I’m using layer 3 (red LED) to store this configuration. Use `FN` + `>` to switch to layer 3. Note that the default layer 1 can’t be configured.

## Enable the Arrow Keys

Next we want to turn `CapsLock` into `FN` because `FN` will become the left arrow key. Switch the 3rd dip switch on the back of the keyboard to enable this.

Press left `Win`, `Space` + right `Alt` to turn right `FN` (left), `PN` (down), `Shift` (up) and `Ctrl` (right) into permanent arrow keys. Please note that this setting isn’t preserved between keyboard reboots.

## Swap Win/Cmd and Alt

Finally we need to switch the left `Win` and `Alt` keys to match the Mac layout where the `Win` or `Command` keys are right next to the spacebar. Enter the programming mode by pressing `FN` + right `Ctrl`:

- Press `Alt` then `Win` then `PN` to set the `Command` key.
- Press `Win` then `Alt` then `PN` to set the `Option` key.

I used this [Pok3r layout guide](https://github.com/davidjenni/pok3r-layouts) for reference.
Changing electron app icon
Tags: electron, icon
Published: 2017-08-15 07:04:14

---
title: Changing electron app icon
published: true
description: 
tags: electron, icon
---

Original post https://github.com/onmyway133/blog/issues/66


### Generate icns

- Generate `.iconset`
- Run `iconutil -c icns "Icon.iconset"`. Note that icon names must be first letter lowsercased

![icns](https://user-images.githubusercontent.com/2284279/29305228-da1a8560-8197-11e7-8826-6a278157abf2.png)


### Use icns

- In `main.js`, specify `icon`

```js
win = new BrowserWindow({
  width: 800, 
  height: 600,
  icon: __dirname +  '/Icon/Icon.icns'
})
```

You can also use helper url methods

```js
const path = require('path')
const url = require('url')

const iconUrl = url.format({
  pathname: path.join(__dirname, 'Icon/Icon.icns'),
  protocol: 'file:',
  slashes: true
})
```

### If app icon is not updated

- I get a problem that electron always shows default app icon. I tried using `png`, `NativeImage`, different icon sizes but still the problem
- Go to `node_modules -> electron -> dist`, right click on `Electron`, choose `View Info`
- Drag another `icns` into the icon on the top left

![info](https://user-images.githubusercontent.com/2284279/29305340-83c8d058-8198-11e7-8057-742f904e2c1c.png)

### Release with `electron-packager`

- `icon` must be specified with `__dirname` (we already did) for `electron-packager` to pick up correct icons
Becoming a Better iOS Developer Through Tooling: My AltConf 2017 talk
Tags: ios, swift, conference, feedback
Published: 2017-08-15 02:56:47

---
title: "Becoming a Better iOS Developer Through Tooling: My AltConf 2017 talk"
published: true
description: Some notes about a recent presentation I had the honor to give at AltConf 2017.
tags: ios, swift, conference, feedback
---

The fine folks at Realm have now uploaded the remaining videos from AltConf 2017 — including the presentation that I gave there.
​
You can watch it a Realm Academy, [here](https://academy.realm.io/posts/altconf-2017-oscar-swanros-better-ios-tooling/).
​
Presenting in the US for the first time was a really exciting experience for me — and something that I'm going to push myself to do more of. I really loved the rush of being there presenting in a foreign country on a foreign language. 
​
I'm gonna call this one a victory — although I know there's some stuff in the presentation that could've used a little more polishing, I'm quite happy with how everything turned out. 
​
What's nice about this, is that I can now watch myself with a calm head and take notes of things that I can improve for future conference talks in the US or around the world.
​
**I'd really appreciate any constructive feedback you share with me about this presentation.** Hit me up at [oscar@swanros.com](mailto://oscar@swanros.com?subject=AltConf%20talk%20feedback), or [@Swanros on Twitter](https://twitter.com/swanros).
Whats on your desk?
Tags: discuss, justforfun, offtopic
Published: 2017-08-14 15:20:44

---
title: Whats on your desk?
published: true
description: Whats on your desk that helps you work, think or anything that you wish to share.
tags: discuss, justforfun,offtopic 
---
What do you have on your desk that helps you work/think? For example, I have a Frankenstein plush that I used to help debug code (rubber duck debugging style).