teleren/devto huggingface dataset:
Best Practice to Use API Resource Collection in Laravel

Tags: laravel, apiresources
Published: 2021-11-30 13:37:47

This tutorial shows how to use Laravel API resources feature to build a REST API. API resources were introduced in Laravel 5.5. Before the introduction of API resources, we often used a package like fractal as a transformation layer to output JSON responses when building REST APIs. So, in this tutorial, I’ll be showing how to build a robust API in Laravel using API resources.

[Best Practice to Use API Resource Collection in Laravel](https://www.codecheef.org/article/best-practice-to-use-api-resource-collection-in-laravel)
10 ICP（About $400） Bounty for Developer  
Tags: flutter, blockchain, rust, dart
Published: 2021-11-30 13:25:00

task: @Astrox_Network's "agent_dart" api doc
link:https://github.com/AstroxNetwork/agent_dart/issues/13

Context:
To have better understanding of internet computer, for client developers, it is the best way to understand how the sdk works.

Though we have ported most agent-js features to agent_dart, we don't have enough resources to complete the api docs. Which is really important work for community developers.

Thus, we need to cover as many apis as possible, we need someone to comment on code like we do for dart code.
WHY BINANCE GONNA RULE
Tags: blockchain
Published: 2021-11-30 13:08:01

#1 
The third biggest cryptocurrency with a market cap 104Bn $ just after Etherium and Bitcoin
#2
A rich and dynamic plateform, spot futures staking airdrops and mote
#3 
Is backed by china so ..dont be afraid of an exit scam


To download the Binance app:
https://accounts.binance.me/en/register?ref=333065073

Stay tuned on more ways to strive in the crypto world
Overview - The C in PHP stands for Christmas 🤶🎅
Tags: php, webdev
Published: 2021-11-30 12:59:43

_"The C in PHP stands for Christmas"_ is an article-series about the PHP language in 24 episodes. We will cover the origins of PHP, the core features and some interesting open source projects. On our journey we will find the true meaning of Christmas! **Ho-ho** 🤶🎅🎄🎁🎉🐘

The series starts on **December 1st** and ends on **Christmas Eve**. Each article will be about a single subject, and a couple of minutes to read. I hope you will learn something, and if not, I hope you can educate me and others along the way. But most of all, I wish you a merry journey! **💻🐘** 

Best wishes,
Anders

*PS. Dear Santa, I wish for snow and woolly mammoths please!*🎁  
*PPS. Also, I welcome anyone to comment. Remember that Santa has an eye on this now, so keep it civilized!*
Should you ever Collab??
Tags: disc
Published: 2021-11-30 12:43:25

So here is today's question
# Should you ever Collab??


We wil cover it in 2 points


## YES

It gets you know new things, gather knowledge, and makes you happy with people. It's relaxig as sometimes you talk and releax with friends. It evn helps you get a collaborative job!!


## NO

Well bad collaboration = bad work.


# SO THE ULTIMATE CONCLUSION IS COLLABORATION IS GOOD!! 😀😀
Appwrite & Appsmith: The perfect open-source duo for your business apps
Tags: appwrite, appsmith, lowcode, nextjs
Published: 2021-11-30 12:35:00

{% youtube uENmCvSusMI %}

Last week, we at **Appwrite** collaborated with the **Appsmith** team to showcase how businesses can leverage both of these amazing open source solutions to build apps and dashboards faster and better 🥳. We had an amazing session where [**Matej**](https://github.com/Meldiron) and [**Confidence**](https://github.com/cokoghenun) showcased the capabilities of these platforms by building a demo application for our audience! LIVE!! 😍

{% github Meldiron/appwrite-appsmith-demo no-readme %}

If you have any further questions or simply want to hang out with some awesome open source geeks, you can **join the Appwrite team and community** on [**our Discord server**](https://appwrite.io/discord)💝.
PHP snippet #007
Tags: php, programming
Published: 2021-11-30 12:21:23

``` php
$stairs = [];

$stairs['_'] = '👾';
$stairs[]['_'] = '👽';
$stairs[][]['_'] = '🤢';
$stairs[][][]['_'] = '🥴';
$stairs[][][][]['_'] = '😓';
$stairs[][][][][]['_'] = '😑';
$stairs[][][][][][]['_'] = '😗';
$stairs[][][][][][][]['_'] = '😎';
```
Parallex Effect in CSS!
Tags: html, css, tutorial
Published: 2021-11-30 11:42:51

Hey **fellow creators**,

Learn how to do a *parallex effect in CSS* in less than a minute! 
 
If you prefer to watch the video **version**, it's right here :

{%youtube TqF45C7mpZg%}

##1. The HTML structure.

Create three sections that contain a title each:
```html
<section class="s1">
	<h2>SECTION 1</h2>
</section>

<section class="s2">
	<h2>SECTION 2</h2>
</section>

<section class="s3">
	<h2>SECTION 3</h2>
</section>
```

##2. Style each section.

Make sure each section takes up the full height of the viewport and that the background covers the whole space and is centered:

```css
section {
	height: 100vh;
	background-size: cover;
	background-position: center;
	display: flex;
	justify-content: center;
	align-items: center;
}
```

##3. Style the titles.
Style the titles however you want, here's how I did it:

```css
section h2 {
	text-align: center;
	background: #F1F1F1;
	padding: 20px;
	font-size: 55px;
	font-weight: 200;
}
```

##4. Add the background images.

Add your assets to a folder and then add them as backgrounds to each section:

```css
.s1{
	background-image: url(imgs/img1.jpg);
}

.s2{
	background-image: url(imgs/img2.jpg);
}

.s3{
	background-image: url(imgs/img3.jpg);
}
```

##5. Add the parallex effect.

In the section styling, add a background-attachment: fixed so that each image are fixed to the background of the different sections.

```css
section {
	background-attachment: fixed;
}
```

Now if you scroll down your app, you'll see that each image wipes out the one above or below it!

You can now create a simple *parallex effect in pure CSS* in under a minute ;)

Come and take a look at my **Youtube channel**: https://www.youtube.com/c/TheWebSchool

*See you soon!*

Enzo.
Scrimba JavaScript course
Tags: javascript, webdev, beginners
Published: 2021-11-30 11:59:31

So I completed this free JavaScript course by Per Harald Borgen from Scrimba to brush up my JavaScript knowledge before I start with React (from Scrimba again 😌)

This course was a breath of fresh air as I was drowning in tutorial hell, unable to gain practical knowledge and confidence, which the interactive 'scrims' provide; it's genuinely an awesome feature, keeps me attentive and interested.

Per was very encouraging and explained everything very well, all the mini tasks were perfectly challenging and full of learning. I think this is the first ever course on the internet that I have completed 🤣, and I think we all can relate with this.

Here's the link of the course: https://scrimba.com/learn/learnjavascript

Along the course, we developed 3 simple apps:

1. Subway Passenger Counter
2. Blackjack Casino Game
3. Chrome Extension (to save leads/tab URL)

And covered the following concepts:

1. const & let
2. strings
3. numbers
4. booleans
5. objects
6. arrays
7. functions
8. methods
9. for loops
10. logical operators
11. mathematical operators
12. JSON
13. Math object
14. DOM manpulation
15. getElementById()
16. querySelector()
17. addEventListener()
18. innerText
19. textContent
20. innerHTML
21. conditional statements
22. truthy vs falsy values
23. template strings
24. localStorage
25. debugging with Google

**PS: Finally wrote my first ever blog, because Per told me to do so at the end of this course** 😎
How run background python scripts in Linux
Tags: linux, python, aws, googlecloud
Published: 2021-11-30 11:54:20

Let a python script running in linux server with no worries

It's simple just open your terminal in Linux and use the command and close the terminal

`nohup python3 -u yourpythonfile.py > out.out`

the argument "> out.out" will create the log file in the same folder that you run that command and when you open the terminal again to check how is the script you can use this command:

`nano out.out`

Now if you are using Google Cloud or AWS virtual machines, and you would like to shut down the machine after the execution to **avoid extra costs $$** you can use this command:

`nohup bash -c python3 -u yourpythonfile.py ; sudo shutdown -h now > out.out &﻿`


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kydhp22w2v7qgj2h6hyl.gif)
Flutter Starter Project, the Easy Way
Tags: flutter, dart, starter, cli
Published: 2021-11-30 11:42:12

When starting our application with Flutter, we usually use a default project from the following Flutter command.

```bash
flutter create myapp
```

These default project is more than enough for a newcomer who just starting to learn development with Flutter.

However, for some who are on their journey to build a real production-ready application, this default feels a little too simple. This is where a starter project comes in.

## Starter Project 

Starter project is a template that we use to structure our new project. 

It's usually comes with boilerplate code so we don't need to repeat ourselves (DRY) each time we start a new project. 

There're many starter projects for Flutter that we can find at Github. 

Most of it comes as a standalone repository that we can copy via `git clone` or download manually (and then setup all the necessary changes to fulfill the needs of our new app).

Most of these starter project also comes with a predefined state management that we have to use in the new project. They don't give enough freedom to choose our preferred state management from the start.

This is where [F](https://pub.dev/packages/f) comes it.

## F

Started as a simple CLI package to be used as an alternative for Flutter CLI. In its new version, F is now equipped with a command that we can use to create a starter project in Flutter.

https://pub.dev/packages/f
https://github.com/salkuadrat/f

It's as simple as using these command:

```
f s myapp
```

By default `f s` command will generate a starter project with Provider. But, if we want a project with other state management (BLoC, Cubit, GetX, or Riverpod), feel free to specify it in the command.

```
f s --bloc myapp

f s --cubit myapp

f s --getx myapp

f s --riverpod myapp
```

You can explore the examples to see the structure of starter project generated by `f s` command.

[starter_bloc](https://github.com/salkuadrat/f/tree/master/starter_bloc)
[starter_cubit](https://github.com/salkuadrat/f/tree/master/starter_cubit)
[starter_getx](https://github.com/salkuadrat/f/tree/master/starter_getx)
[starter_provider](https://github.com/salkuadrat/f/tree/master/starter_provider)
[starter_riverpod](https://github.com/salkuadrat/f/tree/master/starter_riverpod)

It's simple and flexible.

The goal is to make our journey with Flutter becomes better... more smooth, more comfortable, and more enjoyable.

Try it out and let us know what you think.

~ Happy Coding
My first post on dev.to
Tags: devto
Published: 2021-11-30 11:23:42

Header
===
Sub-header
---

![Some text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h49cx7naos9079q5mxzm.png)

### Context
1. About dev.to
1. How to post in dev.to
1. My opinion


![Some text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h49cx7naos9079q5mxzm.png)

[Ilmhub.uz](https://oj.ilmhub.uz "ilmhub")
Show Latest Blog Posts in Twitter Header with GitHub Actions
Tags: actionshackathon21, githubactions, node, twitter
Published: 2021-11-30 11:16:31

I like writing about my dev journey.

Wouldn't it be great if you could show off your latest blog posts in my Twitter header automatically?

This way you could better showcase what you're about. People visiting your Twitter profile will know right away if they should or shouldn't leave a follow.

### My Workflow

My GitHub [workflow](https://github.com/zwacky/zwacky/blob/main/.github/workflows/twitter-header-blog-posts-workflow.yml) that uses my GitHub [action](https://github.com/zwacky/twitter-header-blog-posts-action).

This `twitter-header-blog-posts-action` GitHub Action is responsible for doing the following:

- Fetch last 3 blog posts from your blog
- Draw fetched blog posts titles onto header
- Draw any text onto header
- Draw any images onto header
- Use Twitter API to upload your dynamic banner

### Submission Category:

Maintainer Must-Haves / Wacky Wildcards

### Yaml File or Link to Code

In this posts cover image you see my Twitter header that I created with this action. Checkout the following workflow.yml I used to create it:

```yml
name: Update Twitter header with latest blog posts
on:
  schedule: # Run workflow automatically
    # This will make it run twice a day (06:00 and 18:00)
    - cron: 0 18 * * *
    # Run workflow manually (without waiting for the cron to be called), through the Github Actions Workflow page directly
  workflow_dispatch:
jobs:
  udpate-twitter-blog-posts:
    name: Update Twitter header with latest blog posts
    runs-on: ubuntu-latest
    steps:
      - uses: zwacky/twitter-header-blog-posts-action@main
        with:
          BLOG_RSS: https://dev.to/feed/zwacky
          DRAW_TEXTS: '[["h1", "Hey, I''m Simon", 125, 100], ["h1", "My latest blog posts", 835, 70], ["h1", "Follow   and say hi!", 545, 390], ["p", "I tweet about webperf, javascript,", 125, 177], ["p", "my learnings and books.", 125, 212]]'
        env:
          TWITTER_API_KEY: ${{ secrets.TWITTER_API_KEY }}
          TWITTER_API_SECRET: ${{ secrets.TWITTER_API_SECRET }}
          TWITTER_ACCESS_TOKEN: ${{ secrets.TWITTER_ACCESS_TOKEN }}
          TWITTER_ACCESS_SECRET: ${{ secrets.TWITTER_ACCESS_SECRET }}
```

See the [how to use](https://github.com/zwacky/twitter-header-blog-posts-action#how-to-use) section to get a step-by-step guide how to obtain Twitter API credentials and more.

See the [input docs](https://github.com/zwacky/twitter-header-blog-posts-action#inputs) to see what customisation is available.

### Additional Resources / Info

- [goodreads-profile-workflow](https://github.com/zwacky/goodreads-profile-workflow): Another GitHub Action I created—also for dev bloggers!
- Check my Twitter [@zwacky](https://twitter.com/zwacky) to see the result!
- Check out [Erika's action](https://dev.to/erikaheidi/dynamic-twitter-header-images-with-dynacover-github-action-35nb) that lets you show your latest followers in your Twitter header—Sweet!
Creating the stack which can execute in two subscriptions/providers
Tags: pulumi, csharp, azure
Published: 2021-11-30 11:11:19

Problem statement : If your pulumi stack has to be executed in two subscriptions you can use the below steps.

Example 
Subscription 1 : Resource Group, Appservice/Azure Function, Storage account
Subscription 2 : API Management , API , Policy.

For executiing the stack we will be connected to the subscription. 

Code snippet 1 creating an APIPolicy using Pulumi Classic : 

Getting the subscription details into a provider.

using AzureClassic = Pulumi.Azure;

  var apimsubscription = new AzureClassic.Provider("apimsubscription", new AzureClassic.ProviderArgs()
        {
            SubscriptionId = "###provide your subscription details"
        });

Now we have created the provider, we then need to use this for any resources we want to deploy to that subscription. To do this, we use the “CustomResourceOptions” section to set this.

// api.Name is derived from the variable that you created the API,APIM name is the API management name, rgID is the resource group name, xml content is the policy that you need to apply.

var ApiPolicy = new AzureClassic.ApiManagement.ApiPolicy("" + stackName + "ApiPolicy", new AzureClassic.ApiManagement.ApiPolicyArgs
        {
            ApiName = api.Name,
            ApiManagementName = APIM.Name,
            ResourceGroupName = rgid.Name,
            XmlContent = apipolicy,
        }
        , **new CustomResourceOptions() { Provider = apimsubscription }**
        );

// Custom resource option is the code snippet which derives this block of code to use the other subscription.

Code snippet 2 using pulumi native :


 var apimnativesubscription = new Pulumi.AzureNative.Provider("apimsubscription", new Pulumi.AzureNative.ProviderArgs()
        {
            SubscriptionId = "### please provide the subscription details"
        });

var ApipolicyNative = new Pulumi.AzureNative.ApiManagement.ApiPolicy("apiPolicy", new Pulumi.AzureNative.ApiManagement.ApiPolicyArgs
        {
            ApiId = apiBanking.Name,            
            ResourceGroupName = rgid.Name,
            Value = apipolicy,
        }
        , **new CustomResourceOptions() { Provider = apimnativesubscription }**
            );

Note : Subscription derived through classic method should be used only for classic and the same applies for native.
Other wise we will get an error: Resource type azure:apimanagement/api:Api not found
🧰 Setting up your username and email in Git at your first dev job
Tags: github, git, beginners, codenewbie
Published: 2021-11-30 10:37:15

![Before and after example with image and name from profile](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dub8lvb336t4xu0o4nf3.png)


One of the things I had to do when getting my first job was configuring Git. Unless you setup your name and email address Git will take it from the environment. This is important because every Git commit uses this information and if it's not setup correctly it will not be linked to your Github account. Hence if you have a profile picture it won't show.


There are 2 ways to do it:

**1. Globally**

Open the command line and run the following commands with your name and email.

To setup your username:
```
$ git config --global user.name "Stefi Rosca"
```

To setup your email:
```
$ git config --global user.email "stefi.rosca@me.com"
```

In this case you only have to do it once and Git will always use this information for anything you do on that system.

**2. Repository-specific**

From the command line, change into a repository directory where you want to make this change and then run the commands as below.

To setup your username:

```
git config user.name "Stefi Rosca"
```

To setup your email address:

```
git config user.email "stefi.rosca@me.com"
```

To test that you set it up correctly you can run in your in a specific Git terminal `git config user.email`.

Make sure you change the name and email in the example above to yours. 



For more information check out chapter on Getting Started from the [Pro Git book](https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup)
Kusk Gateway - Configuring Ingress with OpenAPI
Tags: kubernetes, openapi, ingress, swagger
Published: 2021-11-30 10:26:46

Hello everyone!

We at Kubeshop have been investigating the feasibility of having an ingress controller that's configured using OpenAPI rather than Ingress resources.

Would this be something of interest to you?

The idea is that it will be completely self service for developers when updating the configuration that powers ingress.

Our thought process was basically OpenAPI is great for describing your API, so why not use it for also describing how these services are exposed to the world?

We developed an alpha open source product that implements this idea and are looking for people to evaluate it and give feedback. We have a handy example that takes ~10 minutes to get up and running for you to evaluate against.

We're quite proud of what we managed to make it do thus far - instead of copying and pasting the current features here, I will just link to a blog post we wrote which goes into more detail.

https://kubeshop.io/blog/configure-ingress-with-openapi

We also have official documentation [here](https://kubeshop.github.io/kusk-gateway/) and you can check out the repo on Github [here](https://github.com/kubeshop/kusk-gateway/)

We would greatly appreciate any feedback we receive and will allow us to develop it further to better suite the community.
Flow chart diagramming tool
Tags: react, typescript, diagramming, productivity
Published: 2021-11-30 10:24:18

Today, I launched free online flow chart diagramming tool at https://flow.lakshmikanth.com

I am working on developing a no-code/low-code platform. As part of this solution, I required diagramming app to develop workflow like AWS Step functions.

During the development, I realised that this can be stand-alone tool to help us to develop process flows, mockups etc.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qt9mf2379vj9s7galigs.png)

I decided to open this tool to public access - mainly to understand the interest and to gain experience :-)

Feel free to try at [https://flow.lakshmikanth.com](https://flow.lakshmikanth.com). Your feedback are most welcome.
React native debug the release build of the application from a smartphone
Tags: reactnative, javascript, android, ios
Published: 2021-11-30 10:13:48


<br/>
  <p align="center">
    <img src="https://github.com/iGroza/mobile-app-debugger/raw/master/example/img/example-1.gif" alt="App Debugger client gif example" width="300">
  </p>
<br/>

Hello everyone! I have developed an interesting tool for RN, the main feature is that you can catch errors and crashes in the release build of the application.
If anyone is interested, here are the links:

[NPM package](https://www.npmjs.com/package/mobile-app-debugger)

[Android client GP](https://play.google.com/store/apps/details?id=ru.kirillag.mobileappdebugger)

iOS client (coming soon..)
The Project Euler
Tags: picolisp, mathematics
Published: 2021-11-30 10:08:46

This series will be about the tasks from the [Euler Project](www.projecteuler.net), which is a a project page for mathematical riddles with increasing difficulty. 

After signing up, you can upload your solutions in order to get credits. At the moment there are 725 riddles at 29 levels (25 riddles per level). As you can see, the first task has been solved by almost a Million people (the last one not even by 500...). 

![eulertasks.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1632209394867/MfIKAht9W.png)

The Euler Community permits sharing the results for task 1-100. 

---------------------------------

All of the tasks can be solved on a normal PC within a few minutes if the algorithm is implemented correctly. Many of the tasks have a little twist, meaning that they could be implemented in a straightforward way, but also in a more interesting, "smart" way. 

The roots of functional programming lie in the algorithmic computation of mathematical problems, so it's not surprising that PicoLisp often enables us to write extremely concise and short code in order to solve these tasks. Similarly to the [Rosetta code series](https://picolisp-blog.hashnode.dev/series/rosetta), the main purpose of this series is to get more familiar with PicoLisp and its syntax and concepts.

When we find some interesting functions, we will pick them up for deeper discussion in the ["PicoLisp Explored"](https://picolisp-blog.hashnode.dev/series/intermediate) Series. 

------------------------------------

![mathematical_symbol_fight.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1632210303235/UUvTm4Faf.png)

Well, that's the plan! 

If you want to prepare, here is the [task for tomorrow](https://projecteuler.net/problem=1):

> If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.

> Find the sum of all the multiples of 3 or 5 below 1000.


---------------------------------

# Sources
https://projecteuler.net  
https://imgs.xkcd.com/comics/mathematical_symbol_fight.png