teleren/devto huggingface dataset:
Useful Github Search Capabilities for Issues and Pull Requests
Tags: github, programming, beginners, productivity
Published: 2022-08-01 11:48:42

In my day-to-day I often find myself wanting to search for pull requests and issues that I've commented on without necessarily being the author of the pull request/issue. Fortunately, Github has a couple of pretty useful search options for just this purpose!

## Search by commenter

This is a filter I now use multiple times a day when I'm chatting with someone and have a "I know I've been in a conversation about this somewhere on Github already" moment.

The syntax for this is [`commenter:<a github username>`](https://docs.github.com/en/search-github/searching-on-github/searching-issues-and-pull-requests#search-by-commenter).

## Search for a user that's involved in an issue or pull request

More broad than the 'search by commenter' filter mentioned above, this works as an `OR` between the `author`, `assignee`, `mentions`, and `commenter` filters.

The syntax for this is [`involves:<a github username>`](https://docs.github.com/en/search-github/searching-on-github/searching-issues-and-pull-requests#search-by-a-user-thats-involved-in-an-issue-or-pull-request)

## Wrap up

If you're interested in taking a look at some of the other search options that Github has (and I highly encourage doing so), you can find their full documentation about this topic [here](https://docs.github.com/en/search-github/searching-on-github/searching-issues-and-pull-requests).
378. Leetcode Solution in Cpp
Tags: cpp
Published: 2022-08-02 06:17:00

```
struct T {
  int i;
  int j;
  int num;  // matrix[i][j]
  T(int i, int j, int num) : i(i), j(j), num(num) {}
};

class Solution {
 public:
  int kthSmallest(vector<vector<int>>& matrix, int k) {
    auto compare = [&](const T& a, const T& b) { return a.num > b.num; };
    priority_queue<T, vector<T>, decltype(compare)> minHeap(compare);

    for (int i = 0; i < k && i < matrix.size(); ++i)
      minHeap.emplace(i, 0, matrix[i][0]);

    while (k-- > 1) {
      const auto [i, j, _] = minHeap.top();
      minHeap.pop();
      if (j + 1 < matrix[0].size())
        minHeap.emplace(i, j + 1, matrix[i][j + 1]);
    }

    return minHeap.top().num;
  }
}; 

```
#leetcode
#solution
Here is the link for the problem:
 https://leetcode.com/problems/kth-smallest-element-in-a-sorted-matrix/
Run a Substrate Node Template on a Remote Server
Tags: substrate, polkadot, rust, blockchain
Published: 2022-08-02 07:16:00

Substrate node template is the first step to develop a Polkadot substrate-based parachains. The node template can be hosted on your local computer or a remote server. This guide will show you how to set up and run a substrate node template on a server.

---

**1, Connect to remote server by using PuTTY client**



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

---


**2, Update Rust environment using following command:**

```
rustup component add rust — src — — toolchain nightly
```

---


**3, Verify that you have the WebAssembly target installed by running the following command:**

```
rustup target add wasm32 — unknown — unknown — — toolchain nightly
```

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

You should see everything is up to date after being installed successfully

---


**4, Install Substrate contracts node:**

```
git clone https://github.com/substrate-developer-hub/substrate-node-template

cd substrate-node-template && git checkout polkadot-v0.9.26

cargo build — release
```

It may takes about 10–15 mins to compile.

---

5, Run substrate node:

```
./target/release/node-template — dev
```




You should see the terminal looks like the above. Congratulation! You have successfully installed a substrate node template on a remote server. Next step is to interact with the node from the browser, go check out my previous article!

Thanks for reading! Feel free to reach out to me if you have any questions.
Day 58-61 of coding complete
Tags: webdev, beginners, programming, 100daysofcode
Published: 2022-08-02 15:07:00

#100DaysOfCode #100daysofcodechallenge Day 58-61 complete. Finished building the skyline and learning more about CSS variables. Really cool to see how to manipulate containers and utilize variables. You can use the “:root” selector in CSS to apply a value in all your CSS code. 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8p9cwpff3of9kjz995vh.jpeg)
Carbon language Fibonacci series working example
Tags: programming, beginners, tutorial, opensource
Published: 2022-08-03 06:29:00

Carbon language beginner series: 

Google introduced [Carbon programming language](https://tipseason.com/carbon-language-tutorial-syntax/) recently. 

Carbon language is still in early stages and is not yet ready. However just want to explore it around to learn a new language. After setting up carbon language, tried to run fibonacci series example with iteration but didn't work . So tried a recursive example and it worked. Here is the full working example. 


If you prefer to have an iterative version using `while` loops + recursion you can check it here : [Carbon language Fibonacci series, print nth Fibonacci number](https://tipseason.com/carbon-language-fibonacci-sequence/)


```
package sample api;

fn Fibonacci(n: i32, a: i32, b: i32) -> i32 {
    Print("{0} ", a);
    if (n == 0) {
        return a;
    }
    return Fibonacci(n - 1, b, a + b);
}


fn Main() -> i32 {
    var n: i32 = 6;
    let nthFibNumber : auto = Fibonacci(n, 1, 1);
    Print("*****");
    Print("(N+1)th fibonacci number : {0}", nthFibNumber);
    return nthFibNumber;
}

```

### Understanding the code: 

We use a recursive code to calculate nth fibonacci number . 
`fib(n) = fib(n-1) + fib(n-2)`

To print the sequence, since `for` loops doesn't work in carbon yet, we will use print nth number using recursion. At each step we will replace the positions of `a` and `b` using `b` and `a+b` and print the nth number in the starting of recursion. 
 
```
fn Fibonacci(n: i32, a: i32, b: i32) -> i32 {
    Print("{0} ", a);
    if (n == 0) {
        return a;
    }
    return Fibonacci(n - 1, b, a + b);
}
```

Finally we call this in the main method. One thing to note is each time the method returns n+1 th fibonacci number in the recursion. So its easier to print nth fibonacci number too. 

```
fn Main() -> i32 {
    var n: i32 = 6;
    let nthFibNumber : auto = Fibonacci(n, 1, 1);
    Print("*****");
    Print("(N+1)th fibonacci number : {0}", nthFibNumber);
    return nthFibNumber;
}
```

Additional Carbon language Reading: 
[Carbon language vs Rust detailed comparison]
(https://tipseason.com/carbon-language-vs-rust/)

[Carbon language memory management](https://tipseason.com/carbon-language-memory-safety/)

This is a part of carbon language series for beginners. Feel free to ask any questions regarding Carbon.
[Design Pattern] Observer Pattern
Published: 2022-08-08 07:37:11

The observer pattern is a one to many relationship dependency, and when one object(Observable object) changes its status, all its dependencies(Observer objects) will be notified and updated accordingly.


**Scenario Problem**
Now we have a publisher object and many subscriber objects, and subscriber objects poll new status from the publisher. However, all these subscribers don't know when the publisher will update a new status, so they just keep polling new status from the publisher(like polling every 1 minute or something).

![problem](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3lxqo2wyrr4zao8ettu6.png)

Now there comes a bad smell... What if there are like 1000 subscribers and each of them tries to get status every 10 seconds!? 
As a result, the requesting traffic must explode and obviously there are lots of unnecessary calling... Also, subscribers might not get the most recent status - there is still up to 10 seconds delay before getting the status.

**Solution**
With the observable pattern, every time the publisher(Observable object) has a new status, it notifies all its subscribers. This way we can avoid lots of unnecessary callings, and all subscribers can get the most recent status immediately without delay.

![solution](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xl9ipcurgniron5n4puh.png)


**Implementation**
A very simple class diagram of the pattern is like the following:

[Implementation](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jmjrve1ll7jz5cgygmyd.png)

The `notify()` method will be like:
```java

public void notify() {
    
    this.status = // Do what ever to get the latest status...;
    
    this.subscribers.stream().foreach((s) => {
        s.update(this.status);
    });
}

```
Conversational analysis AI tool
Published: 2022-08-03 10:15:46

Hi there, 

Hope you are doing well. 

Me and a few people are starting this project where we will develop an AI Conversational analysis to detect visual and tonal markers for sale purposes. 

We are looking for people who could jump on board and help us with the creation of this tool and get a working prototype. 

Anyone who is interested could DM me. 

Regards, 
Ayhan
There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form
Tags: javascript, lorem, testing
Published: 2022-08-04 12:56:00

making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.

The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham.
Where can I get some?

There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic
Quick Guide to YAML
Published: 2022-08-05 12:40:46

**YAML** is a _data serialization_ format and _processing model_, used extensively for log files, Internet messaging, filtering and can be used in conjunction with other programming languages.
In computing, serialization is the process of translating a data structure or object state into a format that can be stored or transmitted and reconstructed later possibly in a different computer environment. XML, JSON, BSON, YAML, MessagePack, protobuf are some commonly used data serialization formats.
YAML is a superset of JSON, so JSON files are valid in YAML.
YAML stands for '_**Yet Another Markup Language**_' or '**_YAML Ain’t Markup Language_**', which emphasizes that YAML is for data and not documents. 
YAML files can be added to source control, such as Github, so that changes can be tracked and audited.

YAML uses <u>indentation </u>to indicate nesting. Tab characters are not allowed, so <u>whitespaces </u>are used instead. There are no usual format symbols, such as braces, square brackets, closing tags, or quotation marks. YAML files use a <u>.yml</u> or <u>.yaml</u> extension. 
The structure of a YAML file is a <u>map</u> or a <u>list</u>. It also contains <u>scalars</u>, which are arbitrary data encoded in Unicode, that can be used as values such as strings, integers, dates, numbers, or booleans.

**_YAML parser_** is used to read YAML documents and provide access to their content and structure. 
**_YAML emitter_** is used to write YAML documents, serializing their content and structure. 
**_YAML processor_** is a module that provides parser or emitter functionality or both. 

**<u>YAML Syntax Example :</u>**

```
---
# An employee record
name: Martin D'vloper
job: Developer
skill: Elite
employed: True
foods:
  - Apple
  - Orange
  - Strawberry
  - Mango
languages:
  perl: Elite
  python: Elite
  pascal: Lame
education: |
  4 GCSEs
  3 A-Levels
  BSc in the Internet of Things
```
  
<u>Three dashes</u> indicate start of a new YAML document. YAML supports multiple documents and compliant parsers will recognize each set of dashes as the beginning of a new one. The construct that makes up most of a typical YAML document is a <u>key-value pair</u>.
YAML supports nesting of key-values, and mixing types.

YAML has been criticized for its significant whitespace, confusing features, insecure defaults, and its complex and ambiguous specification.
Configuration files can execute commands or load contents without the users realizing it. Editing large YAML files is difficult, as indentation errors can go unnoticed. Truncated files are often interpreted as valid YAML due to the absence of terminators.

The perceived flaws and complexity of YAML has led to the emergence of stricter alternatives such as _StrictYAML_ and _NestedText_.

**<u>References :</u>**
[Redhat](https://www.redhat.com/en/topics/automation/what-is-yaml)
[yaml.org](https://yaml.org/)
[yaml.org](https://yaml.org/spec/history/2001-12-10.html)
[wiki](https://en.wikipedia.org/wiki/YAML)
[blogs](https://www.cloudbees.com/blog/yaml-tutorial-everything-you-need-get-started)
Avatar Maker - Create cartoon avatars online for free
Tags: avatar, cartoon, maker
Published: 2022-08-06 00:30:45

Ava Maker, also named Avatar Maker, is a free online tool that creates amazing avatar pictures, cartoon profile pictures, and even NFTs. You can generate your own avatar from different styles and a wide variety of options. Cartoon yourself in 3 seconds. Click on one button and create more than 10000 different avatar picture results.

Visit us at: https://avamake.com
How to hide and use API keys when hosting your web app on Netlify similar to .env files
Tags: webdev, react, netlify, tutorial
Published: 2022-08-07 06:07:00

If you're here, you're probably familiar with using **.env** file variables. If not head on over [here](https://dev.to/renegadedev/hiding-api-keys-and-links-in-env-files-for-local-development-of-react-web-apps-26oi) to read my other article that helps you establish **.env** files to store API keys and other variables securely for local development. 

#### Let's create environment variables similar to the .env files in Netlify: 

**Step 1:** Go to Netlify -> Select your **site** -> Then select **Deploys** in the top navigation bar
**Step 2:** Then select **Deploy Settings** -> now select **Environment** in the left pane 
![Left pane tab](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9u9x25pj1o5m7tw0uyvk.png) 
**Step 3:** In **Environment** under **Environment Variables** -> Add in your environment variables with their values like shown below and remember to follow the format of **REACT_APP** followed by variable name in **snake case** as React requires it in that format in order to be used and hit save: 
![Netlify environment variables](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k6snysbketm9l8tan6e2.png)
**Step 4:** In your app you should just be able to use in the component as follows:
```javascript
const ApiKey = process.env.REACT_APP_API_KEY 
```
That's it you're all done, you should now be able to use your hidden API key in your app even when it's hosted on Netlify.
<img src="https://media.giphy.com/media/8UF0EXzsc0Ckg/giphy.gif" alt="all done">
Customer Feedback Strategies for Indie Makers
Tags: saas, business, productivity, showdev
Published: 2022-08-09 06:12:00

Customer feedback is the lifeblood of any SaaS business. It can be difficult to get, though—especially if you're an indie maker working solo or with a small team. But customer feedback strategies are critical for growing your business.

How do you get people to talk about their experience? How do you make sure that the feedback is useful without being too time-consuming on your part? And how do you make sure that the customer knows that their input matters?

I've got some answers for you!

Customer feedback is an essential part of a business's growth. It allows you to:

1. understand your customers better

2. improve your product and services

3. increase revenue and sales

4. build better relationships with your customers

However, getting customer feedback isn't always easy. 

If you're an indie maker, you may have limited resources or experience with running a business. You may not even be sure where to start!

## Why do you need customer feedback?

You need [customer feedback](https://supahub.com/blog/what-is-user-feedback-and-how-to-collect-it) in order to grow your SaaS business in three ways:

1. To improve customer service by knowing what customers want and how they feel about their experience with your company,

2. To make more money by finding out why customers aren't buying from you; and

3. To attract more customers by showing them that you care about their opinions and needs.

## Customer feedback strategies to improve your product and revenue

Customer feedback is the fuel that keeps a SaaS business running. That's why we've put together this list of [customer feedback strategies](https://supahub.com/blog/customer-feedback-strategy) to help you grow your business and improve your product.

1. Offer free trials.

2. Create a community around your product.

3. Use [customer feedback tools](https://supahub.com/blog/customer-feedback-tools) to get feedback from customers and potential customers on what they like and don't like about your product.

4. Create an incentive program for customers who provide feedback: reward them with access to members-only content or early bird discounts on new products or services, for example.

## Conclusion

I hope this guide has been helpful in giving you some strategies for growing your business. 

If you are an indie maker, it's important to remember that there are many ways to get feedback from your customers and some of them may not seem like they'd be effective at first glance.

But don't worry! The key is to keep trying different methods until you find one that works for you.

Here's a more detailed [customer feedback strategies](https://supahub.com/blog/customer-feedback-strategy)
How to make a CRUD operation By Nodejs and TypeScript .?
Tags: javascript, node, typescript, crud
Published: 2022-08-08 05:01:00

you can use a generic way to be applicable for any model you need, only you pass model and data type, and you can apply all crud operations on it.
**source**  [github](https://github.com/EmanSaeed331/CRUD/blob/main/crud.ts)
- CREATE 

```
   async function create<T>(data:T , model:any){
        const newObj = await new model(data);
        await newObj.save()
        return newObj;
```
- READ

```
    async function read(model:any){
        return await model.find({});
    }

```
- UPDATE 

```

    async function update<T>(id:string, data:T , model:any){
        return  await model.findByIdAndUpdate(id,data); 
    }
```
- DELETE

```
   async function getById (id:string,model:any){
        const data = await model.findOne({id});
        if(!data) {
            return 'id is not valid';
        }
        return data ; 
    }
 
```
Use Salesforce Marketing Cloud? Let's talk about your workflow!
Tags: sfmc, email, bldr
Published: 2022-09-09 23:40:30

## The "Typical Workflow"
Salesforce Marketing Cloud (SFMC) is split into a few different areas: Content Builder (emails, content blocks, images), Automation Studio (automations, server-side javascript, queries), Journey Builder (1:1 customer flows).

Let's talk about Content Builder, SFMC's email and content block builder, as it's arguably one of the most used areas of SFMC. In Content Builder, you can create HTML Paste emails and Template Based emails using the WYSIWYG editor. 

In addition to the emails themselves, you have the ability to create re-useable modules called content blocks. These content blocks can be included in Emails, Scripts, CloudPages (we'll get to CloudPages in other posts), even other content blocks.

Depending on your project, it's typical (and a good practice) to split out code into modules. Splitting code into modules when possible, keeps like AMPScript blocks or Server-Side JavaScript functions together and helps when it comes to troubleshooting. If you take a fairly complex Email with a handful of modules, throw in some organization (cause who doesn't love a good folder structure), just setting up a project can become a time-consuming task in-and-of itself.

### Let's go through the (abridged) steps
1. Log into SFMC
2. Navigate to Email Studio (wait for it to load)
3. Navigate to Content Builder (wait for it to load)
4. Left Click > Enter Folder Name > Hit Enter 
5. (Find your folder because it doesn't automatically take you there)
6. Click on the Create button > select your content type
7. Code or Copy/Paste

Congratulations! As long as you made it past the infamous blue wheel, you created an asset!

As you can imagine, a project with a handful of content blocks or emails could take a while to set up.

## Introducing BLDR for SFMC

Bldr is an open-source CLI tool that allows you to pull your files out of SFMC, update them, send the updates back to SFMC, and push them to version control; all from your command line, all without copy/paste. 

As a CLI tool, it allows you to use any code editor that you want and since bldr does not try to re-invent the GIT flow, it fits into your existing git provider; you can use the terminal or a GUI to manage your git files.

If you even know a little bit of how to use git...

```
git clone {{ repository url }}
git add . or {{ path to file(s) }}
git commit -m "commit message"
git push
```
...you will feel right at home with bldr; and if not, it's really quite straight forward.

```
bldr clone --cb -f {{ folder id }}
bldr add . or {{ path to file(s) }}
bldr push
```

No more Copy/Paste, No more browser hiccups that make you loose code, No more 4 clicks to create/update an asset.

In the following posts, I'll go into each core area of bldr; detailing how to use each command and how they interact with SFMC. 

If you're looking for more details or interested in getting started, visit [bldr.io](https://www.bldr.io).
A Quick 10-Second Programming Joke For Today
Tags: jokes, dailydeveloperjokes
Published: 2022-08-12 08:00:17

---
title: "A Quick 10-Second Programming Joke For Today"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
published: true
tags: #jokes, #dailydeveloperjokes
---

Hi there! Here's today's Daily Developer Joke. We hope you enjoy it; it's a good one.

![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e125999cc4b1.png)

---

For more jokes, and to submit your own joke to get featured, check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/). We're also open sourced, so feel free to view [our GitHub Profile](https://github.com/dailydeveloperjokes).

### Leave this post a ❤️ if you liked today's joke, and stay tuned for tomorrow's joke too!

_This joke comes from [Dad-Jokes GitHub Repo by Wes Bos](https://github.com/wesbos/dad-jokes) (thank you!), whose owner has given me permission to use this joke with credit._

<!--
Joke text:
___Q___: What are clouds made of?

___A___: Mostly linux servers.
 -->