teleren/devto huggingface dataset:
A Better Slack Bot for HubSpot
Tags: integrations, slack, hubspot, saas
Published: 2021-12-01 23:44:30

---
title: A Better Slack Bot for HubSpot
published: true
description: Create the most powerful and flexible integration between HubSpot and Slack
tags: #integrations #slack #hubspot #SaaS
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vbr2w0msn7gz4ic49eff.png
---

Integrating [Slack](https://slack.com/) and [HubSpot](https://www.hubspot.com/) can be difficult for developers. 

HubSpot has an [built-in bot for Slack](https://www.hubspot.com/slack) **But sometimes the built-in bot capabilities aren’t sufficient, or you want to create a HubSpot Slack bot for your specific task or workflow** 

In this blog post, you will learn how to code a Slack bot that responds to a specific command and returns the information you need from HubSpot, giving you full control of what data is fetched and how it is displayed. 

**What could you do with this integration?**

Let’s say that you would like to get information about your users by running just one command in Slack. For example, if you run “lookup user@email.com” on Slack and receive relevant information about that user from HubSpot. 

**Let’s see the integration in action!**

![Slack and HubSpot integration](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lnl1pagxq3w8ec3whpfr.png)

One item to note about the “lookup” keyword is that it can be placed anywhere on a slack message. If you are having a conversation with a team member, you can say for example “Hey @user2 can you please reach out to customer Acme, here's the contact info lookup acme@email.com”, the team member will receive the information needed from that user.

**Try it out now!**

1. [Click here](https://api.us-west-1.on.fusebit.io/v2/account/acc-f64569d3c8c14166/subscription/sub-1431c8fd3dc14cbe/integration/hubspot-slack-bot/api/service/start) to install the bot 
2. You will need to authorize access to your HubSpot instance and Slack workspace
3. Add the bot to a Slack channel, by clicking the drop-down next to the channel name, clicking **Integrations**, and then selecting **Add an App** and then finding “HubSpot Bot”
4. Type the “lookup” command followed by the email address of a HubSpot contact, for example “lookup joe@example.com”.

Once you have the example running, you may wish to customize it to your needs, including modifying HubSpot search or how the data is displayed. Read on to learn how. 

To create your own integration, you can [read this article](https://fusebit.io/blog/slack-bot-hubspot-integration/).
Time Zone: Nodejs
Tags: javascript, webdev, beginners, programming
Published: 2021-12-01 23:36:40

I've faced a lot of obstacles while developing web apps, but I've never had to deal with <mark>time zone</mark> issues.
I decided to write this brief post to help anyone who might find themselves in the same situation.
The solution was discovered thanks to the help of a colleague. 

![timezone](https://media.giphy.com/media/3o751ZKB91R8ZvMvde/giphy.gif)



After writing the logic for a service apartment booking app [check site here](spaceet.com), I discovered that the email was not sending the correct time in the booking receipt. I live in Africa, Nigeria to be precise yet the time zone supplied to the user after a successful booking was eastern standard time i.e the previous day to my current time. In my case:
<kbd>Fri Dec 17 2021 to Sat Dec 18 2021</kbd> instead of <kbd> Sat Dec 18 2021 to Sun Dec 19 2021</kbd>
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hfjqfpm0fovhwdu09q9x.PNG)
 

✅ The quick fix was: 

```Javascript
const express = require('express');
const app = express();
const port = process.env.PORT || 4545

process.env.TZ ="Africa/Lagos"

...

app.listen(port, () => {
    console.log(`Server Established and  running on Port ⚡${port}`)
})

```
## Conclusion
You can easily set your time zone to a correct value by using `process.env.TZ ="Continent/Country"`. I hope this post was helpful. Thanks for reading.
Vim Tips and Tricks for Beginners
Tags: linux, vim
Published: 2021-12-01 23:22:04

Vim is an amazingly powerful, yet super simple text editor. It's an easy to use and free text/programming editor that anyone can use regardless of their skill level. 

You can use vim both in the [terminal](https://bsdnerds.org/what-is-linux-shell/) and in a GUI version (gvim). You can also use it over a remote network session (ssh).

Here are some Vim tips and tricks that will help you get started with Vim.

### Basic Navigation

To move around, we use the **h, j, k** and **l** keys to move left, down, up, and right respectively.

* h moves the cursor one character to the left. 
* j moves the cursor one line down.
* k moves the cursor one line up.
* l moves the cursor one character to the right.

Vim also uses the arrow keys to move around too! 

* **gg** moves to the top of the file. 
* **G** moves to the bottom of the file.

### Opening and saving

In order to save a file with vim, you need to first open it with vim editor. You can do so with the command line:

```bash
vim filename.txt
vim /home/you/Documents/filename.txt
```

To save the file, press `ESC` followed by `:w!`

Inside vim you can open files using `ESC` followed by `:e filename`.

### Quit vim

To quit vim, you can either press `ESC` followed by `:q!` (quit without saving) or press `ZQ`.

To save and exit, press `ESC` followed by `:wq!`

![how to quit vim](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tw530lh5w58aitgn5u37.png)

### .vimrc

While vim does a lot of things out of the box, you may want to configure it to work with certain programming languages, to show line numbers etc.

You can customize with your `.vimrc` file. You can configure vim with that file. 

To enable syntax highlighting:

```
" Turn syntax highlighting on.
syntax on
```

To enable line numbers

```
" numbers on each line
set number
```

If you don't want to configure manually, you can generate a vimrc config file on this [website](https://vim-bootstrap.com/#tagline).

## Programming in vim

You can use vim as a programming IDE. I do this quite a lot, as vim is a very powerful editor and great for editing some files on the fly.

Let's say you want to create a hello world program. The first thing you will want to do when opening vim

```bash
$ vim
```

Run the following command: 

```bash
:edit hello_world.py
```

This will open up a blank python file. From here, you can start writing code by pressing **i** (or insert) to go into insert mode. 

Write your code.

After press `esc` to exit insert mode, the buffer should be saved automatically. You can then run **esc** **:wq** to close and save the file.

## what's next? :smile:

It can take a while to get used to all the keyboard commands when learning vim. It can be challenging to use vim while at the same time learning vim. 

So what to do? If you want to learn vim quickly, you can use [vim.is](https://vim.is/)
Advent of Code 2021 - Day 1
Published: 2021-12-01 23:12:25

---
title: Advent of Code 2021 - Day 1
published: true
description: In this video series, I try to challenge myself with the Advent of Code trials. Each solution will be published to Github, and I hope you will learn something from my coding mistakes and perhaps send some code my way on how you have done these challenges. I know by reading code, so this is such an exciting thing for me.
tags:
cover_image: https://i.ytimg.com/vi/VoZHz59-sEc/maxresdefault.jpg
---

{% youtube VoZHz59-sEc %}

In this video series, I try to challenge myself with the Advent of Code trials. Each solution will be published to Github, and I hope you will learn something from my coding mistakes and perhaps send some code my way on how you have done these challenges. I know by reading code, so this is such an exciting thing for me.
Day 488 : Go To Sleep
Tags: hiphop, code, coding, lifelongdev
Published: 2021-12-01 22:57:00

_liner notes_:
- Professional : Had a pretty good day. Had a meeting with my manager. It's time to start thinking about what I want to try and get done next year. Had a impromptu pair programming with a project manager to include a feature in a demo. Started working on the demo for a new blog post. Not bad.

- Personal : Don't really remember last night, but I do remember watching "Cowboy Bebop" before going to sleep. It was a really good episode.


![A shallow lake surround by green trees with waterfalls in Krka Nat'l Park, Croatia](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zlxtph7vxa6m37sx622v.jpg)

So during my lunch break, I decided to test my new camera while there was light outside (it gets dark so quickly). Good news is that the live streaming worked! Had some issues with installing the app on one device, but not another. Their Android app isn't even on the Google Play store and had to download it from a website. Going to see if the iOS app (which is in the App store) can work on the iPad I use for the radio show and maybe I'll pick up a cheap iPod touch and use that. We'll see. Got some research ahead of me. Definitely want to get some "Cowboy Bebop" watching before I go to sleep. Also, probably go through some tracks for the radio show.

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube BLysd2Dy4Kw %}
Latest project: Know(Nostalgia)
Tags: javascript, scss, bootstrap
Published: 2021-12-01 22:54:02

Hi Everyone,
I wanted to share my latest project which I made for coding bootcamp[](https://knownostalgia.netlify.app/index.html). The site was built using Bootstrap, SCSS, and vanilla JavaScript. One highlight of the site is that it utilizes an API to access a movie database to allow users to search for movies. I have limited the search results to only display movies that were released between 1990 - 2009, as those are the decades the site is dedicated to. 
https://knownostalgia.netlify.app/index.html
[Binary Search]Univalue Tree Count
Tags: algorithms, java, 100daysofcode, programming
Published: 2021-12-01 22:53:28

https://binarysearch.com/problems/Univalue-Tree-Count

A univalue `tree` is a tree where all nodes under it have the same value.

Given a binary tree `root`, return the number of univalue subtrees.

Constraints: 

1 ≤ n ≤ 100,000 where n is the number of nodes in root

---
# intuition

Tree Traversals: Postorder by DFS

1. you need check left subtree

- if left == null, return true;
- if left != null, deep check left, and compare left.value with now_node.val

2. you need check right subtree

- if right == null, return true;
- if right != null, deep tracking right, and compare right.value with now_node.val

3. compare left with right
   if they are equal with true, ans += 1

# Implementation

Basic Postorder by using DFS

```java
 void postorder(Node node) {
    if (node == null)
      return;

    // traverse the left child
    postorder(node.left);

    // traverse the right child
    postorder(node.right);

    // traverse the root node
    System.out.print(node.item + "->");
  }
```

## Time Complexity

O(n): you need check all nodes in the tree

## Space Complexity

O(n): you need do recursion into tree level

---

```java
class Solution {
    int count = 0;
    public int solve(Tree root) {
        checkUnivalue(root);
        return count;
    }

    private boolean checkUnivalue(Tree node) {
        boolean left = node.left == null || (checkUnivalue(node.left) && node.left.val == node.val);
        boolean right = node.right == null || (checkUnivalue(node.right) && node.right.val == node.val);
        boolean isUnivalue = left && right;

        // A simpler way by using & calculate both side simultaneously 
        // boolean isUnivalue =
        //      (node.left == null || checkUnivalue(node.left) && node.left.val == node.val)
        //      & (node.right == null || checkUnivalue(node.right) && node.right.val == node.val);
        count += isUnivalue ? 1 : 0;
        return isUnivalue;
    }
}

```
Creating An Authentication Flow With Remix and Supabase Tutorial
Tags: remix, supabase, react, webdev
Published: 2021-12-01 22:52:45

>Simple application showing authentication flow and session management using react [Remix](https://remix.run/docs/en/v1) and [Supabase](https://supabase.io)

This application show how to create a user and authenticate in Remix using Supabase as the backend. We show how Actions and Loaders work to manager working with server for data and to make API calls. Most of the heavy lifting is managed by using the Remix Session APIs which help to manage the Supabase Session.

[Remix](https://remix.run/docs/en/v1) is a full stack web framework that lets you focus on the user interface and work back through web fundamentals to deliver a fast, slick, and resilient user experience. 

###Video
{% youtube -KiH8feOHSc %}

###Source Code
{% github aaronksaunders/supabase-remix-auth %}

[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/W7W31U7HM)
AWS Lambda event filtering for Amazon DynamoDB Streams
Tags: lambda, serverless, dynamodb, aws
Published: 2021-12-01 22:44:51

On 26 Nov 2021, AWS released Lambda [event filtering with Amazon DynamoDB as an event source](https://aws.amazon.com/about-aws/whats-new/2021/11/aws-lambda-event-filtering-amazon-sqs-dynamodb-kinesis-sources/). Some might flippantly say "meh, big deal." Well, if you use Lambda functions a lot and only care about a subset of the event in that DynamoDB stream, this really might be a big deal! So read on!!

Until this feature was released, your function(s) were invoked for each and every event on a DynamoDB stream. You could then have some if, case, etc. code to gauge if the event was something this function should care about and operate on. You paid for every invocation of your function. "Do I care about this event? yes. do this.", "Do I care about this event? No, drop it.", "Do I care about this event? yes. do this." and so on.

With the new event filtering, that filter is removed from your Lambda function code and moved up a level. Lambda itself absorbs the cost, both resource and cost wise, to watch the DynamoDB stream and if an event meets your filter, only then will your function be invoked. That is a massive and great change for us as AWS Lambda users. Let's say that you were invoking your function 200,000 time per day, but realistically less than 5% of the time was the event something the function would do something with. Now you'd only be invoking the function 10k times, instead of 200k, and thus only charged for that 10k invocations.

In addition to all of that, you just reduced the complexity of your code as you no longer have to code, maintain, and test that filtering functionality in your Lambda Function.

In summary, this is a great feature for customers that have AWS Lambda functions that need to operate only on a subset of events in a DynamoDB stream. Reduced code complexity, reduced cost, and so on. It is a win!
Solving day 1 of Advent of Code 2021 in JavaScript
Tags: challenge, adventofcode, javascript, video
Published: 2021-12-01 22:19:57

---
title: Solving day 1 of Advent of Code 2021 in JavaScript
published: true
description: JavaScript walkthrough of Advent of Code 2021 (day 1)
tags: challenge, AdventOfCode, javascript, video
series: Advent of Code 2021 in Javascript
---

{% youtube FpIhZ8EwfJg %}
The Impact of Layout on User Experience: A Study
Published: 2021-12-01 22:14:49

A year ago, I wrote a research paper titled **[Identification and Measurement of Hierarchical Layout Patterns on User Experience](https://sorinportfolio.s3.us-east-2.amazonaws.com/Identification+and+Measurement+of+Hierarchical+Layout+Patterns+on+User+Experience+-+Roman+Sorin.pdf)**. This paper documents a study that spanned over several months (September of 2019 until April of 2020), in which I performed a two-part analysis & experiment on the most popular site layouts and how user experience is affected. While this paper barely scratched the surface of what is possible, it documented a novel approach to studying user experience and how it may be possible to measure "success" through objective metrics — both quantitative and qualitative. Below is the abstract of that paper and a link to continue reading.

## Abstract

User experience continues to grow in importance as web applications become increasingly widespread and utilized. Further, high-quality user experience often leads to increased user retention, product usage, and revenue for businesses and applications alike. Though user experience is a focus for some, there is often ambiguity in what an optimal or effective layout looks like, and how components within the hierarchy should be structured to accomplish a set goal. This study proposes a potential approach to objectively analyzing and identifying layouts from the highest indexing sites on a global scale, and methods of implementation to assess whether or not certain metrics representing user experience are impacted by layout. After analyzing 908 screenshots and four clusters from the globally highest ranking sites using a K-means algorithm and weighted subclustered images, three common layouts, or variants, were identified and created for use in a web application. Users were randomly assigned one of three layouts, and they were instructed to navigate through the layout to register or purchase the product while their session lengths and mouse movements were recorded. The results from this study found that while the differences in variances between the mean session lengths from 55 participants were statistically insignificant, interesting patterns were found from a manual qualitative analysis when comparing interface hierarchies to data. Subsequently, it was found that various avenues exist for improvement of the model, such as an objective, mathematical metric to understand how layout impacts user experience metrics.

Read the paper [here](https://sorinportfolio.s3.us-east-2.amazonaws.com/Identification+and+Measurement+of+Hierarchical+Layout+Patterns+on+User+Experience+-+Roman+Sorin.pdf).

## More information

**Title:** Identification and Measurement of Hierarchical Layout Patterns on User Experience

**Written:** April 22, 2020

**Keywords:** user experience (UX), K-means clustering, Keras VGG16, AWS Alexa
I created a mobile application to check for diabetic patients in NIgerian states
Tags: programming, android, flutter, beginners
Published: 2021-12-01 21:54:56

Over time I have been claiming to be a developer but I haven't really done anything substantial with my coding prowess. 
Last week a classmate of mine came to meet me and was like, "Dapo, you can make mobile applications right?", at first I wanted to say no because I really haven't tried anything from the scratch as I am used to following tutorial videos without tweaking anything but I said yes with a low level of certainty.

Fast forward to Sunday, someone messaged me and informed me that he wanted to build a mobile application for his final year project and it was to get the number of diabetic patients in Nigerian states. I didn't know what to say or do at first but after taking time to think I started coding. Due to the fact that I have not undertaken many projects I thought it would take me so much time but in less than three days I have finally completed the application.

I used google map API. At first I was using "Map Embeded" and it was not giving me what I wanted, I was stuck because I didn't know of other options. I took me a couple of hours to know that there was "Map for android" and "Map for iOS".

## Code snippet for placing markers on the google map

`_markers.add(
        const Marker(
            markerId: MarkerId ('id-27'),
            infoWindow: InfoWindow(
                title: 'Osun',
                snippet: 'Number of Diabetic patients = ...'
            ),
            position: LatLng(7.5629, 4.5200)
        ),
      );`

My journey into constant coding, facing errors, debugging and publishing mobile applications is officially starting today, 1st December 2021.
Sarlavha
Tags: beginners
Published: 2021-12-01 21:49:50

# Title 1
## Title 2
### Title 3
###### Title 6

This is *italic* _text_.

This is **bold** __text__.

This is ***bold text***.

___This is italic bold text.___

~~This is strikethrough text.~~

- Item 1
- Item 2

+ Item 1
+ Item 2

* Item 1
	* Item 2

1. Item 1
2. Item 2
3. Item 3

[Ilmhub.uz](https://oj.ilmhub.uz "ilmhub")

![W3School](https://www.w3schools.com/images/w3schools_green.jpg)

[![w3school](https://www.w3schools.com/images/w3schools_green.jpg)](https://oj.ilmhub.uz)

|Ustun 1|Ustun 2|Ustun3
|---|---|---
|dcsddscdscdscsdcsdsdsdcsd|sdcdscsdcsdcs|sdcsdcsdsdcsd
|CXSDCSDCS|CSDCSD|SDCSDCSD

![W3School](https://www.w3schools.com/images/w3schools_green.jpg)

This is [reference 1]

[reference 1]: <https://en.wikipedia.org>


- [x] Task 1
- [x] Task 2

This is `code`.

```python
def add (a, b):
	return a + b
```

> This is blockquote.
> > This is inline blockquote
> 
> This second line of block quote.

- Item 1

	> Blockquote
- Item 2 


---
___
Accept Subscriptions/Recurring payments with PayPal in ASP.NET & C#

Tags: paypal, subscriptions, recurringpayments, aspnet
Published: 2021-12-01 21:40:20

With the PayPal Catalog Products API and PayPal Subscriptions API, you can create and manage subscriptions/recurring payments.

You can now model your business and product offerings in one place. Products define what you sell and Prices track how much and how often to charge.

Once you sign up and confirm your account, PayPal provides you with a set of API keys. Basically you get a “Client Id” key and a “Client Secret” key. 

Logging into the Developer Dashboard to get credentials and create sandbox accounts requires a developer, personal, or business account. Each account provides different levels of access to PayPal functionality. Developer Account: access sandbox, Personal Account: access sandbox+send and receive money, Business Account: access sandbox+send and receive money+go live

If you are looking a solution to integrate PayPal’s subscriptions to your website (ASP.NET Web Forms or ASP.NET Core MVC) that is builded with .Net & C#, look at that demo → https://techtolia.com/PayPalSubscriptions/

Elements are completely customizable. You can style Elements to match the look and feel of your site, providing a seamless subscription experience for your customers.

Create plans that charge users a fixed amount at regular intervals.

Offer your subscribers free or discounted trials to get more subscription signups.

Accept currencies for over 250 countries.


### How a Subscriptions integration works?
![PayPal How a Subscriptions integration works?](https://techtolia.com/PayPalSubscriptions/assets/images/subscriptions-how-to.svg)
1. Create a one-time subscription product and the plan(s) to offer to your consumers.
2. Present the PayPal button to create a subscription using either the Subscriptions API or the PayPal JavaScript SDK.
3. The button launches the PayPal Subscription experience.
4. The buyer agrees and subscribes.
5. The button calls PayPal Subscription API to create a subscription.
6. You show subscription confirmation to the buyer.

### Buyer consent flow with a PayPal account
![Buyer consent flow with a PayPal account](https://techtolia.com/PayPalSubscriptions/assets/images/subscriptions-paypal-account.svg)
1. Buyer clicks PayPal Subscribe.
2. Buyer logs in to PayPal.
3. Buyer agrees to the subscription terms and subscribes.
4. Buyer is redirected to the merchant page.

### Buyer consent flow with no PayPal account

![Buyer consent flow with no PayPal account](https://techtolia.com/PayPalSubscriptions/assets/images/subscriptions-no-paypal-account.svg)
1. Buyer clicks Debit or Credit Card.
2. Buyer enters card details, agrees to the subscription terms and subscribes either as a guest or by creating a PayPal account.
3. Buyer is redirected to the merchant page.

{% youtube dXv3xcV4kaU %}