teleren/devto huggingface dataset:
An open source Javascript game engine.
Published: 2022-09-09 06:06:03

---
title: An open source Javascript game engine.
published: true
date: 2022-01-08 12:16:16 UTC
tags: 
canonical_url: https://rayanabid.hashnode.dev/an-open-source-javascript-game-engine
---

## Introduction

Well, we've all been there you want to make games but don't want to invest time in downloading some game engine and learn the language to make games on it, or the software ends up being too expensive. What I have for you today hits most of these points. It's open-source, it's free, and If you're familiar with javascript then you are all good to go.

Say hello to ct.js the open-source 2d game engine that is available on windows, mac, and Linux as well. It is small in size with great documentation to get you started with building your first game. I knew nothing about game development or ctj.s but was able to get a simple space-shooter game in about an hour.

![homepagescreenshot.jpeg](https://cdn.hashnode.com/res/hashnode/image/upload/v1641643398343/fwBKwAWQU.jpeg)

## Basic concepts

### Importing Textures

Importing textures is super easy when you are in a project just goto the textures tab and import your textures.

### Easy character animations

Animating your characters is also handled by CT.js you just have to import your character sprite sheet. You can find many sprite sheets from [the sprite resource](https://www.spriters-resource.com/).

![tutPlatformer_04.b3431334.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1641643762269/uCTbAzWi7.png)

### Builds

Ct.js allows you to build your games for web as well as desktop using the same code. And if you are skilled enough there is also a way of building your games using cordova to release it for android and ios as well.

## Conclusion

CT.js is a very cool game engine if you are someone like me who knows javascript and has a low spec machine that can't run unity but want to build games. You can learn more about CT.js from [this link](https://ctjs.rocks/)

Have you tried CT.js yet or know of any other game engines do let me know and share your thoughts as well. Thank you for your time.
Maintaining FakerJS - Blaver
Tags: javascript, programming, webdev, node
Published: 2022-01-08 12:08:01

> Warning: Self Promotion in Place, but for good reasons.

**What happened?**

As you all might be aware that FakerJS' developer (Marak) decided to remove all the code and take down the repository. Soon enough, people started reviving FakerJS - however the code which was propagating was a code from 6 months ago – all test cases failed and a few parts were incomplete - seemed like the code was in progress. Everyone forked the same code and published on NPM. Packages like `withshepherd/faker` and `community-faker` started getting traction.


**What is Blaver? Why a new Fork?**

Blaver has the same ideology of reviving and maintaining FakerJS. To be honest, I started working on Blaver before I could look at those community forks – there is no other reason to explain this. However, I noticed the incomplete code, so I detached the repository fork which I had and started fixing the library. I had to go through all (exaggerated - I meant “a lot”) of the contributors of Faker, looked at their latest fixes and fixed the code to a working state. I rolled out my own fixes too (Took me almost 100 commits, Never did so many commits in a day).


**What makes it different from other community versions?**

* Easy to remember unique short name.
* Added `bigInt()` function (missing from other repos) and fixed `bitcoinAddress()` function (as found in contributor repos).
* Fixed all linting errors.
* Fixed all unit test cases (0 tests were passing at the time of the fork, all tests pass now).
* Remove old public API from `vendor/mersenne.js`.
* Replaced jshint with eslint. Removed jshint specific files: `jshintrc` and `jshintignore`.
* Updated all locales to include new random data and added a new Urdu (UR) locale.
* FakerCloud (service used to generate random profile pictures) is also taken down. Replaced it with Pravatar. Also fixed test cases for the random pictures function.
* Fixed coverage script with working coveralls code coverage.
* Added GitHub Actions script to run lint and test scripts.
* Update all faker instances to `blaver`.


**Where to find it?**

GitHub: [https://github.com/luciferreeves/blaver](https://github.com/luciferreeves/blaver)

NPM: [https://npmjs.com/package/blaver](https://npmjs.com/package/blaver)


Hope you like this work. I am determined to maintain this repository from now on. If you have some time, consider adding yourself to the [stargazers list](https://github.com/luciferreeves/blaver/stargazers) on the [GitHub page](https://github.com/luciferreeves/blaver). If you like to see any extra functionality, consider raising an Issue.

Thanks for reading this much.
New Year Challenge, 2022, The Road To £1,000,000
Tags: challenge, cryptocurrency, investment
Published: 2022-01-08 11:59:13

I'm not a fan of new years resolutions. You set yourself a target which starts in January, January is cold and dark, you have little money after Christmas. Not really setting yourself up for success. I stopped setting sensible new years resolutions over 20 years ago, but this year I decided to change it into a new year challenge. More like something I want to try to do, but not beat myself up if I don't achieve.

This years challenge, find ways to double my money. Why? I read a great post somewhere which said that if you start with £1,000 and double its value every year, in ten years you'll have £1,000,000. I'm not planning on getting to the million mark, but it might be fun to have a play and see how far I could go.

2022 is the testing year. I'm starting with £25 and I'm going to try lots of different ways to double that money which I shall document here. The ultimate aim is to end the year with £1,000, ready to start the ten year, £1,000,000 plan. 

For January I plan to sell my teaching resources. I quit teaching 4 years ago, but have loads of quality resources I could sell. This isn't scalable and won't get me to that million, but should easily double the £25, and with some effort could yield £1,000 a month.

For the rest of the year, I'll be doing research into stocks, shares, bitcoin and the other crypto currencies, and testing the water with those. I might try setting up an ebay shop.

I'm quite excited about what could happen, obviously I will probably also lose some money, but as I'm starting with a small amount of money, this will be less scary than it could be, but also a valuable lesson. 

I'll update at the end of the month on how the teaching resources work, and whether I've achieved £25!!
JavaScript's "..." in Python? 😰
Published: 2022-01-04 15:33:03

Spread Operator in JavaScript is one of the best thing given by GOD 😝

## What is Spread Operator in JS?

**Spread operator** allows an iterable to expand in places where 0+ arguments are expected. It is mostly used in the variable array where there is more than 1 values are expected. It allows us the privilege to obtain a list of parameters from an array.

```js
let arr1 = [1, 2, 3];
let arr2 = [4, 5];

// Spread Operator
let arr3 = [...arr1, ...arr2];
console.log(arr3); // [ 1, 2, 3, 4, 5 ]
```

## What is ... in Python?

**...** or **Ellipsis** is a Python Object. It has no Methods. It is a singleton Object i.e, provides easy access to single instances.

```python
# style1
def foo():
	pass

# style2
def foo():
	...
# both the styles are same
```

More example

> Use an Ellipsis in Numpy To Omit Dimensions

```python
import numpy as np

A = np.random.rand(2, 3, 2)
print(A)
# [[[1.83948755e-01 7.34415667e-04]
#   [7.34273680e-01 3.92355559e-01]
#   [6.73369042e-01 2.93722630e-01]]
#
#  [[8.17789457e-01 1.13353920e-01]
#   [3.53150493e-01 2.70330813e-01]
#   [7.46381962e-01 7.42168707e-01]]]

print(A[:, :, 1])
# [[6.75415667e-04 4.58155559e-01 9.02622630e-01]
#  [9.13353920e-01 4.70330813e-01 6.42168707e-01]]

print(A[..., 1])
# [[6.75415667e-04 4.58155559e-01 9.02622630e-01]
# [9.13353920e-01 4.70330813e-01 6.42168707e-01]]

print(A[Ellipsis, 1])
# [[6.75415667e-04 4.58155559e-01 9.02622630e-01]
#  [9.13353920e-01 4.70330813e-01 6.42168707e-01]]
```

---

## Conclusion

You can use **...** or **Ellipsis** in place of `pass` in python. or use in numpy To omit dimensions.

---

Hurray! You just learned `What is the difference between JS Spread Operator and ... Python.`

---

I hope, you guys liked this quick tutorial. If so, then please don't forget to drop a Like ❤️

And also, help me reach **1k Subscribers** 🤩, on my [YouTube channel](https://www.youtube.com/channel/UCCO4jIqmQVFDmVeeaAO5obA).

Happy Coding! 😃💻
Today I launched the MVP of my first digital product.
Tags: startup, react, nextjs, help
Published: 2022-01-08 11:38:14

As a founder trying to get into an accelerator or incubator, I have spent hours filling out dozens of forms and sending cold emails. The statch(my product) was born with the goal of solving these problems and making the process much more efficient and faster.

Link of the MVP: https://thestatch.com/
I did it with Blitzjs whihc is a kind of Ruby on Rails but with Nextjs and Prisma for the database. For the styles I mostly used chakra-ui 

I have a lot of functionalities in mind, but I wanted to keep it simple for the MVP. I would really appreciate your feedback and comments on The statch.
The Ultimate Guide to User & Permissions Management in GNU/Linux
Published: 2022-01-08 11:37:54

Create new user
`sudo adduser newuser`

NOTE: Creating a new user also creates a group by the same name known as the primary group

Change user password
`sudo passwd newuser`

Grant user admin privileges
`visudo`
with unlimited root access
`newuser ALL=(ALL) all`

with restricted access
`Cmnd_Alias ADMIN1PRIVILEDGES = /usr/bin/adduser, /usr/bin/usermod, /usr/bin/addgroup`
`newuser ALL=(root) ADMIN1PRIVILEGES`

Change user home directory
`usermod --home /home/newuser newuser`

Change user shell
`usermod --shell /bin/sh`

Add descriptive comment to user
`usermod --comment "Here is a new demo user" newuser`

Add an account expiry date
`usermod --expiredate 2022-12-31 newuser`

Lock account
`usermod --lock newuser`

Unlock account
`usermod --unlock newuser`

Add a password change policy of 60 days
`change --maxdays 60 newuser`

Delete user account
`deluser newuser`

Delete user with all files
`deluser -r newuser`

Create a group
`addgrop newgroup`

Delete a group
`delgroup newgroup`

Add a user to a group
`usermod -aG newgroup newuser`

Remove a user from a group
`deluser newuser newgroup`

Change file owner to a user
`chown newuser file1.txt`

Change file group to a group
`chgrp newgroup file1.txt`

Change file permissions
`chmod a+rwx file1.txt	//give read+write+execute to all`
`chmod u+rwx file1.txt	//give read+write+execute to owner`
`chmod o-w   file1.txt	//remove write access from others different from file owner and group`

Or, in the octal form:
`chmod 755 file1.txt	//equivalent to u+rwx, g+rx, o+rx`

permission bits | binary | octal
--x		               001	   1
-wx		               011	   3
rwx		               111	   7
r-x		               101	   5
rw-		               110	   6
r--		               100	   4
-w-		               010	   2

To prevent a user from deleting files owned by other users, set the sticky bit on the directory
`chmod o+t directory1`

To enable others to access the file with the same permission as the owner
`chmod u+s file1.txt 	//apply the setuid bit`

To enable others to access the file with the same permission as the group
`chmod g+s file1.txt	//apply the setgid bit`
Grow Your Network on LinkedIn
Published: 2022-01-08 11:12:18

---
title: Grow Your Network on LinkedIn
published: true
description: 
tags: 
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wu831t51wx4p6l4kyyv1.jpg
---
I'm about to cross 6,700 connections on LinkedIn.

LinkedIn has helped me from the very beginning and I'm glad that I created my account in 2016.

I learn a lot during my time on LinkedIn, meet with great minds on this platform, and also received 100+ job opportunities on LinkedIn.

Here are a few tips to grow your LinkedIn account:

0) Build your profile; add a cool tagline and description, keep your experience, skills, volunteer, and projects, your profile should be up to date.

1) Increase your connections by searching professionals based on their designation i.e Write HR in the search box and you will get all HR's add them first to get noticed.

2) Select your target audience i.e If you are a programmer and tech content creator like me then you should add more and more programmers. 

3) Repeat tip # 1 above with keywords i.e Programmers, Software Developers, Software Engineers, etc.

2) Be consistent, Post daily. If you are a programmer like me you can try the #100daysofcode challenge.

3) Post native content, Write posts, articles and upload videos directly to the LinkedIn platform. 

4) Don't share links to redirect your audience from LinkedIn to any other platforms like Facebook, Instagram, etc. Share your post here and build an audience here which will automatically increase the audience on other platforms, Or you can share links in comments instead of within posts.

5) Try to be more engaged in comments, Reply to each and every 
comment on your profile, also write comments on others' posts. 

6) Try to be more engaged in messages, Reply to each and every message which you receive on LinkedIn.

7) Endorse your colleague's skills, recommend them and ask them to endorse your skills as well.

8) Whatever skill you add to your profile try to pass the test on LinkedIn so that you can get a badge. 

9) Pinned top 3 skills within your LinkedIn profile skills section.

10) Use the power of hashtags, and add 3 hashtags maximum per post and create a new one for yourself also i.e Check my hashtag #slimcoder.

11) Be kind and professional.
Como a SQL lida com valores NULL
Tags: sql, postgres, database
Published: 2022-01-08 11:11:07

Durante meus estudos direcionado para questões de projeto e implementação de banco de dados, encontrei algo bastante interessante e que seria legal compartilhar. A SQL tem diversas regras e abordagem para lidar com valores NULL e que se dividem da seguinte forma:

- **Valor desconhecido** (existe, mas não é conhecido);

A data de nascimento de uma pessoa não é conhecida, e por isso é representada por NULL no banco de dados.

- **Valor não disponível** (existe, mas é propositalmente retido);

Uma pessoa tem um telefone residencial, mas não deseja que ele seja listado, por isso ele é retido e representado como NULL no banco de dados.

- **Valor não aplicável** (o atributo é indefinido para essa tupla);

Um atributo Conjuge seria NULL para uma pessoa que não fosse casada, pois ele não se aplica a essa pessoa.

Link do post original: 
https://andersonnsilva.site/post/como-a-sql-lida-com-valores-null
8 Easy-to-Follow Steps to Set Up Your Portable Container for A Move!
Tags: packersandmovers
Published: 2022-01-08 11:05:57

Moving containers or portable storage units – by whichever name you call it, has completely changed the way people think about relocations. Today, the situation is not the same as it was years ago! Several packing and moving companies have come up with these unique truck (container) + storage options – both in one business model and have named it – either – smart cubes, smart containers, portable storage units, etc [Packers And Movers](http://packersmoverss.com) | Packers And Movers Gurgaon | Packers And Movers Delhi | Packers And Movers Noida | Packers And Movers Ghaziabad | Packers And Movers Ahmedabad | Packers And Movers Surat | Packers And Movers Jaipur
File Sharing Application using MongoDB Atlas
Tags: atlashackathon
Published: 2022-01-08 10:34:00


[Instructions]: # (To submit to the MongoDB Atlas Hackathon on DEV, please fill out all sections.)


### Overview of My Submission
**File Sharing Application** ease us to send files via Email service and very fast and reliable due to the Tech-Stack that is used.


### Submission Category: 

*Choose Your Own Adventure*


### Link to Code

*`https://github.com/Tejender1521/inshare-file-shareing-app`*


### Additional Resources / Info
#### Link to Application
*`https://inshare-file-shareing-app.herokuapp.com/`*

#### Tech-Stack Used
MongoDB Atlas
Vanilla Javascript
Node.Js
Mongoose
Express.Js
Nodemailer
Multer


![Entry Point for the Application](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/49x6uvq6ceyw3t719tf9.png)

![After upload Email Application Page](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nc1dkqwdoq0j9olw8xir.png)

![Download Page](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ci7g8x803j7y56cdcv5z.png)
Amaya: an easy and fast way to create a REST API
Published: 2022-01-08 10:22:28

I present to your attention a new open source web framework for Java called Amaya. It is lightweight, guarantees flexibility and ease of use. It will provide you with everything you need to work and allow you to easily change the behavior of the main components. It was created not only to avoid redundant and interfering abstractions, but also as a convenient basis for creating plugins with various functionality, so you can easily add the missing functionality in the form of an additional library. At the moment, the project is actively developing and needs your feedback. Check it out: https://github.com/AmayaFramework/amaya-core
Learn useState In 7 Minutes - React Hooks Explained 
Tags: react, javascript, webdev, beginners
Published: 2022-01-08 10:14:23

Today we are going to learn about the state in React i.e. Hooks

Why hooks? When to use all this we will cover.

**Rules of Hooks**
Hooks are JavaScript functions, but they impose two additional rules:

1. Only call Hooks at the top level. Don’t call Hooks inside loops, conditions, or nested functions.
2. Only call Hooks from React function components.

For tutorial you can refer

{% youtube _LXjag70cog  %}
Generate Intervals of Time - laravel
Tags: laravel, php, programming, beginners
Published: 2022-01-08 10:00:07

Let's get started quickly. I found This article :- https://laravel-news.com/laravel-hours-helper that explains the use of Laravel Hours Helper and wanted to share this fun with you.
With the Laravel Hours Helper package :-https://github.com/Label84/laravel-hours-helper
you can create a collection of dates and/of times with a specific interval (in minutes) for a particular period.
```php
use Facades\Label84\HoursHelper\HoursHelper;
 
$hours = HoursHelper::create('08:00', '09:30', 30);
/*
=> Illuminate\Support\Collection {#3529
       all: [
           "08:00",
           "08:30",
           "09:00",
           "09:30",
       ],
   }
*/
```
This helper could be useful in generating dropdown selections for a calendar meeting invite or scheduling the duration of an event. This helper also allows you to define the date formatting for each interval of time
```php
$hours = HoursHelper::create('11:00', '13:00', 60, 'g:i A');
/*
Illuminate\Support\Collection {#3528
    all: [
        "11:00 AM",
        "12:00 PM",
        "1:00 PM",
    ],
}
*/
```
this helper can deal with intervals past midnight (i.e., the next day) and over multiple days
```php
HoursHelper::create(
    '2021-01-01 22:00',
    '2021-01-03 13:00',
    60,
    'Y-m-d H:i'
);
/*
Illuminate\Support\Collection {#3566
    all: [
        "2021-01-01 22:00",
        "2021-01-01 23:00",
        "2021-01-02 00:00",
        "2021-01-02 01:00",
        "2021-01-02 02:00",
        ...
    ]
}
*/
```
I hope you enjoyed the code.
How do I get my money back from cash App? Ways to Money Back
Published: 2022-01-08 09:57:36

Want to know [**How do I get my money back from cash App?**](https://www.cash-apphelps.com/blog/how-do-i-get-my-money-back-from-cash-app/) Getting a Cash App refund after making an unwanted payment can be very difficult and the company offers no guarantee on it. If you’ve been wondering to know how to get your money back from Cash App, then follow the link provided in this section and go through the ins and outs.
Show country emoji with elixir
Tags: elixir
Published: 2022-01-08 09:57:16

Recently [jorik](https://dev.to/jorik) [posted](https://dev.to/jorik/country-code-to-flag-emoji-a21) about converting country code to flag emoji. I decided to give it a try in elixir.

My first attempt:

```elixir
defmodule Flags do
  @flag_offset 127397
  def get_flag(country_code) do
    country_code
    |> String.upcase()
    |> String.split("", trim: true)  
    |> Enum.map(fn <<string::utf8>> -> <<(string + @flag_offset)::utf8>> end)
    |> Enum.join("")
  end
end

~w(us gb de pl) |> Enum.map(&Flags.get_flag()/1) |> Enum.join()
"🇺🇸🇬🇧🇩🇪🇵🇱"
```

But can it be simplified? Sure it can:

```elixir
defmodule Flags do
  @flag_offset 127397
  def get_flag(country_code) when byte_size(country_code) == 2 do
    <<s1::utf8, s2::utf8>> = String.upcase(country_code)  
    <<(s1 + @flag_offset)::utf8, (s2 + @flag_offset)::utf8>>
  end
  def get_flag(country_code), do: country_code
end

~w(us gb pl US) |> Enum.map(&Flags.get_flag()/1) |> Enum.join()
"🇺🇸🇬🇧🇵🇱🇺🇸"

```
Will Cash App refund money if scammed? Get Detailed Answer
Published: 2022-01-08 09:56:50

Want to know [**Will Cash App refund money if scammed?**](https://www.helpscashapp.net/blog/how-do-i-get-a-refund-if-i-was-scammed-on-cash-app/) If a potentially fraudulent payment occurs, then the cash app cancels it to prevent you from being charged and your funds will also get returned to your linked account. Getting more accurate details about refund money on the cash app then one needs to follow the listed link on this section which will redirect you to know everything in a clear way.
Confirm dialog not working on Firefox Quantum
Tags: react, jsx, confirm
Published: 2022-01-08 09:52:09

Want to implement a comfirm dialog that appears before user changes tabs or closes the browser window.

The code below (ch5.8 of book React Quickly) worked to display a confirmation dialog on old browsers but not on Firefox Quantum browser - can someone help:

index.html:

```
<!DOCTYPE html>
<html>

  <head>
    <meta content="text/html;charset=utf-8" http-equiv="Content-Type">
    <script src="js/react.js"></script>
    <script src="js/react-dom.js"></script>
  </head>

  <body>
    <div>
      <div id="content"></div>
      <script src="js/note.js"></script>
      <script src="js/script.js"></script>
    </div>
  </body>

</html>
```

script.jsx:

```
let secondsLeft = 5
let seconds = secondsLeft.valueOf()

let interval = setInterval(()=>{
  if (secondsLeft == 0) {
    ReactDOM.render(
      <div>
        Note (object) was removed after {seconds} seconds.
      </div>,
      document.getElementById('content')
    )
    clearInterval(interval)
  } else {
    ReactDOM.render(
      <div>
        <Note secondsLeft={secondsLeft}/>
      </div>,
      document.getElementById('content')
    )
  }
  secondsLeft--
}, 1000)
```

note.jsx:

```
class Note extends React.Component {
  confirmLeave(e) {
    let confirmationMessage = 'Do you really want to close?'
    e.returnValue = confirmationMessage     // Gecko, Trident, Chrome 34+
    return confirmationMessage              // Gecko, WebKit, Chrome <34
  }
  componentDidMount() {
    console.log('Attaching confirmLeave event listener for beforeunload')
    window.addEventListener('beforeunload', this.confirmLeave)
  }
  componentWillUnmount() {
    console.log('Removing confirmLeave event listener for beforeunload')
    window.removeEventListener('beforeunload', this.confirmLeave)
  }
  render() {
    console.log('Render')
    return <div>Here will be our input field for notes 
      (parent will remove in {this.props.secondsLeft} seconds)</div>
  }
}
```