teleren/devto huggingface dataset:
A better way to fund OSS
Tags: opensource, javascript, typescript
Published: 2019-12-02 20:00:42

Hi everyone! 😄

For the past year, I've been trying to make it easier for OSS devs to earn sustainable funding.

I'm very proud to be working on [Saasify](https://github.com/saasify-sh/saasify), a platform which enables devs to monetize open source projects via serverless APIs. 😍

**Our mission at Saasify is to provide sustainable funding for open source.**

---

![How Saasify Works](https://thepracticaldev.s3.amazonaws.com/i/03214uqdsqv00tfksen3.png)

---

If you've ever struggled to make a living working on open source, I hear you.

OSS can be extremely powerful and rewarding, but there is a huge problem that exists in the market between how valuable open source is to every business in existence versus how difficult it is for OSS developers to capture any of that value.

Donation platforms like Patreon and GitHub Sponsors help with a very small percentage of this problem because the business model of voluntarily giving back to OSS is inherently weak.

Contrast this with the standard SaaS API business model of paying based on usage that aligns much more naturally with how businesses actually pay for software critical to their core business needs.

Saasify is aiming to bridge the gap between this disparity by reducing the barrier to entry for developers who are interested in earning passive income via SaaS.

On a personal level, **I care deeply about the problem of OSS sustainability** and am looking to connect with other devs who feel similarly. And while Saasify won't work for every project, it's my sincere hope that it will help other independent OSS developers like myself earn passive income.

Looking forward to hearing your thoughts on Saasify && thanks for reading!
[Astuce] Connecter un utilisateur Joomla! grâce à un simple code en PHP
Tags: webdev, joomla, login
Published: 2019-12-14 21:45:25

---
title: [Astuce] Connecter un utilisateur Joomla! grâce à un simple code en PHP
published: true
date: 2019-12-02 19:35:11 UTC
tags: webdev, joomla, login
canonical_url: 
---

Salut les joomlers de l'extrême!

Juste une petite astuce pour ceux et celles qui veulent connecter un utilisateur Joomla! par code plutôt que par un formulaire.

Intéressé(e)? Poursuivons...

[Lire la suite...](/user-login-by-code)
How to safely extend your legacy code? Part I
Tags: legacycode, refactoring, testing, csharp
Published: 2019-12-02 19:16:49

Are you working with legacy code? Did you get a job to expand existing feature? Are you scared of change because the code is too fragile? Let me show you the safe way.

For the rest of article please follow the link https://medium.com/@danielrusnok/how-to-safely-extend-your-legacy-code-part-i-af98b49e913b?sk=716a3e87d3f31aa2146e9d7b3679e3d4
Django: switch from sqlite3 to mysql
Tags: django
Published: 2019-12-02 19:05:43

assume there is an existing sqlite3 db with data in django app

in command prompt: 
```
python manage.py dumpdata > datadump.json
# to export existing data into a json file
```

create a new schema in mysql server
(mysql should have been installed already)
*for my own information:* [Difference Between Schema / Database in MySQL](https://stackoverflow.com/questions/11618277/difference-between-schema-database-in-mysql)

in settings.py:
```python
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': '<schema_name>',
        'USER': 'root',
        'PASSWORD': '*****',
        'HOST': 'localhost',
        'PORT': '<port_num>',
    }
}
```

in command prompt: 
```
pip install mysqlclient
# mysqlclient is a fork from MySQLdb1 which supports python3
# both are MySQL database connector for Python
```
*more info: [What's the difference between MySQLdb, mysqlclient and MySQL connector/Python?](https://stackoverflow.com/questions/43102442/whats-the-difference-between-mysqldb-mysqlclient-and-mysql-connector-python)*


then `makemigrations`, `migrate` and finally, 

```
python manage.py loaddata datadump.json
# should return sth like "Installed 59 object(s) from 1 fixture(s)"
```
done.


#### problem shooting (not ideal but smh works)
- delete the files in 'migrations' folder (except for _\_init\_\_)
- "duplicate entry" -> drop the schema in mysql and create a new one


#### reference
- stackoverflow: [What's the best way to migrate a Django DB from SQLite to MySQL?](https://stackoverflow.com/questions/3034910/whats-the-best-way-to-migrate-a-django-db-from-sqlite-to-mysql)
- pythonanywhere forums: [Switch from SQLite to MySQL](https://www.pythonanywhere.com/forums/topic/13850/)
- a post from Nicolas Kuttler: [Migrating Django projects with fixtures](https://kuttler.eu/en/post/django-db-utils-IntegrityError-duplicate-entry/)
Lottie for React Native, iOS, and Android
Tags: reactnative, animations, lottie, mobile
Published: 2020-01-22 07:19:46

---
title: Lottie for React Native, iOS, and Android
published: true
date: 2019-12-02 18:44:08 UTC
tags: react native, animations, lottie, mobile
canonical_url: https://www.mobileframeworks.dev/lottie-animations/?ref=devto
---

 ![Lottie for React Native, iOS, and Android](https://www.mobileframeworks.dev/content/images/2019/12/lottie-airbnb.gif)

Lottie is a mobile library for Android and iOS that parses Adobe After Effects animations exported as JSON with the body moving and renders them natively on mobile! For the first time, designers can create and ship beautiful animations without an engineer painstakingly recreating it by hand.

[See Post](https://www.mobileframeworks.dev/lottie-animations/?ref=devto)
How to Make Secure HTTP Requests with Vue and Express
Tags: vue, javascript, express, api
Published: 2019-12-02 18:14:22

---
title: How to Make Secure HTTP Requests with Vue and Express
published: true
description: Learn how to build a secure Express API and make API calls to it from a Vue.js application.
tags: #vuejs #javascript #expressjs #api
---

In this article, you're going to build an Express API and then make API calls to it from an existing Vue.js application. You'll then secure this API by only allowing users who have an access token to view certain data.

[Read on 🛠](https://auth0.com/blog/how-to-make-secure-http-requests-with-vue-and-express/?utm_source=dev&utm_medium=sc&utm_campaign=vue_express/)

![How to Make Secure HTTP Requests with Vue and Express](https://cdn.auth0.com/blog/illustrations/vuejs.png)
State machine advent: Anatomy of a state machine 🤖 (2/24)
Tags: javascript, typescript, react
Published: 2019-12-02 18:06:00

A state machine is an abstract representation of possible states and their transitions. 

In this post, we'll look at the characteristics that bring about a state machine.

Each state machine must have:

* A finite number of states
* An initial state 
* A finite number of events that can cause transitions
* A finite number of transitions from one state to another

# Glossary:

**state** represents how your application behaves at any given point. 

**states** describe the set of possible states that your application can be in. 

**events** external input that is mostly sent to state machines within event handlers. 

**transitions** occur as a reaction to events and transition your current state to another state. `state + event => newState`. 

___
Tomorrow we will apply the concepts learned above to create our first state machine with XState. 🎉 


### About this series
Throughout the first 24 days of December, I'll publish a small blog post each day teaching you about the ins and outs of state machines and statecharts.

The first couple of days will be spent on the fundamentals before we'll progress to more advanced concepts.
CodeTips is Changing
Tags: meta, beginners, motivation
Published: 2019-12-02 18:05:43

---
title: CodeTips is Changing
published: true
date: 2019-12-02 18:02:04 UTC
tags: meta, beginners, motivation
canonical_url: https://www.codetips.co.uk/codetips-is-changing/
---

 ![CodeTips is Changing](https://www.codetips.co.uk/content/images/2019/12/CodeTips-Is-Changing.jpg)

Today, we're happy to announce three important changes to CodeTips.

<!--kg-card-begin: hr-->
* * *
<!--kg-card-end: hr-->
## No More Ads

We've come to the decision to remove all the Ads from CodeTips. Although we received no negative feedback, we feel they were getting in the way and we didn't think there was enough benefits to keeping them.

Instead, we've launched a [Patreon](https://www.patreon.com/realcodetips) page. If you'd like to contribute, we'd be very grateful, but there is no pressure whatsoever.

## Comment Integration

We've added Disqus integration, so you'll be able to interact with the CodeTips writers directly through their articles.

## No More Journeys

When CodeTips started, we wanted to provide a place for absolute beginners to come and learn the fundamentals of programming.

Originally, we thought the best way to do this was to create a specific "journey" that each programming language would follow. That meant that learning Go and JavaScript would follow a very similar path, and should help our readers understanding.

We are now changing that plan. We believe the articles we have already created provide a solid foundation for anybody wanting to pick up the basics, and now we're going to focus on each language individually. Our writers will now be able to create the content they want to create, for the language(s) they want to create it for. This means that our Go articles will move at a completely different pace to our Python articles, and may be on completely different topics, but we believe we'll be able to provide more quality articles this way.

Basically, we're moving towards a more traditional "blog" approach. This week you might read about Go pointers, next week you might learn the difference between the double equals (`==`) and triple equals (`===`) operators in JavaScript.

What does this mean for our readers? Hopefully this means more quality articles, on topics that you want to read about.

---

[CodeTips](https://www.codetips.co.uk) strives to help beginners, with zero or very little experience, learn to code.

We do cross-post to other sites to reach a wider audience, but why not [subscribe to our newsletter](https://mailchi.mp/92cccf7024b2/codetips) and get the newest articles straight to your mailbox? 

The original source for this content is [CodeTips](https://www.codetips.co.uk). The original content is kept up-to-date, but other sources may not be the latest version.
Alternative to the spread operator
Tags: javascript, es6
Published: 2019-12-02 17:53:10

---
title: Alternative to the spread operator
published: true
description: What is an alternative to using the spread operator when you can use ES6.
tags: javascript, ES6
---

#Alternative to the spread operator.

###TLDR: Object.assign(object, object)

I was doing some work on a serverless function and I didn't have ES6 support so I had to figure out how to supplement the spread operator. Below is an example of the spread operator with some objects that hold some food.

```
const moreFood = {
'pizza': '🍕',
 'steak': '🥩',
 
}

const food = { 'chocolate': '🍫', 'icecream': '🍦', 'pizza': 'pizza', ...moreFood }

//results

{
'chocolate': '🍫', 
'icecream': '🍦',
'pizza': '🍕',
'steak': '🥩',
}

```

One of the alternatives to the spread operator is the Object.assign function. Here is the same function using the object.assign function.

```
const moreFood = {
'pizza': '🍕',
 'steak': '🥩',
 
}

const food = { 'chocolate': '🍫', 'icecream': '🍦', 'pizza': 'pizza' }

Object.assign(food, moreFood)

//results

{
'chocolate': '🍫', 
'icecream': '🍦',
'pizza': '🍕',
'steak': '🥩',
}

```

###Side note: 
If there is a duplicate key like in the example with pizza both the spread operator and the Object.assign function both will take what the right objects says pizza is.
#7DaysJS: Reverse a String
Tags: javascript, challenge, beginners
Published: 2019-12-03 02:49:17

---
title: #7DaysJS: Reverse a String
published: true
description: Today we'll work on reversing a string, a common question on coding interviews.
date: 2019-12-02 17:43:00 UTC
tags: javascript, challenge, beginners
canonical_url: https://lautarolobo.xyz/blog/7-days-of-js-reverse-a-string/
cover_image: https://lautarolobo.xyz/images/7daysJS-7f7d8328.webp
---

Welcome to day 4 of 7 Days of JavaScript!

Today we will see how to reverse a string. It’s probably the most asked question ever on technical interviews.

So the statement is quite simple, although the problem has an unexpected complexity when you face it for the first time: write a function that takes a string and returns the string reversed.

Here’s an example:

```javascript
reverseString('Japan')
...
'napaJ'

```

Give it a try.

You can see the solutions I made [here](https://lautarolobo.xyz/blog/solution-to-day-4-of-7-days-of-js/ "Solution to day 4 of 7 days of JS").
Web apps: Battle and RPS
Published: 2019-12-02 17:20:08

This week we were looking at web apps, which involved creating an app hosted on localhost with Sinatra and tested with Capybara, using RESTful routing and MVC (Model/View/Controller structure). 

This was the week that I enjoyed the most so far, as there is something so satisfying about seeing your code come to life in a more 'physical' sense than simply running the program in IRB. Over the last few months I have been leaning heavily towards front-end development as a career path within software development, and this week was a great continuation of the knowledge I had built from my previous independent projects. 

Our afternoon challenge consisted of making a 'Battle' game, using Ruby, HTML, and some CSS. This was actually a more difficult challenge to complete than the weekend challenge. The premise was that each player attacked the other, and when they did so the opponent lost 10HP (hit points). While I completed the functionality, unfortunately I did not have time to do any CSS, so I will try and revisit this in future weeks if I have time. 

The weekend challenge was my favourite so far. We built a game of Rock, Paper, Scissors, again using Sinatra and Capybara with Ruby, HTML and CSS. This was similar to the Battle app that we did during the week.

Something that I'm struggling with and was prevalent this week is to always stick to writing my tests first, before I touch on writing any code whatsoever. Personally, I begin to understand the task so much more after I begin writing the code and it starts piecing together in my head, so only after this I know what to write tests for. This means that I accidentally start writing the code while I'm trying to work out what to test for, and before I know it, I've reversed the order that it should be done in. I have found that there are quite a few people in our cohort that have this problem. However, I discussed this with a coach on Friday who suggested 'spiking', the idea of writing a part of code first in order to know what to test for (if you're unsure), deleting it once you've worked this out, and then writing the tests. I'll try this in my future work, hopefully it'll solve my problem.
Git Revert to a Good Commit
Tags: git, github, terminal
Published: 2019-12-02 17:18:24

*This post was originally published on [my blog](https://dohoang.me/posts/git-revert-to-a-good-commit/).*

Today my co-worker asked me how to revert to an old and good commit on master ( after you accidentally merged `dev branch` to `master` ).
There are many ways to do that, for example we can use `reset` to discard all wrong commit to revert back, like `undo` when writing text. 
You can find others way on[`this topic on Stack Overflow`](https://stackoverflow.com/questions/4114095/how-do-i-revert-a-git-repository-to-a-previous-commit)
But the problem is too many options, we dont know which one is good, or even dont need to understand - it just works.

So i will introduce you my traditional way and extremely accurate.

First of all, after you did a `commit` and `merge` you should not delete commit with `git reset` (Undo) thus we want to repair it instead of delete it.

Next, in general, between any two `commit` in you git repository is a different line of codes, which you can always see wit the git `diff` command. 
Revert an old commit is to delete these different.

Suppose we are in `master` branch and we want to revert back to commit `8398e5b`. 
So you first need to `clone/checkout` *master* branch to a new clean folder ( the directory where you type `git status -u` and you see nothing there.)

```bash
$ git status -u           # make sure it is clean
$ git checkout master     # be sure you are in master
$ git diff HEAD..8398e5b  > patch.diff
```

In the last command, the order is very important.
The `commit` we want to revert to must be in the end. 
Then you apply this diff

```bash
$ patch -p1 < patch.diff
$ git status -u
```

Check if any new files have not been commited in the result of `git status -u` above, these are the files included in the old commit **8398e5b**:

```bash
$ git add some/new/files.txt
$ git commit -m "Revert to 8398e5b, thanks to @kn"
```

To be sure, check the results:

```bash
$ git diff 8398e5b..
```

This time it should appear ... nothing, that is, you have completely restored your old commit. 🎉🎉🎉

This way is always successful, simple, you can even take advantage of a few things to adjust. 
And above all, instead of having to understand a bunch of commands like `git revert`, `git reset`,... you just focus on understanding the problem of **diff, diff, and diff**
Ionic 4 Native Storage Tutorial – Storing & Retrieving Data
Tags: ionic, ionicnativestorage, storingretrievingdata, ionic4
Published: 2020-02-07 09:54:36

---
title: Ionic 4 Native Storage Tutorial – Storing & Retrieving Data
published: true
date: 2019-12-02 17:14:32 UTC
tags: Ionic, Ionic Native Storage,  Storing & Retrieving Data, Ionic 4 
canonical_url: https://www.positronx.io/ionic-native-storage-tutorial/
---

The post [Ionic 4 Native Storage Tutorial – Storing & Retrieving Data](https://www.positronx.io/ionic-native-storage-tutorial/) appeared first on [positronX.io](https://www.positronx.io).

**Today we will learn how to store data using Ionic 4 NativeStorage, We will learn how to store data on the local device in JSON or key-value pair format.**

Storing data on a user’s device is an essential task for any dev, and it is needed nearly in every web or mobile app. A user might save any data on his/her device, be it a shopping cart, user profile, app settings, user sessions, etc.

[click here to read more](https://www.positronx.io/ionic-native-storage-tutorial/)
My experience setting up a react-native environment on Ubuntu OS
Published: 2019-12-02 16:59:28

Am a few months old in to serious programming with a background in java that I recently had to change to python due to the application that was assigned to me so am busy trying to understand python and how it works and boom little did I know then I was put on the team building a react- native application , now let’s get this clear i have not done anything in java-script or ES6 nor have I done any react of sorts, yeah confusing right ? yeah I surely was. Now it reaches a time to setup a react native environment on my Intel Pentium machine. So i get access to the react-native documentation and the instructions looked pretty straight forward , so I was like let’s do this!!!! The very thing was going on awesomely until I reached the step that had Android SDK tools that’s where everything became real right before I even wrote a single line of “Hello World ” in react-native. Tried everything possible on the internet but still things were not working out for at least 5 good days straight and the fact that i was installing on an Ubuntu machine did make anything easier since there are a few documents on the same errors that I was facing trying to setup the environment. But I finally got the breakthrough at the end .
Before proceeding, be sure to install the latest version of the following on Linux ( Ubuntu 18.04):
Node (V 12.10 as of writing)
Npm (V 6.10.3 as of writing)
Android SDK tools
Yarn
Git
Genymotion
Virtual-box
others :
USB cable
Mobile phone

After installing the virtual-box and confirming that it’s up and running


Creating the environment for the Android SDK tools;
$nano/etc/profile

Confirm that Android SDK is installed run the following;
echo $JAVA_HOME
echo $ANDROID_HOME

After one has configured an environment variable called ANDROID_HOME, run the following command to accept all the licenses.
yes | $ANDROID_HOME/tools/bin/sdkmanager — licenses

In case one is using Java version 10 and above, you will have trouble running the command above.First run the;
sudo update-alternatives — config java

To downgrade the Java to Java version 8 so that you can be in a position to run the command once again to get all the SDK licenses up-to-date.

Open up two different terminals
Run react-native start
Run react-native run-android
One will notice the execution is at 99% and its stuck at app:installDebug, why!! Cause its running the Genymotion Android Tools (default). You need to change the radio-button to Use custom Android SDK tools ( put the path of your sdktools) 


walalalalalalala we got it baby and we are good to GO.
React-Native Here we come BABY!!!
Looking for a partner here!
Tags: entrepreneuriosjava
Published: 2019-12-02 16:45:26

Hello, my name is Héctor. I am from Madrid, Spain. I am currently looking for a tech partner to start a business project. The project is based on an app which will allow people to do micro investments with the chance of receiving back that amount multiplied 100000 times. 
For the app development I need a partner who can do both front and back and also can do it for IOS and Android systems.
GraphQL for PostgreSQL - Why?
Tags: discuss, postgres, database, graphql
Published: 2019-12-02 16:04:03

Hi all,

what is the main advantage of using GraphQL on top of PostgreSQL as for instance [Hasura.io](https://hasura.io/)? Instead of for instance providing a REST endpoint, which accepts POST-queries with SQL in the body. Seems to be much more straight forward and even more powerful!? Okay, type safety might be missing.

kind regards
Johannes
When Scrum Masters Aren't Leaders
Tags: agile
Published: 2019-12-02 16:01:31

We get it, being a leader in the IT world is the hardest job to have.  You are often caught between Practices and Policies that are not conducive to a good development environment.  When everything goes south, the developers feel they are in a "Toxic Environment". If you, a developer; are there now, get out.

These are the attributes of a Scrum Master who is not a true leader.

1. Expectations are over-the-top optimistic.
2. They often ask "How'd we size this User Story so wrong?"
3. Drill down charts are never looking good except maybe once or twice a year.
4. They play dumb Retro team-building games like "If you were stranded on an Island...what music would you bring?" 
5. You as a developer feel that nothing you say really matters.
6. You come out of retro meetings feeling irritated.
7. Even with Planing Poker, your accomplishments never meet expectations.
8. Collaboration? What collaboration?

There are more, but if you are seeing these things, you are officially in a can't win "Toxic Environment".  It's probably best to start looking elsewhere to save your health and sanity. 

BTW, none of these symptoms are the fault of the Scrum master wanting to make a difference and willing to collaborate with the worker-bees.  Rather this is an issue with Upper Management.

JWP2019