teleren/devto huggingface dataset:
#Azure – Azure IoT and Bicep 🦾, creating my own resources for #JulyOT
Tags: englishpost, azurefunctions, azureiot, bicep
Published: 2022-07-18 19:22:34

---
title: #Azure – Azure IoT and Bicep 🦾, creating my own resources for #JulyOT
published: true
date: 2022-07-18 16:08:48 UTC
tags: EnglishPost,AzureFunctions,AzureIoT,Bicep
canonical_url: 
---

Hi !

Last week my friend Sam helped me to understand the basic concepts of Infrastructure as a Code, and of course, we started with Bicep. You can watch the recording here:

<iframe width="750" height="422" src="https://www.youtube.com/embed/NHISJBasX-o?version=3&amp;rel=1&amp;showsearch=0&amp;showinfo=1&amp;iv_load_policy=1&amp;fs=1&amp;hl=en&amp;autohide=2&amp;wmode=transparent" allowfullscreen="true" style="border:0;" sandbox="allow-scripts allow-same-origin allow-popups allow-presentation"></iframe>

After this, I started to play around and try to figure out how to automate the creation of my required resources for most of my IoT demos. And hey, we are in July, so it’s great for JulyOT!

#### [https://julyot.dev/](https://julyot.dev/) 

During my research I found this great article that explains how to use a bicep template to create an Azure IoT Hub and a Storage Account.

#### [Quickstart: Deploy an Azure IoT Hub and a storage account using Bicep](https://docs.microsoft.com/en-us/azure/iot-hub/quickstart-bicep-route-messages?tabs=CLI)

This is almost everything I need, I only need to add an Azure Function. Again, Docs here to save me:

#### [Quickstart: Create and deploy Azure Functions resources using Bicep](https://docs.microsoft.com/en-us/azure/azure-functions/functions-create-first-function-bicep?tabs=CLI)

And reading for samples, a I did a quick merge and ended with this bicep file:

{% gist https://gist.github.com/elbruno/c515580ed14f7c97bcd25801753293c8 %}

That’s it ! In order to run it, I 1st create a resource group with the following command.

```

az group create --name blogBicepAzureIoT --location eastus

```

And this command to create all the resources

```

az deployment group create --resource-group blogBicepAzureIoT --template-file AzureIoTDemo.bicep --parameters demoName=JulyOT

```

And, after a couple of minutes, I got everything that I need in my Resource Group.

![All resources created in my resource group using Bicep.](https://brunocapuano.files.wordpress.com/2022/07/image-1.png?w=1024)

This is so cool !

Happy coding!

Greetings

El Bruno

More posts in my blog [ElBruno.com](https://www.elbruno.com).

* * *
Invest in something as developer
Tags: discuss, productivity, management
Published: 2022-07-18 16:02:21

As a developer/programmer, it is important to know what is the best thing to invest. Surely we need to invest in money and time. Well, mostly is the time because of things that we need to learn especially in technologies and master it, do project yada yada and so on.
 
Below, I'll list out the top 5 worth 'investment' that you need to do!
 
1. invest in your health
    * You have only one body and it deserves to be treated with respect. Take a deep breath everyday. Walk. See the outside world. Prioritize your health. Don't just sit and do work. You will get backpain. Surely, and it is not good. Like my boss said, at least watch something that is far from you to give your eyes a rest every hour during working. Oh, and also not to forget, mental health also is very important.
2. invest in learning resources
    * As a developer, surely you want to learn and grow technically. It is quite obvious to invest in learning resources. Don't just go and buy every resources that you think you will learn and do, but in the end, you are not using that resources. Find something that is useful and good resources
3. Invest in connection
    * It's important to have connection. Meet new people and allow your mind to be refreshed by different people's perspectives. Discuss your projects with them and inquire about theirs. It may surprise you how much of a difference it makes.
4. Invest in writing something or presenting something
    * Well, this is quite subjective. It's up to you. But as for me, when you want to write an article or presenting about something, you will do your research and reading, hence you will know more. If you don't know about something that you are reading, then you will search for it. The more you know, the more you realize you don't know. You also learn how to present your idea in a good manner so that other people will understand with what you are trying to tell.
5. Invest in reading
    * This point is like the kind of like the fourth point. At first, I don't really like reading. But what I do is, I just subscribe to newsletter that piqued my interest like technologies, tips and tricks etc. Everyday, I'll open my email, just to go through this newsletter and just quick read everything. Without I'm realising, it become a habit to me, and I tend to read more article through my phone, and tend to search more as the things that I read make me interest and want to know more.
 


Yup, that's about it. Hope this will help you to invest more for yourself and widen your knowledge!
 
If you got others, do share in the comment below!


---
Thank you for reading :D
 
Psstt pstt :p
Do consider to love this article ❤️ and follow me! Why not right? It's FREE~ 
I would really appreciate it 👨🏻‍💻 
Will be posting more on things related to AWS, Javascript, Python, Serverless and more!
How to show all subtasks in Asana
Tags: asana, javascript, webcatalog, tutorial
Published: 2022-07-18 15:55:42

Okay, so the problem is simple, and if you're reading this you already know what it is: when you open a task with lots of subtasks you have to click **Load more subtasks...**, every time...

![Screenshot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8k8uvfwa5c5hb6kb8o7i.jpg)

That's annoying, and Asana should change that. But, in the meantime, here's what you can do to beat the system.

First, download (and pay; it's worth it) [WebCatalog](https://webcatalog.io/webcatalog/) and install Asana.

![Screenshot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b1henpr8871o4kluo2ll.jpg)

Once you do that you can run asana.com in a WebApp you can launch from your Applications. Sweet.

Now, the next part is simple. Go to the settings once you load the WebApp and goto Developers > JS Code Injection...

![Gif](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7765gvakzfvj1drgqi0q.jpg)

Add the below to the code section: 
 
```js
/**
 * Automatically Open Subtasks in Asana
 *
 * Note, if you use WebCatalog, just add this to the JS code
 * injection, it works.
 *
 * Also this version checks for links to click indefinitly, vs how
 * the original only ran for 10 seconds.
 *
 * @see   https://forum.asana.com/t/allow-to-load-all-sub-tasks-at-once/43620/12 Source
 */
(function () {

	window.setInterval(() => {

		let links = document.querySelectorAll('.SubtaskGrid-loadMore');

		if(links.length === 0){
			return;
		}

		Array.from(links).map((link) => {
			link.click();
		});
	}, 2000);
})();
```

Restart the app and now, when you pull up a task, by the time you scroll down to the section for more sub-tasks it will have been expanded for you.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/451z4inki9cw03rweqzd.gif)

I would advise you take a look at the rest of the settings in the App too, and I personally use [Choosy](https://www.choosyosx.com) to open asana.com URL's in my Webapp.
Composition Over Inheritance
Published: 2022-07-18 15:47:52

I will go to the journey with you to explain some design principles to help us to organize, clean our codebase and make it more extendable and maintainable. So let's go with important concept which make our code cleaner and reusable.
What is the composition and when we should use it?
Let me explain and answer this question by example, we all love examples :)
Imagine you have super class called **Duck**

```php
class Duck 
{
    public function fly(){}
    public function quack(){}
    public function display(){}
}
```

This class has 3 normally methods and it's good for now and it works well for us until your client request a new type of duck to be added called **RubberDuck**, here you will notice the problem ?
Lets see the problem
```php
class RubberDuck extends Duck
{
    public function fly(){} // Why implement this method ?!
    public function quack(){} // also why too ?!
    public function display(){}
}
```
when you extend from parent Duck class you will inherit a method called fly() and Quack() which are useless to Rubber Duck so what is the solution ? The answer will be to pull out the fly and Quack methods outside Duck class and make a new interface called something like FlyableInterface and QuackablInterface which both have one method for example called fly() at FlyableInterfance and quack at QuackablInterface after that the Duck class can implement these interfaces methods based on its function
so the code will be refactored to
```php
Interface Flyable
{
    public function fly();
}
Interface Quack
{
    public function quack();
}
```
Now the new version of RubberDuck class will implement the new interface method
```php
class RubberDuck implements FlyableInterface, QuackableInterface 
{
    public function fly(){} // from interface
    public function quack(){} // from interface
    public function display(){}
}
```
and the Duck class has one method which in common for all types called display()
```php
class Duck
{
    public function display(){}
}
```
so here we partially solve the problem but we will notice some problems also after this update but let's discuss that in other articles or write your comments about the problems.
So from the example above we can summarize the meaning of composition by saying it's a process to pull out some methods outside the class and create the interfaces to enable the that class implement the suitable interfaces methods not every method from the super class.
I hope that I succeeded in clarifying the idea, even in a simple way.
Thanks for your reading and sorry for my english as it's not my tongue language
Deploy React app with JSON server on Heroku
Tags: react, jsonserver, heroku, tutorial
Published: 2022-07-18 15:28:52

### Prerequisites

Assuming you have already done the following:
1. Created a react application using create-react-app,
2. Installed JSON server in the root directory and created db.json database,
3. Your front-end application can run correctly and can access the JSON database properly,
4. Your app has been committed on Github,
5. You have a [Heroku](https://id.heroku.com/login) account.

#### Step 1: 

create a file named **Procfile** in the root directory, and paste the following code into the file:
```js
web: node server.js
```
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vpmmndjjnjbrjbe4kao1.png)
 
#### Step 2: 

create a file named **server.js** in the root directory, and paste the following into the file:

```js
const jsonServer = require("json-server");
const server = jsonServer.create();
const router = jsonServer.router("./db.json");
const middlewares = jsonServer.defaults({
  static: "./build",
});
const PORT = process.env.PORT || 8000;
server.use(middlewares);
server.use(
  jsonServer.rewriter({
    "/api/*": "/$1",
  })
);
server.use(router);
server.listen(PORT, () => {
  console.log("Server is running");
});
```
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n7nhi2ruw7u95mfq8hwm.png)
 

#### Step 3: 

(1) Commit the changes above to your Git repo. Then,
(2) Log in to your Heroku account, and create a new app:

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

(3) In the `Deploy` catalogue, select `GitHub` as your `Deployment method`, find your repo and `Connect` it to Heroku:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h2qadpt27rdu50lpq25q.png)
 
 
(4) Click `Deploy Branch` to deploy your app. 

Suppose the whole procedure finishes without any problem, congrats! And now, you can click `Open app` to see your deployed app.
  

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


That's the end of this article. I want to share my [deployed repo](https://deploy-feedback-app-with-jsv.herokuapp.com/) here, and please feel free to check interesting things, play it, fork and give stars, and leave a message below if you have questions.

{% embed https://github.com/hyc0812/deploy-feedback-app %}

See you!


### Reference
Deployment:
https://www.youtube.com/watch?v=DAuHI7bHx1Q
Learn React.js:
https://www.skillshare.com/classes/React-Front-To-Back-2022/1541849001/projects?via=member-home-EnrolledClassesLessonsSection
Cover image:
https://blog.devgenius.io/how-to-deploy-your-first-full-stack-web-application-react-rails-heroku-17a799e78bb4
Debugging Deep Links and App Links in Android
Tags: android, kotlin
Published: 2022-07-18 15:23:00

Most of the time, it is quite simple to debug a deep link just run your app start attach debugger, and fire a deep link, it is straightforward and can be done without any adb command. 

But what if you need to start an app with a deep link/app link? How do you attach the debugger then? Well, it's time for adb. 

_1. Run this command once, so that your app will be waiting for the debugger to be attached before starting it._
```
adb shell am set-debug-app -w --persistent <com.app.package>
```
_2. Trigger your deep link specifying activity that has an intent filter to recognize deep link sheme_
```
adb shell am start -W -a android.intent.action.VIEW -d "<your-deep-link-url>" <com.app.package>.<your-activity-that-handle-intent>
```
_n. Once done, remove the effect applied by step #1_
```
adb shell am clear-debug-app <com.app.package>
```

_More concrete example_
```
adb shell am set-debug-app -w --persistent com.example.myapp

adb shell am start -W -a android.intent.action.VIEW -d "https://my-app-host-link.com/detail_screen_path?id=100" com.example.myapp.MainActivity

adb shell am clear-debug-app com.example.myapp
```
Managing AWS S3 using AWS CLI
Tags: aws, s3, awscli, cli
Published: 2022-07-18 15:20:20

# AWS S3
Amazon Simple Storage Service (Amazon S3) is an object storage service offering industry-leading scalability, data availability, security, and performance. S3 has 99.999999999% (11 9s) of data durability. You can use S3 for object storage, host a website or redirect request.

In this article I will show you how you easily from your local environment can manage your S3 bucket when using the AWS CLI.

# Prerequisites
1. AWS CLI installed - [tutorial](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html) from AWS of how to install the AWS CLI
2. Configure AWS CLI - [tutorial] (https://docs.aws.amazon.com/cli/latest/userguide/getting-started-quickstart.html) from AWS of how to configure your AWS CLI


# Using AWS CLI with AWS S3
There are multiple commands you can use with S3 and the AWS CLI. The default structure is:

```php
s3 <subcommand> [parameters]
```

I will show you some commands that you might find useful in your daily work and of course there are plenty more.

##### Create a Bucket

```php
aws s3 mb s3://mybucket
aws s3 mb s3://mybucket --region eu-north-1
```

##### Remove a Bucket

```php
aws s3 rb s3://mybucket
aws s3 rb s3://mybucket --force
```

##### Deploy
This will use the default profile in your .aws credentials file

```php
aws s3 sync build/ s3://mybucket
```

If you want to deploy using a custom profile you can use the following command

```php
aws s3 sync build/ s3://mybucket --profile mybucketapp
```
##### ls commands

```php
aws s3 ls
aws s3 ls s3://mybucket
aws s3 ls s3://mybucket --recursive
aws s3 ls s3://mybucket --recursive  --human-readable --summarize
```

##### Copy a local file to Bucket

```php
aws s3 cp index.html s3://mybucket
```

##### Download a file

```php
aws s3 cp s3://mybucket/index.html <path where you want to download the file to>
```

##### Delete file/s

Delete a file from Bucket

```php
aws s3 rm s3://mybucket/index.html
```

Delete all files from a bucket

```php
aws s3 rm s3://mybucket --recursive
```

##### Delete Bucket

Delete an empty Bucket. `rb` = remove bucket

```php
aws s3 rb s3://mybucket
```

Delete a Bucket and all it's objects

```php
aws s3 rb s3://mybucket --force
```

##### Set bucket as a website

```php
aws s3 website s3://mybucket/ --index-document index.html --error-document error.html
```

#Summary
Hope you found these commands useful. Do you have other commands you use? Please share them in the comments.
July 22 2022 in Streaming
Published: 2022-07-18 15:20:01

https://www.linkedin.com/pulse/july-2022-tim-spann-/?published=t

In preparation for my upcoming meetup talk with David, I have been looking at the Apache Pulsar Sink for Lakehouses. Some fun Delta.io stuff coming.
No alt text provided for this image



Lots of cool events coming, so stay tuned.

For any of my FLiP Stack Weekly readers, I have a really good discount code for the conference so reach out. It will be good to see you in August.

Pulsar Summit!!!!!!!








REDHAT CONTAINER IMAGES

EVENTS




July 25, 2022. 2 pm EST. Code on the Beach. Virtual Florida. Deep Dive into Building Streaming Applications with Apache Pulsar

July 26, 2022. 3 pm EST.

August 4, 2022 - FLiPN Stack. 1PM EST


August 6-8, 2022: ApacheCon Asia. Virtual.

Sept 13-16, 2022: OSS Summit

Oct 3-6, 2022: Apache Con, New Orleans, LA.

Oct 4-5, 2022: Current: Apache Kafka Summit. Austin, TX.

Oct 25, 2022: KubeCon: Detroit
Nov 23, 2022: Big Data EU

CODE

ARTICLES

Published by
Tim Spann 🇺🇦Status is online
Tim Spann 🇺🇦
Developer Advocate @ StreamNative, Apache Pulsar, FLiP Stack, DeveloperWeek Advisor 🇺🇦
Published • 4s
92 articles
hashtag#ApachePulsar hashtag#ApacheFlink hashtag#DeltaLake
Apache Pulsar - FLIpN Stack News - July 18, 2022
Published: 2022-08-01 13:23:39

---
title: Apache Pulsar - FLIpN Stack News - July 18, 2022
published: true
date: 2022-07-18 15:20:00 UTC
tags: 
canonical_url: 
---

 https://www.linkedin.com/pulse/july-2022-tim-spann-/?published=t

In preparation for my upcoming meetup talk with David, I have been looking at the Apache Pulsar Sink for Lakehouses. Some fun Delta.io stuff coming.

No alt text provided for this image

Lots of cool events coming, so stay tuned.

For any of my FLiP Stack Weekly readers, I have a really good discount code for the conference so reach out. It will be good to see you in August.

Pulsar Summit!!!!!!!

REDHAT CONTAINER IMAGES

EVENTS

July 25, 2022. 2 pm EST. Code on the Beach. Virtual Florida. Deep Dive into Building Streaming Applications with Apache Pulsar

July 26, 2022. 3 pm EST.

August 4, 2022 - FLiPN Stack. 1PM EST

August 6-8, 2022: ApacheCon Asia. Virtual.

Sept 13-16, 2022: OSS Summit

Oct 3-6, 2022: Apache Con, New Orleans, LA.

Oct 4-5, 2022: Current: Apache Kafka Summit. Austin, TX.

Oct 25, 2022: KubeCon: Detroit

Nov 23, 2022: Big Data EU

CODE

ARTICLES

Published by

Tim Spann 🇺🇦Status is online

Tim Spann 🇺🇦

Developer Advocate @ StreamNative, Apache Pulsar, FLiP Stack, DeveloperWeek Advisor 🇺🇦

Published • 4s

92 articles

hashtag#ApachePulsar hashtag#ApacheFlink hashtag#DeltaLake
Declaring Variables in JavaScript
Tags: javascript, beginners, webdev
Published: 2022-07-18 15:17:38

Hello! Welcome to my first post, and thank you for checking out my blog. We are going to start with something simple: the different ways to declare variables in JavaScript. 

There are three ways to declare variables in JavaScript, and those are let, const, and var. Today we will just be covering let and const, which were introduced in 2015 and are _now_ used much more often than var.

## let
Using let allows us to declare a variable that we may want to change the value of at a later time. You can declare a variable using let without immediately assigning it a value.

```
let dog;
//=> undefined
```
Later you could assign a value to your variable with the following syntax:

```
dog = 'Ted';
//=> Ted
dog;
//=> Ted
```
When using let, you can assign a different value to the variable at any time.

```
dog;
//=> Ted
dog = 'Libby';
dog
//=> Libby
```
## const
We use const when we want to assign a value to a variable that will remain **constant** throughout our code. You cannot reassign a variable declared with const, and its value _must_ be set when declaring the variable.

```
const breed = 'chihuahua';
//=>undefined

breed;
//=> chihuahua

breed = 'beagle'
//=> Uncaught TypeError: Assignment to constant variable.
```
If you try to declare a variable using const without assigning a value, you will get an error message.
```
const breed
//=> Uncaught SyntaxError: Missing initializer in const declaration
```
I hope this helped you learn more about different ways to declare a variable in JavaScript, and  when to use let and when to use const. Thanks for reading!

## Resources
[MDN - let](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/let)
[MDN - const](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/const)
Gradle and Groovy Magic
Tags: gradle, android
Published: 2022-07-18 15:17:00

Gradle can be pretty confusing at times, especially for Android developers working on small and medium projects. In Android project Gradle is set up by default and we rarely feel a need to explore how and why things work.

Here are some questions and answers that you might've had regarding Gradle.


**1. Why do we use `gradlew taskName` instead of `gradle taskName` to execute a task?**
It is because in our projects we use Gradle wrapper to have 1 version of Gradle among all the developers of the project.

**2. Android Studio's Modules and Gradle's Projects**
An Android project is also a Gradle project. Gradle has a 1-to-1 relationship between its projects and `build.gralde` files. At the same what Android studio calls a "module", in Gradle is referred as sub-project.

**3. Should I use `'` or `"` for string literals?**
Groovy, which is one of the languages used along with Kotlin to describe Gradle script, recognises both double and single quotation marks as a string.
String types in Groovy:
- 'Hello World 1' - String
- "Hello World 2" - String
- "Hello World $count" - GString


**4. Function calls, properties, and when to use round brackets?**
In Groovy:
- If a function has at least one parameter you can ignore curly brackets.
Fields are properties, so each class field generates setter and getter for a declared field.

Look at the code below and try to guess, how many times will the `Foo.name()` function will be triggered when executing `./gradlew showMagic`?

```
class Foo {
    def name = ""
    
    void name(String newString) {
        name = newString
        println("Foo.name() triggered")
    }
}

tasks.create("showMagic") {
    doFirst {
        group "Whole new group"
        description "Check setter and getter capabilities"

        def foo = new Foo()

        foo.name = "string 1"
        println("showMagic() ${foo.name}")
        foo.name("string 2")
        println("showMagic() ${foo.name}")
        foo.name "string 3"
        println("showMagic() ${foo.name}")
        foo.setName("string 4")
        println("showMagic() ${foo.name}")
        foo.setName "string 5"
        println("showMagic() ${foo.name}")
        String propertyOrFunctionName = "name"
        foo."$propertyOrFunctionName" = "string 6"
        println("showMagic() ${foo.name}")
    }
}
```
Output:
```
showMagic() string 1
Foo.name() triggered
showMagic() string 2
Foo.name() triggered
showMagic() string 3
showMagic() string 4
showMagic() string 5
showMagic() string 6
```


**5. Functions with multiple parameters**
As you might have guessed from the code above, we can ignore round brackets and pass multiple parameters separated by commas:
```
void foo(String url, String parameter) {
    println url
    println parameter
}

tasks.create("callFoo") {
    doFirst {
        foo "google.com", 'consistency'
    }
}
```