teleren/devto huggingface dataset:
Expanding the Snake game to include a Global Scoreboard - Part 1
Tags: webdev, jquery, php, ajax
Published: 2019-02-01 01:12:50

---
title: Expanding the Snake game to include a Global Scoreboard - Part 1
published: true
description: 
tags: webdev, jquery, php, ajax
---

As you may have seen in my post [Feed the Snake game]( https://dev.to/chillsunfire/feed-the-snake-game-5hlo), I'm trying to learn more about web dev by improving something I built from a tutorial.

The game as is uses the browser's localStorage to keep track of the user's high score. But trying to beat your own score isn't as fun as trying to beat someone else's high score.

Now, I have to admit, since I want to focus on secure coding practices and learning how to best build secure apps from the start, this felt really daunting, and I've been putting it off for a while now. But as I've been reminded, the best way to learn is get in, do it, fail, and figure out the right way...

So, while I know this version isn't secure yet, it took me a couple days just to get it to the point of pulling the score (which is added to the page with JS) and combining it with a name (that the user enters at the end of the game), and sending all of that to my tiny little db through PHP.

While it felt monumental just to get that working, what really struck me after the fact was that I had forgotten some of the core principles of web dev, namely remembering the order of processing of different files to produce the site as viewed in the browser. I had to be away from home, freezing my ears off at the bus stop, to remember that once PHP has processed, it's gone, and if I want to take something that's been generated by JS after the page was loaded and send it to PHP, it has to go through an AJAX call. Order of operations.

Like I said, I know it's probably vulnerable to things like tampering and maybe even XSS, but since I don't quite understand how those attacks work yet, I can't quite write my code better to prevent it. I've contemplated a variety of ways to handle the issues that could arise from accepting user input, but it seemed to me that I first needed to make sure my data was getting into the db, and then the top scores being displayed for everyone to see. Because if I can't do that much, then I can't test the security of other methods, right?

I'm not ready to have you help me by poking at it just yet, so I won't share the link. But if you have any tips, suggestions, guidance that could help me as I learn the best way to write my apps more securely, please share. Thanks.
What drives you at work?
Tags: discuss, motivation
Published: 2019-02-01 00:05:49

---
title: What drives you at work?
published: true
description: What drives you at work? One millennial's take on the question.
tags: discuss, motivation
cover_image: https://thepracticaldev.s3.amazonaws.com/i/n6h0wmrifpqwlql7t0zu.jpg
---

### I want to be invested in my work
By invested here, I really mean that I want to know who my users are and what does my work enable them to do? How does it really help them? For my entire professional career, I've always worked on applications that I'd never use because my work targets a user base that is in an entirely different career path than me. That doesn't mean I can't be invested in my work for them. Knowing that the applications my team and I build directly makes our user's jobs possible or more efficient is that investment I desire and having direct user feedback is a huge payoff for that investment. Take that feedback loop away and I'm less driven to actually get things done.

### I prefer an interesting problem
This doesn't mean that I can't find enjoyment out of implementing the simple things. Sometimes it's the simplest looking designs and functions that turn out to have a hidden quirk that needs more thought or design put into it than originally thought. I have a drive to make things better whether that's the code, the process, or the people and that's where I find the most interesting work. When a team starts to fall into their comfort zone and refuse to push the boundaries is when I know it's time to move on.

### I need transparency
This one is actually twofold. One aspect of this is having transparency within the team and our goals to know where we're going and how the team feels things are progressing. Having worked in teams that feel they can open up and teams that guard their every move, there's a world of difference between the two and even on teams where people sometimes don't get along or disagree with each other, the more transparent team has always been lower stress and higher producing. The second aspect of this is transparency from the management structure. Where are we heading as a company? When this aspect isn't transparent, it reduces morale because there's a level of uncertainty in what the team's role is and how our work moves us closer to the company's goals.

What about you? What drives you at work every day?
powershell Creating a loop that prints numbers divisible by 3, 5,15?
Tags: powershell
Published: 2019-02-01 00:00:18

---
title: powershell Creating a loop that prints numbers divisible by 3, 5,15?
published: true
description: 
tags: powershell
---

function Print-Numbers-Weird ([int]$count) {

    for($i=0; $i -le $count; $i = $i + 1) {

        $isdivisibleby3 = $i % 3 -eq 0
        $isdivisibleby5 = $i % 5 -eq 0
        $isdivisibleby15 = $i % 15 -eq 0

       if($isdivisible) {
           Write-host $i "- Even"
        }
        else {
           Write-host $i "- Odd"
        }

        if($i -eq 3) 
        {
            Write-host "divisible by 3"
        }
        elseif($i -eq 5) 
        {
            Write-host "divisible by 5"
        }
        else {
            Write-host "divisible by 15"
    }
}
How do you onboard a new developer?
Tags: discuss
Published: 2019-01-31 22:35:49

---
title: How do you onboard a new developer?
published: true
description: What processes/documentation do you use when bringing a new developer onto your team?
tags: discuss
---


**I feel like joining my team is like walking through a desert**

I’m curious... 
Having recently become the hiring manager fo my dev team, and not having any documentation around how to get a new developer up to speed, what are some best practices for onboarding a new developer?

I’d love to hear your experiences as a new developer on a team or as a manager bringing on a new developer. What works? What doesn’t work? 

Thanks!!
New dashboard layout and tools for https://Gidgitz.com
Tags: showdev, discuss
Published: 2019-01-31 21:58:48

---
title: New dashboard layout and tools for https://Gidgitz.com
published: true
description: I just released a new layout for https://gidgitz.com and added some a few more tools. Let me know your thoughts.
tags: showdev, discuss
---

**Note:** First off, I'd like to know if you feel that me posting about my website (tools for developers), is appropriate under the tags of showdev and discuss? I'd love to avoid annoying people, while still getting feed back. Let me know your thoughts!   
  
## The update!  
  
[Gidgitz.com](https://gidgitz.com) has a new front page layout, more of a dashboard style. I Also added some new tools, binary/hex convertors. As well as some more resource links.  
  
Please let me know what you would like added for tools and resources! Still open to having others help me with the project as well.   
  
--DeChamp
Turning my WebGL webapp into a npm library
Tags: npm, es6, webgl, glsl
Published: 2019-01-31 21:38:17

---
title: Turning my WebGL webapp into a npm library
published: true
description: EffectNode as a library.
tags: npm, es6, webgl, glsl
---

# Intro

My app is called [effectnode.com](https://effectnode.com) It's a flow based creative coding platform for developers and designers to work together :)

To share the technology with the whole world, i would like to turn it into a front end only library so that all developers can play with what I made.

![Effect Node](https://thepracticaldev.s3.amazonaws.com/i/71440lzyombqffx04afp.png)

# Install
```bash
npm i enos --save
```

# Demo
[Live Demo with Effect Node Build with WebPack](https://enos.netlify.com)

[Live Demo wihtout Effect Node](https://codesandbox.io/s/r7oy8r2nmn)

[Live Demo with Effect Node](https://codesandbox.io/s/vj67lqm9m3)

![EffectNode Library](https://thepracticaldev.s3.amazonaws.com/i/6gc5kapbotpba1lt5dez.png)

# How does it work?

To organise code, we uses modules, just like the idea of es6.

With creative coding, we often needs designer input like coloring, sizing, animation seed, effect amount and timeline and so.

Each module can host its own value sliders, color picker and timeline.

The reason I adopt flow based coding is that it can pass animation data in a visual way and also provide a rapid way to compose effect or mix and match value in desing wise.

# Example

There are two modules in the demo picture above.

1. Main Loop Module
2. Dom Updater

The mainloop module runs a requestAnimationFrame loop and emit render events to a message bus (a vuejs instance)

The Dom Updater modules receive the render event from the message bus and then animate the CSS background linear-gradient of the root DOM of the project.
Day 003 & Day 004: Making a TODO App
Published: 2019-01-31 21:25:00

---
title: Day 003 & Day 004: Making a TODO App
published: true
description: Nothing
tags: 
---

Today and yesterday, I did not complete anything on the todo app. I wanted to be consistent in my posting though, so I am posting this to say I was not able to do anything on my app today and yesterday.
Portfolio review
Tags: portfolio, discuss, frontend, feedback
Published: 2019-01-31 21:15:50

---
title: Portfolio review
published: true
description: Psitopoulos Eleftherios Portfolio review
tags: portfolio, discuss, frontend, feedback
---
 ![Psitopoulos eleftherios, Frontend developer](https://thepracticaldev.s3.amazonaws.com/i/7ss3tldp24pxmlbplpfj.jpeg)

Almost every time I want to get a color from a webpage, I open the dev tools, select any random element and create a color css attribute, setting it to a random color. After that, I click on the small color square that will toggle the eyedropper tool for me to select that color I wanted to get in the first place.

"But this has nothing to do with your portfolio website!" -let me explain! Every time I put a random color in the attribute, I just press a key to get me any color. This key is most of the time "r", which selects the "rebeccapurple" color. Over time, I started liking this color alot, so, for my n-th portfolio redesign iteration, I wanted to use rebeccapurple as a primary color.

I also wanted to convey an "older" feeling, instead of going for an overly saturated design. Something that would remind old video games maybe? I don't know if I got there, but I am feeling great with the end result.

Without further ado, I would like to have my portfolio website reviewed by our awesome community. [Here it is](https://www.bakedbird.com)

Would you also like your own portfolio reviewed? I would love to take a look!

PS. I also got my CV to match the design of my portfolio. [Check it out here](https://docs.google.com/document/d/1WYLD5WpwlZHO3CYcYux7ZgKRbLM_S0HPEVnO1YIVahY/edit#heading=h.aagfqklm9zwt)
The Technical Engineering Intern That I Mentored During Twenty Weeks Just Graduated From His Study
Tags: mentoring, intern, coaching, learning
Published: 2019-01-31 20:47:11

---
title: The Technical Engineering Intern That I Mentored During Twenty Weeks Just Graduated From His Study
published: true
description: Today, the intern at my day job (a tech startup) that I mentored and guided graduated from his Technical Engineering study
tags: mentoring, intern, coaching, learning
---
![Mentoring towards success feels awesome 🙌🏻](https://thepracticaldev.s3.amazonaws.com/i/psx3omhjdumrma3gwgt2.jpg)

The intern was with us for 20 weeks and helped to build the technical core of a solution that we are focussing on in 2019.

Besides having a lot of fun while working together (right now, I'm the Tech Lead, but actually, the only one creating any product as I'm the only one besides a manager), It really just hit me now: I loved how teaching him subtle things, giving advice and helping him to reach the goal of finishing his study brings me joy, too.

And it wasn't just him that learned a sh*tload of things. Listening to the feedback that the reviewers of his last internship during after his presentation made me realize that I now know more about what to focus on when mentoring another student.

It made me see that what they focus on during the presentation is the same stuff that matters when you're working in the field 10+ years after: 

- remember the learning points, the times where you made a mistake and how you got past it
- focus on what you learned from it and don't keep dwelling at the mistake itself as it cannot be undone
- keep open for feedback and don't be shy to show constructive criticism to fellow colleagues
- dialogue and knowing WHY you made certain decisions is more important than the path you followed

And while Technical Engineering is about coding, design patterns, research, and all of that, the above things make you more complete as a developer. As a creator of any kind actually.

It's good to see him go on to the next phase in his life now. Rewarding even. And to know that this also is proof that by providing value you'll be rewarded. This isn't just for business. It is also for caring and helping others in life.

It was 5 hours since he got to hear the grade that put a rewarding finish tag on his study, and I'm opening up a brewsky with a smile on my face. 

It was one of the most gratifying things I did 🤓. Ya know? 
One of those things that makes you feel like you can take on the world. 

I'm going to enjoy the fact that I now have actual proof that mentoring a student can be put on my skillset list and that It will help me to be a better colleague, entrepreneur and human overall, even if it's for just a tiny bit 👌🏻.

Do you have any experiences with mentoring students and/or others that brought similar or other positive vibes into your life?

Code Hard, Ship Harder - shipharder.com

Please ❤️ like and share if you like my story.
Ansible Error: ImportError: No module named zipfile
Tags: ansible, devops, ubuntu
Published: 2019-01-31 20:44:58

Hello World,

This is probably more of a reminder to myself... however, If you happen to get this using Ansible 2.0, with Ubuntu 18.04.1 LTS, and a minimal current install of Python on your targets:
```
10.0.3.73 | FAILED! => {
    "changed": false,
    "module_stderr": "Shared connection to 10.0.3.73 closed.\r\n",
    "module_stdout": "Traceback (most recent call last):\r\n  File \"/home/ubuntu/.ansible/tmp/ansible-tmp-1548966135.59-128122597125522/ping.py\", line 17, in <module>\r\n    import zipfile\r\nImportError: No module named zipfile\r\n",
    "msg": "MODULE FAILURE",
    "rc": 1
}
```

It isn't you, it's them, and it's a terrible error.

I was running: `ansible web -i inventory -m ping -u ubuntu -k`

And my inventory file looked like:
```
[allservers]
10.0.3.202
10.0.3.19
10.0.3.73

[database]
10.0.3.202

[web]
10.0.3.19
10.0.3.73
```

This is what i needed to do to _'fix'_ it... add bits like this to your inventory:
```
[allservers:vars]
ansible_python_interpreter=/usr/bin/python3

[database:vars]
ansible_python_interpreter=/usr/bin/python3

[web:vars]
ansible_python_interpreter=/usr/bin/python3
```
Now your run should be a bit happier:
```
$ ansible allservers -i inventory -m ping -u ubuntu -k
SSH password:
10.0.3.73 | SUCCESS => {
    "changed": false,
    "ping": "pong"
}
10.0.3.19 | SUCCESS => {
    "changed": false,
    "ping": "pong"
}
10.0.3.202 | SUCCESS => {
    "changed": false,
    "ping": "pong"
}
```
Happy Coding!
All Things Version Controlled
Tags: versioncontrol, git, svn
Published: 2019-01-31 20:20:31

---
title: All Things Version Controlled
published: true
tags: versioncontrol, git, svn
canonical_url: https://zeitschlag.net/all-things-version-controlled/
---

These are some things, articles and thoughts about [version control](https://en.wikipedia.org/wiki/Version_control). You are already using it, of course you are, aren't you?

Recently, we recorded an episode for our [German podcast on Software Engineering and stuff](https://codestammtis.ch). For nearly 50 minutes we talked about [version control](https://codestammtis.ch/2018/10/29/cst014-versionskontrolle/): We discussed the basic principles, [git](https://git-scm.com), [Subversion](http://subversion.apache.org) and [fossil](http://www.fossil-scm.org/index.html/doc/trunk/www/index.wiki).

What brought this issue up, was my new job. When I started it in October, we used Subversion for version control, but we wanted to replace it with git within a month. It was pretty much my first task and after I figured out what to do, it went surprisingly well. During this process and especially when teaching my — still pretty limited — knowledge on git to my colleagues, I learned a lot. Teaching others is still the most effective way of learning for me. This is probably a good place to mention ”[Pro Git](https://git-scm.com/book/en/v2)“, it's a book about git. You can read for free as eBook or PDF or online. And you should read it, you might learn something (new).

I came across a blogpost about [commit messages in git](https://chris.beams.io/posts/git-commit/). My colleagues didn't put much love and effort in writing clear commit messages in Subversion, which is why `git log --oneline` is sometimes a bit hard to read. You better don't look up my commits on Github. Just don't. I'm still learning, too.

What I like about git a lot, is its staging area: Sometimes I might work in a quite chaotic way and every time I'm really grateful, that git allows me to clean up my work: Using the staging area, I can seperate my coding work in good commits and no one will ever notice that this once was a mess. 🤫

So, now that we're working in 20108 version control system-wise, I stumbled upon a very interesting blogpost about [using CVS aka. Version Control before git](https://twobithistory.org/2018/07/07/cvs.html) on a very interesting blog about “Computing through the ages”. The last sentense summarizes pretty well, why you should read this thing, too:

> Going back and using CVS for a while is an excellent way to find yourself with a new appreciation for Git’s power and flexibility. It illustrates well why understanding the history of software development can be so beneficial—picking up and re-examining obsolete tools will teach you volumes about the why behind the tools we use today.

Thanks to Michael J. Tsai for [blogging](https://mjtsai.com/blog/2018/11/15/version-control-before-git-with-cvs/) the CVS-blogpost. I might have fallen in love with git — again.
Superclass & Subclass
Tags: javascript
Published: 2019-01-31 20:19:09

---
title: Superclass & Subclass
published: true
description: The opinion/mindset of a newb
tags: JavaScript
---

I just learned about "Classes" yesterday and for some reason, the concept of superclasses and subclasses feel unnatural to me. Why is it that the subclass/child can have the functionality/prototype of the superclass/parent and more, but not the other way around. I understand how it works I guess I'm just not happy with the naming convention of Superclass and Subclass lol..
Save NSSecureCoding-decoding for Dummies
Tags: objectivec, ios, xcode
Published: 2019-01-31 21:24:39

---
title: Save NSSecureCoding-decoding for Dummies
published: true
tags: objectivec, ios, xcode
canonical_url: https://zeitschlag.net/save-nssecurecoding-decoding-for-dummies/
---

After my last wrong assumption, that I don't need to look up easy things, I stumbled upon this assumption again. This week, I failed to implement `NSSecureCoding` the right way. In the end, I learned some things.

I wanted to [persist some data](https://nshipster.com/nscoding/) using [`NSSecureCoding`](https://developer.apple.com/documentation/foundation/nssecurecoding?language=objc), [`NSKeyedArchiver`](https://developer.apple.com/documentation/foundation/nskeyedarchiver?language=objc) and [`NSKeyedUnarchiver`](https://developer.apple.com/documentation/foundation/nskeyedunarchiver?language=objc). I haven't used `NSSecureCoding` before, but hey, how difficult could it be?

1. Just implement [`-encodeWithCoder:`](https://developer.apple.com/documentation/foundation/nscoding/1413933-encodewithcoder?language=objc), [`-initWithCoder:`](https://developer.apple.com/documentation/foundation/nscoding/1416145-initwithcoder?language=objc) and [`supportSecureCoding`](https://developer.apple.com/documentation/foundation/nssecurecoding/1855946-supportssecurecoding?language=objc).
2. Encode with `NSKeyedArchiver`, decode with `NSKeyedUnarchiver`.
3. There's not 3

These were my assumption, but it didn't work — what a freaking surprise! 🎉. If I would read the documentation beforehand, I could have saved several hours.

Both Apple's documentation — and NSHipster state:

> Specifically, classes that override `-initWithCoder` and conform to NSSecureCoding should use `-decodeObjectOfClass:forKey:` rather than [`decodeObjectForKey:`](https://developer.apple.com/documentation/foundation/nscoder/1418185-decodeobjectforkey?language=objc)  
> Source: [NSHipster](https://nshipster.com/nssecurecoding/)

> An object that does override `initWithCoder:` must decode any enclosed objects using the [`decodeObjectOfClass:forKey:`](https://developer.apple.com/documentation/foundation/nscoder/1442558-decodeobjectofclassforkey?language=objc) method.  
> Source: [Apple's Documentation on `NSSecureCoding`](https://developer.apple.com/documentation/foundation/nssecurecoding?language=objc)

My mistake was to use just `-decodeObjectForKey:` for decoding. For an `NSString`, everything went fine. I found my mistake, when I was wondering, why I can't decode my encoded `NSData`. There were some mysterious error messages in the debugger, but I still doubted my code: This was so easy, it wasn't even worth to stack-overflow this issue!

After a while, I read the documentation by accident. I saw my misconception then, fixed the issue, and suddenly, everything worked as intended. In the end, I felt pretty stupid, although I learned some things:

- How decoding with `NSSecureCoding` works
- Read the freaking documentation, folks! NSHipster might be worth reading, too.
- Don't ignore the little "don't assume, prove!"-post-it-sticker next to my screen.

Thanks for reading!
Avoiding Java Boilerplate Code with Project Lombok
Tags: java, projectlombok, coding
Published: 2019-01-31 19:15:41

---
title: Avoiding Java Boilerplate Code with Project Lombok
published: true
description: This article demonstrates how you can use Project Lombok library to avoid boilerplate code from your Java projects.
tags: #java #projectlombok #coding
canonical_url: https://auth0.com/blog/avoiding-java-boilerplate-code-with-project-lombok/
---

In this article you will learn how to avoid boilerplate code from your Java projects. You will do so by using features of Project Lombok, a wonderful Java library that was created to help developers speed up. You will learn how to use this library's features by using them on small examples. 

[Read on ☕️](https://auth0.com/blog/avoiding-java-boilerplate-code-with-project-lombok/?utm_source=dev&utm_medium=sc&utm_campaign=javaboilerplate_lombok)

![Avoiding Java Boilerplate Code with Project Lombok](https://thepracticaldev.s3.amazonaws.com/i/hpnhfhoflrz2toddctoi.png)
No more boring Identicons!
Tags: webdev, webdesign, identicons, opensource
Published: 2019-01-31 19:00:59


---
title: No more boring Identicons!
description: Avatars allows you to create placeholder avatars. You can choose between simple identicons and lovely designed characters. And best of all... Avatars provide a simple and free HTTP API that you can use right away!
published: true
tags: #webdev #webdesign #identicons #opensource
---

Avatars allows you to create placeholder avatars. You can choose between simple identicons and lovely designed characters. And best of all... Avatars provide a simple and free HTTP API that you can use right away!

Check out: [avatars.dicebear.com](avatars.dicebear.com)

Feedback welcome!