teleren/devto huggingface dataset:
Kieszeń first game lesson
Tags: game, assembly, 6502
Published: 2019-11-13 17:54:31

Disclaimer: All the credits for this post should go to Nick Morgan for creating this amazing MOS 6502 tutorial [Easy 6502 ebook](https://skilldrick.github.io/easy6502/) I just adapted for my modified IDE that focus on 2d gaming.

# What is Kieszeń
Kieszeń is a startup idea about creating a portable game console where people can create games withouth previous experience. By using simple, constrained 2d games, so the limitations can bring creativity and problem solving, instead of relying on adding feature after feature hopping that some special effect or gimmick saves our gameplay.

# Road to our first game
So, let’s dive in! [Click here to open Kieszeń Create](https://create.kieszen.se), the webpage where you can make your own video games. Copy as paste the text below (don’t worry we will explain what it means)

```
LDA #1
STA $512
LDA #16
STA $513
LDA #8 
STA $514
```
Now press Play. Hopefully the screen area on the right now has Pac-man on the top left.

So, what just happened? Let’s step through it by analyzing the text. First **reload the page**, then press **Analyze game** to show a panel with extra information. Press **Next line** once. If you were watching carefully, you’ll have noticed that something called Accumulator changed from `#0` to `#1`.

In Kieszeń Create, anything prefixed with `#` is considered a number. Anything with `$` refers to a memory location.

Equipped with that knowledge, you should be able to see that the instruction `LDA #1` loads the number 1 into the processor Accumulator. We will go into more detail on processor inner workings in upcoming lessons.

Press Next line again to check the second instruction. The top-left part of the screen should now display the Pac-man character. Kieszeń uses the memory locations `$512` to `$768` to store, display and modify graphics on the screen. The values `#1` to `#255` represent the 255 different graphics that the console can remember at the same time (`#0` means no character), so storing the value `#1` at memory location `$512` draws a game graphic at the top left corner.

Finally, the instruction `STA $512` stores the value of the Accumulator register to memory location `$512`. Keep pressing Next line to check the rest of the instructions, keeping an eye on the Accumulator as it changes.

# Exercises
1. By opening this [image](https://learn.kieszen.se/images/initial-spritesheet.png), try changing the graphics to one of your favorite game characters.
2. Change the first character position to draw at the bottom-right corner. (memory location `$513` and `$514`)
3. Add more instructions to add more game characters (don’t forget to write the position of each character as well).
Composition in Angular the React JS way
Tags: chrome, webdev, tenx
Published: 2019-11-13 17:53:29

What ever it is Dev.to has here as an editor, should get binned. I know we trying to get real geeky here, but for people who wanna write coming from a medium world, this editor right here is are turn-off. 
But pre-rambling, I was actually think of ..... ohh shit I forgot... ehm .. {countdown to brain restart and ... yes thats it. 
Im working on this project in Angular 6. For some reason I have the strong desire to use composition instead of inheritance for sharing just logic and using composition to build complex UIs in this Angular project as I have tried in my other React projects because React encourages composition over Inheritance..



In my experience, React developers preference of composition over inheritance for building complex user interaction driven application is really good reason use React a lot more. 
But I am thinking, I can use the same principle in Angular 6 and build components and interactions using composition
Monitor WordPress with Prometheus and Grafana
Tags: wordpress, grafana, monitoring
Published: 2019-11-15 11:16:58

---
title: Monitor WordPress with Prometheus and Grafana
published: true
date: 2019-11-13 17:35:10 UTC
tags: Wordpress, grafana, monitoring
canonical_url: https://daniele.tech/2019/11/monitor-wordpress-with-prometheus-and-grafana/
---

How to track WordPress with Prometheus and Grafana using a plugin? 

Based on my experience with another script that I built to [check the WordPress’s DB status](https://github.com/CodeAtCode/WPDB-Status) I created a new plugin.

Check the complete post [Monitor WordPress with Prometheus and Grafana](https://daniele.tech/2019/11/monitor-wordpress-with-prometheus-and-grafana/) appeared first on [Daniele Mte90 Scasciafratte](https://daniele.tech/eng).
MindMap for a €200 in 4 days
Tags: 200in4days, urgent, ongoing
Published: 2019-11-13 17:28:54

---
title: MindMap for a €200 in 4 days
published: true
description: challenge
tags: #200in4days, #urgent, #ongoing
---

I need to make 200 in euros in four days.

#Brainstorming

What I could do:

+ fix a bug, charge hourly
+ put together a collection of cognitive games I have made and offer them for sale as a package
+ write a very small web game
+ write some blogs 
+ write some poetry
+ sell a board game of my design
+ design a new board game 
+ design a website as a hire
+ design an MVP
+ complete and sell a mindmap for metalearning skills and how to improve the most relevant of these skills most of it is complete already
+ drawings and paintings
+ tutorial
+ video lesson in programming 
+ tuition

Languages I might manage to get along in:
JAVA
C
C++
QBASIC
Visual Basic
VBA
JS/CSS/HTML
GOLANG
KOTLIN

Accepting advice and offers as well if you know anyone who might need help with these, please let me know or post my links to your friend.
Get list of all vm's beginning with prefix "MS"
Published: 2019-11-13 17:24:40



I am absolutely new to scripting, especially javascript. We are using VmWare vRO which is a workflow orchestration tool based on javascript. The native workflows in vRO do not have scriptable tasks where we can get a list of master images beginning with "MS". If some could provide me with a script to get a list of these specific master vm's, it would truly be appreciative.

 #beginner, #help, #javascript

Thanks
How to install Postgres on OSX in 2K19 with 🍺
Tags: postgres, database, osx, macbook
Published: 2019-11-13 17:10:51

## Prerequisites
- You have to be on OSX 🍎
- Homebrew installed as dependency manager 🍺

## Story
This morning I was working on a project that I have to install Postgres. I was thinking to myself that it was a really easy thing and that it will take me 3 minutes (the time to run `brew install postgres` and go grab a cup of tea in the open space)

BUT, it wasn't the case and I'm just facing with a weird issue. That's why I'm writing this article, maybe this could help someone and save your time.

## Install Postgres on OSX with Homebrew

- First, you have to run this brew command line `brew install postgres`
- Just verify that the installation is successful `postgres --version`

Now, you can run the command line to start Postgres `pg_ctl -D /usr/local/var/postgres start`
If it works, you're lucky! But if you have `FATAL: database files are incompatible with server` you're on the right post!

![Postgres issue on startup](https://thepracticaldev.s3.amazonaws.com/i/9ngpeukim6mhsporak28.png)

## Solution
The solution was to run `brew postgresql-upgrade-database` to upgrade your database files to the 11 version. You can have old database files who was initially created with the version 10 of Postgres. That's why you have an error.

## And.. then?
Now you can rerun the command `pg_ctl -D /usr/local/var/postgres start` and it should work like a charm 🎉

- You can also configure your Postgres! I have found a useful link who can help you : https://www.codementor.io/engineerapart/getting-started-with-postgresql-on-mac-osx-are8jcopb#iv-popular-guis-for-postgresql-on-macosx
A simple dotfiles utility you can use to bootstrap a new dev environment
Tags: dotfiles, vim, zsh, productivity
Published: 2019-11-13 17:02:44

Get the dotfiles here: https://github.com/lewisflude/.dotfiles

Recently, I consolidated and simplified my config files for zsh, vim and tmux and created a simple shell script to symlink them to the home directory. Please feel free to fork, tweak and use yourself!

Get started by pulling down this repo to your home directory, cd in and run `./bootstrap.sh` to begin the bootstrapping process.

This will install:

* Brew
* Zsh
* Tmux
* Nvm + latest version of node
* Alacritty (ultra-fast terminal emulator)

After those are installed symlinks will be added for configs for zsh, vim, tmux and alacritty. You can edit these to your preferences, and they should automatically work!

Any feedback would also be massively appreciated!
Start, Restart and Stop Azure VM from Azure CLI
Tags: azure, productivity
Published: 2019-11-13 16:57:49

As a developer sometimes I have to use several virtual machines to develop my projects.
My machines, of course, live and run on Azure.
Every time I have to log in on Azure Portal, find the resource group, find the VM, click on "Start" and wait a few minutes to connect to my VM.

The best solution I found is using Azure CLI.

## Install Azure CLI

The Azure CLI is a command-line tool for managing Azure resources from Windows, Mac and Linux (Docker, WSL as well).

The current version is 2.0.76.

### Install on Windows
To install Azure CLI on Windows is very easy.
You can use [this link](https://aka.ms/installazurecliwindows) to download the installer or you can launch this PowerShell script with administrator rights:

```powershell
Invoke-WebRequest -Uri https://aka.ms/installazurecliwindows -OutFile .\AzureCLI.msi; Start-Process msiexec.exe -Wait -ArgumentList '/I AzureCLI.msi /quiet'
```

## Install on Mac
To install Azure CLI on Mac, you need [homebrew](https://docs.brew.sh/Installation.html).
From a terminal you can launch this command:
```
brew update && brew install azure-cli
```

## Install on others OS
You can find the full list of supported platform here: https://docs.microsoft.com/en-us/cli/azure/install-azure-cli

## Check the installation
To check if Azure CLI is running and the version, you can use this command from a terminal.
```powershell
az --version
```

At the moment my favorite terminal app is [Windows Terminal](https://dev.to/expertsinside/how-to-customize-the-new-windows-terminal-with-visual-studio-code-56b1)

## Sign in
The login command is

```powershell
az login
```

This is an interactive method and you have to open a browser and navigate to this url: https://aka.ms/devicelogin.
Enter the authorization code displayed in the terminal and then the credentials for your Azure Tenant.
In the next terminal session you can use this tenant or you can add more tenants.
I like this feature.

## Start a VM
To start a VM you can use the command below:
```powershell
az vm start -g MyResourceGroup -n MyVm
```
You have to change the parameter -g (or --resource-group) with your value.
Same for -n (or --name) with the name of your VM.

You can start all VMs in a resource group with the command below.
```powershell
az vm start --ids $(az vm list -g MyResourceGroup --query "[].id" -o tsv)
```

If you don't want to wait the end of the operation, you can add the parameter --no-wait to your commands.

## Stop a VM
Command is very similar to the start command:
```powershell
az vm stop -g MyResourceGroup -n MyVm
```

## Restart a VM
Same for the restarting command
```powershell
az vm restart -g MyResourceGroup -n MyVm
```

## Conclusion
With Azure CLI you can manage all resources in Azure and you can do it with cross-platform experience.
You can find the full documentation here: https://docs.microsoft.com/en-us/cli/azure
Spare the (Global) Air
Tags: javascript, codenewbie
Published: 2019-11-13 16:57:05

When I first learned JavaScript, I got into a pattern of keeping my frequently-used variables and invoked function calls at the top of my file. Sure, my code worked, but I couldn't help but wonder what the implications were of those variables and method calls just hanging out there in space and whether there was a better way to structure my code. 

Yes, there is a much better way to structure your code! If you’re a newb like me, let me introduce you to IIFE, an immediately invoked function expression affectionately nicknamed "iffy."

### IIFE (Immediately Invoked Function Expression)

According to MDN Web Docs, an IIFE is a JavaScript function that runs as soon as it is defined. A common way to write it is:
```javascript
(function () {
  // do cool stuff here...
})();
```
As you may have noticed, it’s an anonymous function wrapped in parenthesis and has a second set of parenthesis at the end. By wrapping the anonymous function in parenthesis, JavaScript will run it as a function expression, and not a function declaration. The second set of parenthesis will actually invoke the function immediately after it is defined. 
 
### Why You Should Use IIFEs

**IIFEs are used to  prevent the pollution of the global scope.** Once I realized I was polluting my global scope with my inadvertent global variables and functions, I wanted to rein it in. 

![gif of bringing it in](https://media.giphy.com/media/g0QGZxpbFueYVluQb4/giphy.gif)
<figcaption>Via GIPHY</figcaption>

By nesting my code within the IIFE, it not only cut down on the unnecessary bloat in my global environment, but it also safeguards my code. An IIFE creates a lexical scope that allows public access to methods while keeping variables defined within the function inaccessible. That’s some good privacy for those variables.

An optional addition to your IIFE is to include a semicolon at the beginning. This makes it more defensive in case a previously included JavaScript file does not terminate with a semicolon.
```javascript
;(function () {
  // do cool stuff here...
})();
```
So be the catalytic converter (better yet, take public transportation or walk) to your JavaScript code and keep pollutants that you can out of the air!

*Resources*
[IIFE](https://developer.mozilla.org/en-US/docs/Glossary/IIFE)
[Immediately invoked function expression](https://en.wikipedia.org/wiki/Immediately_invoked_function_expression)
[JavaScript: What the heck is an Immediately-Invoked Function Expression?](https://codeburst.io/javascript-what-the-heck-is-an-immediately-invoked-function-expression-a0ed32b66c18)
Mindset Flip
Tags: negativeselfimage, perfectionism, selflimitations, growthmindset
Published: 2019-11-13 16:48:33

---
title: Mindset Flip
published: true
description: Negative self limitations and a way out
tags: #negativeselfimage, #perfectionism, #selflimitations, #growthmindset
---

For a while there have been several limiting thoughts that constrict what I can possibly achieve. Some of them I have begun to learn to overcome. 

Growth mindset is a cultivatable attitude and even a skill of sorts.
To achieve it I need to flip around when I become conscious of the negative and limiting beliefs. I do not want to empower them anymore and I do need to say out loud the opposite: what I desire to achieve instead. Even if there is not an inkling of possibility in my view that I could make it happen. 

Recently I overturned that I cannot continuously program for months. I did program on most days and almost continuously for two months and a couple of weeks in addition to that. I have now taken a short break to write to dev.to and write up material for a Youtube channel.

The next challenge involves money. I have often told myself or kept myself simmering in the doubts and beliefs that I could not possibly be making money.

Well here goes : "I CAN make €200 in 4 days or less"
When I succeed I am going to undertake the next challenge:
"I CAN make €1000 in 10 days" 

Immediately the second goal plays a few limiting songs on my beliefs:
 - am I not being a perfectionist 
 - am i not getting into wishful thinking 
 - i have almost no social skills to speak of

SO, onwards! Here goes:
1. I am being realistic
2. Others have done it so could I; I can make it happen!
3. I have all the necessary social skills I need

If you read this and have an idea of how to help I would appreciate your thoughts, I would value them highly.

I feel better every time I see three phrases that I morphed my automatic self limiting beliefs into:
1. I am being realistic
2. Others have done it so could I; I can make it happen!
3. I have all the necessary social skills I need
4 Must Know JavaScript Array Iteration Methods
Tags: javascript, arrays, iterators, loops
Published: 2019-11-13 16:39:18

Working with arrays in JavaScript used to be really annoying and complex. Fortunately now, there are a bunch of amazing JavaScript array methods that just make life easier. In this post, I will be covering the 5 most important JavaScript array iteration methods.


# **.forEach**

This is a fundamental array method concept. If you can understand how this one works, you're gonna be able to learn the other methods a lot more easily.

This method is basically a for loop that takes in a function with a parameter and outputs that same data.

**For example:**

```javascript
const array = ['a', 'b', 'c'];

array.forEach(letter => {
  console.log(letter);
});

// expected output: "a"
// expected output: "b"
// expected output: "c"
```


# **.map**

This method is also really simple. It allows you to take one array as a parameter and convert it into a new array. You'll find yourself using this method a lot.

**For example:**

```javascript
var array = [1, 4, 9, 16];

// pass a function to map
const map = array.map(x => x * 2);

console.log(map);
// expected output: Array [2, 8, 18, 32]
```


# **.find**

This allows you to find a single object within an array. It takes in a parameter and returns the first element in the array that returns true.

**For example:**

```javascript
var array1 = [5, 12, 8, 130, 44];

var found = array1.find(function(element) {
  return element > 10;
});

console.log(found);
// expected output: 12
```


# **.reduce**

This method operates on an array, and reduces it to a single value.

It takes in two arguments:

1. A callback function with 2 parameters:
  - accumulator: the starting value
  - currentValue: each element in the array

2. The initial value for the accumulator.

The return function is then stored in the accumulator.

**For example:**

```javascript
const array = [1, 2, 3, 4];
const reduce = array.reduce((accumulator, currentValue) => {
  accumulator + currentValue;
}, 0);

// 1 + 2 + 3 + 4
console.log(reduce);
// expected output: 10


```
Will you die? An important question before giving tech talks
Tags: talks, career, techtalks
Published: 2019-11-13 16:15:16

The night before I can't sleep. Five minutes before my hands are shaking. 

Public speaking - no matter how many times I do it - still freaks me out. Especially when speaking on a topic where there are others in the room who know significantly more about it than me (which is all the time).

Five minutes before the talk I ask myself the question:

> Will you die?

It's my way of reminding myself that **even if the worst happens during the talk - I'll survive**. Even if I forget everything I'm supposed to say, and the powerpoint slides have been replaced with pictures of hairless cats - I'll still survive. I may make a fool of myself, but the chances are good that I won't.


It's a phrase I picked up from a friend in improv a long time ago, and it's helped me overcome the nerves behind public speaking (and a lot more) ever since.
Fake Post for a Post-fake World
Tags: fakenews, fakeart, newart, artforms
Published: 2019-11-13 16:04:51

---
title: Fake Post for a Post-fake World
published: true
description: fakeposts, fakenews and fake stories in art scenes may usher in a new page in the history of culture 
tags: #fakenews, #fakeart, #newart, #artforms
---

At a certain point in the history of Christianity and perhaps also in other religions, drama as an art form has been either shunned, deemed morally unacceptable or even banned by canon law.

Usually a secret fan has been found among the clergy who later shows that it is acceptable after all. Especially as it is observed that there is a useful function drama plays in propaganda, advertising and public relations engineering as well as the twists in expressing historical courses of events. For example the historical plays of Shakespeare.

On one hand propaganda appears in drama on the other hand a 'false' representation of the world and its stories are elevated to the heights of high art on the stage. An ouroborean snake of a setup.

I see a new form of art appearing, where reality and news are the very material these pieces are made of; the theatre of fake news is not just a place for the edification of the soul and a cultural excursion anymore, these recombinations of archetypal stories into ever new shows begin to  make a seamless fusion out of reality and fiction. It then creates a totally new fabric out of reality itself with its own rules of play and the newstheatre is merged with the world. There is now a new MEDIUM no more divided into a stage, a production and a public nor a story and a fib and the facts. Everyone may transform into an actor and director all at the same time. Everyone may even have a fake sense of being a director while being a viewer with a rather constricted freedom. 

We will not have the foggiest of what is a play and what is up, will we even be able to tell a head from a tale?

If we are to ban deep fakes then we are also banning art. 
If we are to give freedom to perform all fake stories and accept all, what a form of art will it be to make sense of all that is essential to existence.
My side project Resting
Tags: showdev, webdev
Published: 2019-11-13 15:56:26

Hi,

in the last two years I have dedicated some my spare time to a side project called Resting.
Resting is a browser extension that permits to analyze and test HTTP and REST APIs.
The mission of Resting is to simplify daily work of developer in testing and analyzing HTTP/REST requests.

Resting takes inspiration from Postman with the goal to be light and focused on the management of saved requests.

It is a Open Source project hosted by Github and it is a community friendly project.
Here is the [Github repository](https://github.com/mirkoperillo/resting)

I'm very interested in some feedback about the tool
Data Obfuscation
Published: 2019-11-13 15:55:52

Hi folks!

I am currently working on an app that requires some level of data obfuscation. 

I decided to go with Firestore to store my data, and I started looking into ways to obfuscate data within the database, mainly to avoid staff accessing and reading user data directly from the Cloud Console, but couldn't find anything conclusive so far.

Has anyone ever encountered a similar problem? How did you solve it? Would it be a policy issue?