teleren/devto huggingface dataset:
Setting up RSS feed for my Gridsome blog
Tags: blog, rss, gridsome
Published: 2019-10-26 14:22:34

---
title: Setting up RSS feed for my Gridsome blog
published: true
date: 2019-10-26 00:00:00 UTC
tags: blog,rss,gridsome
canonical_url: https://www.cgweb.co.uk/content/posts/setting-up-rss/
---

I've spent a couple (read a few) hours yesterday and today attempting to setup an RSS feed for my blog which is built using [Gridsome](https://gridsome.org/) primarily so I could cross post on here. I initially had a look at the Gridsome plugins and decided to try and setup this up using the [gridsome-plugin-rss](https://gridsome.org/plugins/gridsome-plugin-rss) adding the following to my gridsome.config.js file:

```
plugins: [
    {
      use: 'gridsome-plugin-rss',
      options: {
        contentTypeName: 'Post',
        feedOptions: {
          title: 'My Blog',
          feed_url: 'https://www.cgweb.co.uk/rss.xml',
          site_url: 'https://www.cgweb.co.uk/'
        },
        feedItemOptions: node => ({
          title: node.title,
          description: node.description,
          url: 'https://www.cgweb.co.uk/content/posts/' + node.slug
        }),
        output: {
          dir: './static',
          name: 'rss.xml'
        }
      }
    }
]
```

This was partially successful as it generated the RSS page on my site and was correctly displaying the title of the posts, but not the links and the main content of the posts I think because I was using node.slug which was showing as undefined in the feed. I tried a couple of things which partially worked, but after a quick google I found a couple of posts for setting this up using the other available Gridsome plugin called [gridsome-plugin-feed](https://gridsome.org/plugins/gridsome-plugin-feed) so I went back to the docs installed it via npm and using the docs as my base added the following to my config file (there are additional options you can setup such as atom or JSON outputs but I have no need for these):

```
    {
      use: 'gridsome-plugin-feed',
      options: {
        contentTypes: ['Post'],
        feedOptions: {
          title: 'Dev Blog',
          description:
            'My web dev blog'
        },
        rss: {
          enabled: true,
          output: '/feed.xml'
        },
        maxItems: 25,
        filterNodes: node => true,
        nodeToFeedItem: node => ({
          title: node.title,
          date: node.date || node.fields.date,
          content: node.content
        })
      }
    }
```

Hope this may prove useful to someone who has had similar issues. 

On a side note I also learnt how to add images to my markdown posts which is done using the following formatting: 
``` 
![alt text](imageurl) 
``` 
From this great [Markdown cheat sheet](https://www.markdownguide.org/cheat-sheet) how I did not know this before I've no idea but super useful to know.
How to Convert Markdown to PDF/docx
Tags: markdown, pdf, document
Published: 2020-01-31 09:48:04

---
title: How to Convert Markdown to PDF/docx
published: true
date: 2019-10-26 00:00:00 UTC
tags: markdown, pdf, document
canonical_url: https://tech.serhatteker.com/post/2019-10/convert-md-to-pdf/
---

There are a lof options out there but I would suggest to use `pandoc` to convert your `markdown` files to `PDF`, `docx` etc..

From [Ubuntu pandoc manpage]:

> Pandoc  is  a  Haskell  library  for  converting  from one markup format to another, and a
> command-line tool that uses this library.  It can read Markdown, CommonMark, PHP  Markdown
> Extra,    GitHub-Flavored    Markdown,    MultiMarkdown,   and   (subsets   of)   Textile,
> reStructuredText, HTML, LaTeX, MediaWiki markup, TWiki markup, Haddock markup, OPML, Emacs
> Org  mode,  DocBook,  txt2tags,  EPUB,  ODT  and  Word  docx; and it can write plain text,
> Markdown,  CommonMark,  PHP  Markdown  Extra,  GitHub-Flavored  Markdown,   MultiMarkdown,
> reStructuredText,  XHTML, HTML5, LaTeX (including beamer slide shows), ConTeXt, RTF, OPML,
> DocBook, OpenDocument, ODT, Word docx, GNU Texinfo,  MediaWiki  markup,  DokuWiki  markup,
> ZimWiki  markup,  Haddock markup, EPUB (v2 or v3), FictionBook2, Textile, groff man pages,
> Emacs Org mode, AsciiDoc, InDesign  ICML,  TEI  Simple,  and  Slidy,  Slideous,  DZSlides,
> reveal.js  or S5 HTML slide shows.  It can also produce PDF output on systems where LaTeX,
> ConTeXt, or wkhtmltopdf is installed.

To convert just write:

```sh
$ pandoc README.md -o README.pdf
```

where `-o` is "output".

By  default,  pandoc produces a document fragment, not a standalone document with a proper header and footer.  To produce a standalone document, use the `-s` or `--standalone` flag:

```sh
$ pandoc -s -o output.html input.txt
```

For more information go and visit [pandoc official page](pandoc).

All done!

[Ubuntu pandoc manpage]: http://manpages.ubuntu.com/manpages/bionic/man1/pandoc.1.html
[pandoc]: https://pandoc.org/
tpadvertisex(3c): a new cool Oracle Tuxedo 12.2 feature
Tags: oracle, tuxedo, tpadvertisex
Published: 2021-11-03 06:27:51

---
title: tpadvertisex(3c): a new cool Oracle Tuxedo 12.2 feature
published: true
date: 2019-10-26 00:00:00 UTC
tags: oracle,tuxedo,tpadvertisex
canonical_url: http://aivarsk.com/2019/10/26/tpadvertisex/
---

A service call in Oracle Tuxedo ends up in some System V message queue. What happens next depends on the configuration in `UBBCONFIG`:

In a Single-Server-Single-Queue setup exactly one instance of the server will process the message. But it might also crash and lose all requests currently in the queue. Or requests may queue up because one request takes a longer time to process than others. Requests will stay in the queue although there are idle instances of servers that could process them.

In a Multiple-Servers-Single-Queue set up multiple instances of server process messages: it provides a better load balancing because any idle instance will pick up the next message. It also provides a better availability because a single instance can crash and be restarted while others continue working and no messages are lost. MSSQ is what you need most of the time. The only downside is that there is no possibility to call a specific instance of the server because instance can’t provide a unique service (limitation of MSSQ).

I have a couple of use cases for that:

- “adapter” servers that have a long-running service polling network, database or filesystem
- notifications to reload caches
- writing buffers to disk, closing files, committing database transactions

Oracle Tuxedo 12.2 adds a new [`tpadvertisex()` function call](https://docs.oracle.com/cd/E72452_01/tuxedo/docs1222/rf3c/rf3c.html#2548645) that allows advertising unique services. It requires a new [`SECONDARYRQ` parameter](https://docs.oracle.com/cd/E72452_01/tuxedo/docs1222/rf5/rf5.html#1532198) in `UBBCONFIG` that creates a new private message queue for each server. Each server can listen on two queues now. That should have the best of both worlds: load balancing, availability and unique service for each server that I can call when needed.

But it does not work. For now.

At first, I was worried when MIB’s `T_SVCGRP` showed too many duplicate services but I hoped it was a cosmetic bug. But `tpcall()` to the services that should be unique for each server got received by server instances that did not advertise them. So for now there is no difference between `tpadvertise()` and `tpadvertisex()`.

I created a new service request and hope to see a fix soon.

[Here is a simple code with `tpadvertisex()` that does not work](https://github.com/fuxedo/tuxedo-examples/tree/master/tpadvertisex)
Spring boot social and dependencies overview
Tags: java, spring, springsocial, sociallogin
Published: 2019-10-25 22:57:55

This post is based on my latest experience, where i was just wanted to integrate Social login within my application. After spring boot it seems it is easy piece of cake, Yes i was developing an application and services using springboot, and here my struggle start.
Problem is spring do lot of thing behind the scene which some time make difficult to understand as we are developer we need all the control at-least we deserve to know whats going on (scherzosa). 

First thing needed is the dependencies and here world of spring starter starts and dilemma of how to choose, This post mainly focus on the Spring starter dependencies and when to choose which one. 

When i started to search how to integrate with social login i came across to following options. 
1. Use Spring Oauth2 client
2. Use Spring Social. 

Now to go with the first option Spring provides two starter which comes with two different flavour

A. If you are using Spring boot.

![springbootway](https://thepracticaldev.s3.amazonaws.com/i/j6lmdta9zlra0fn3j7oo.png)
![springbootway](https://thepracticaldev.s3.amazonaws.com/i/0e5gz0w4b831hj67m71l.png)


B. If you are using only spring security in your project

![springsecurityonly](https://thepracticaldev.s3.amazonaws.com/i/b9kg1tm18y2bl149jaua.png)
![springsecurityonlydependency](https://thepracticaldev.s3.amazonaws.com/i/f02dtnxd33wpfwwjsow1.png)

But some time we have a case where we don't need security from spring or we need only social login without security definition or any security context. Spring provide solution for such cases where we can choose spring social integration with specific provider like facebook, linkedin etc. 
Here are the dependencies use for such cases. 
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/93bshesmc43q3dy077n5.png)

Basically spring has different stream of projects, they usually combine some in specific starter like mostly spring boot starter and some specific stream starter like security. But one can always choose independent stream like Social case by case need. 

After sorting out which dependencies should be needed we have to do real stuff, each dependencies come with some specific set of functionality. In later post i will try to cover the difference in the implementation.
Day 20 : Money
Tags: hiphop, code, coding, lifelongdev
Published: 2019-10-25 22:54:23

_liner notes_:
- Professional : Finally finished all the orientation videos that were due soon! Also got the Application and Use Case write up approved and up on the Nexmo website! I'm pretty sure I can post it here, because it is available on a publicly assessable website: https://developer.nexmo.com/use-cases/digital-marketplace-client-sdk I had not used React in a while nor Hooks ever before this project, but I got everything working. There's things that could definitely be refined, but I got the main focus of the Use Case in there. Plus, I'm going to make a branch and work on it some more. haha Had a really good meeting with my manager. Next week is the big Vonage Campus event happening in San Fransisco ( https://www.vonage.com/campus/ ). I joined a little to late to be able to attend. Next year, I'll definitely be in attendance!

- Personal : Got my laundry done. Mowed the lawn. Worked on tomorrow's radio show. It's amazing what you can get done when you don't have like a 3 hour daily commute. haha. Decided that I'm going to drop the money on the GoPro Max. Hey, it's Pay day and I've been doing well at work. Yeah, that's the justification. haha But seriously, I have a plan and different scenarios already planned out for it.

![Mountains in China](https://thepracticaldev.s3.amazonaws.com/i/bbwj6m99svpobgnw3xro.jpg)

Going to spend the rest of the night finishing up preparing for the radio show and ironing my laundry. Probably catch up on my anime and get to bed early.  

Have a great weekend!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube EiBoFw2meAQ %}
RSS Help
Tags: help, rsshelp, gridsome, blogging
Published: 2019-10-25 21:45:56

---
title: RSS Help
published: true
description: 
tags: help,rsshelp,gridsome,blogging
---

## RSS help needed anyone use it with Gridsome?

I have recently migrated a blog from jeykll to Gridsome which I have deployed through Netlify. I am attempting to setup RSS but I'm unable to get it fully setup. I am using the gridsome-rss-plugin as listed in the [Gridsome docs](https://gridsome.org/plugins/gridsome-plugin-rss) the RSS page is generated fine however I am seeing undefined on the end of the links [here](https://www.cgweb.co.uk/rss.xml) node.slug in the config why? 
The title of the posts display correctly, but on the end of the URLs I see undefined and I am not sure what I should be targeting to setup this up correctly. I am a newbie to this so may be missing something obvious. 

Any help would be much appreciated. 



This is what I have in the config:
```  
{
      use: 'gridsome-plugin-rss',
      options: {
        contentTypeName: 'Post',
        feedOptions: {
          title: 'My Dev Blog',
          feed_url: 'https://www.cgweb.co.uk/rss.xml',
          site_url: 'https://www.cgweb.co.uk/'
        },
        feedItemOptions: node => ({
          title: node.title,
          description: node.description,
          url: 'https://www.cgweb.co.uk/content/posts/' + node.slug
        }),
        output: {
          dir: './static',
          name: 'rss.xml'
        }
      }
    }
```

Update: I have now fixed this and can need successfully cross post from my blog to here see my [other post](https://dev.to/cguttweb/setting-up-rss-feed-for-my-gridsome-blog-3g9i)
A Simple Formula For When To Use Let, Const, and Var
Tags: javascript
Published: 2019-10-25 20:40:21

The new ES6 variable declarations `let` and `const` have been available in major browsers for several years, but when to use each still causes a bit of confusion. Although everyone has a different style and preferences, the above flowchart is how I choose which one to use. There are more in-depth guides to the exact differences between each, but this is meant to be a simplified way of how to choose without getting too deep into the nuances of the javascript runtime.

![Flowchart](https://thepracticaldev.s3.amazonaws.com/i/uv621lcbaqxx8vq36yl2.png) 

`var` was the original way to declare a variable. For a while, it had to be used for any non-transpiled code because of compatibility concerns. By now, all major browsers and even IE11 support `let` and `const`. The `var` keyword declares a mutable reference to a value, but it is not [block scoped](https://dev.to/sandy8111112004/javascript-introduction-to-scope-function-scope-block-scope-d11). As someone who mostly writes c#, this means that it will occasionally cause some unexpected behavior. See [this stack overflow response](https://stackoverflow.com/a/30479554/4541880) for some examples. It also permits bad practices like referencing a variable before it's been declared.

`let` and `const` give a more predictable experience and both generally act like you would expect a variable declaration to. The only significant difference is whether you can reassign the value. In my experience, reassignments can often be refactored to be immutable references. This means they never change state which improves clarity. Consider the following:

```javascript
let value = readInput();

value = value.toUpperCase();

return value;
```

The variable `value` is reassigned to hold different values representing different states. At a glance, you can't tell what state the variable holds, which makes complex logic significantly more difficult to comprehend. Instead, by using the `const` keyword, we can ensure that the variable will only ever hold the state it's initially assigned. You'll also note that our variable names can become much more descriptive when one variable doesn't need to hold multiple states. Reassigned variables often are named generic terms like "output", "value", etc.

```javascript
const input = readInput();

const upperCasedInput = input.toUpperCase();

return upperCasedInput; // this line is self-explanatory
```

In general, I find that `const` is always my preferred way to declare a variable. Sometimes, you can't avoid reassignments, so I fall back to `let` if there's no way to refactor away from it. I don't even consider using `var` except when working with legacy code.

_Cover Image by Irvan Smith on Unsplash_
How To Use Mocking in JavaScript Tests Using Jest
Tags: javascript, softwareengineering, technology, softwaredevelopment
Published: 2020-02-12 21:34:32

---
title: How To Use Mocking in JavaScript Tests Using Jest
published: true
date: 2019-10-25 21:06:29 UTC
tags: javascript,software-engineering,technology,software-development
canonical_url: 
---

[![](https://cdn-images-1.medium.com/max/2600/0*0UyP_l-RSYRmFlnH)](https://medium.com/better-programming/how-to-use-mocking-in-javascript-tests-using-jest-67cf513f47c0?source=rss-3a534b5053e6------2)

Write awesome tests with ease using mocking

[Continue reading on Better Programming »](https://medium.com/better-programming/how-to-use-mocking-in-javascript-tests-using-jest-67cf513f47c0?source=rss-3a534b5053e6------2)
Asynchronous JavaScript With async/await egghead.io Course Summary
Published: 2019-10-25 20:38:10

This post will be a summary of what I learned from the Asynchronous JavaScript with async/await course from Marius Schulz on [egghead.io](https://egghead.io). If you've never taken an egghead course before, its goes straight to the meat. No fluff just right in **using the concept in practice.** 

To make a function asynchronous all we have to do is add the `async` keyword(easy right?). By default regular JavaScript functions are not asynchronous meaning they wait there turn to run.

By adding the async keyword JavaScript can move on to another task while the function finishes. You can a make any type of function async.

The await keyword can only be used inside of a async function and it will pause the function until a promise is received. An async function is like a boomerang, when you send it out it always comes back with a promise. If the promise is rejected it you'll get a rejected value, if the promise is resolved you can store in a variable.

```javascript
async function showGitHubUser(handle){
const url = `https://api.github.com/users/${handle}`;
const response = await fetch(url);
const user = await response.json();
console.log(user.name);
console.log(user.location);
}
```
One thing I thought was really cool about the await keyword is that you can use it to pause more than one request, and wait until they both are returned. You can do this by storing the promise that is returned in variables and awaiting the return of those variables. 

This is better for performance you don't want a slow down of waiting for one request to finish then starting all the way over.

```javascript
async function showUserAndRepos(handle) {
    const userPromise = fetchFromGitHub(`/users/${handle}`);
    const reposPromise = fetchFromGitHub(`/users/${handle}/repos`);

    const user = await userPromise;
    const repos = await reposPromise;

    console.log(user.name);
    console.log(`${repos.length} repos`);
}
```

The last thing that stuck out to me was the **for await of loop**. It's gives us the ability to loop over async objects asynchronously. A for await of loop also receives promises and wait for them to be resolved.

From having no prior experience with async/await I learned a lot about and would feel comfortable using in my own projects.

```javascript
async function main() {
    for await (const value of someGenerator()) {
        console.log(value);
    }
}
```

Now for a quiz! Try to recall the answers from memory!

**An async function always returns a object? True or false**

**You can only make arrow function asynchronous? True or false**

**How do you make a function asynchronous?**
A. By wishing it was
B. By adding the async keyword at the beginning of the function
C. By add the await keyword inside the function

**How did you do?**

Also here is a link to a repl.it I've made to show off the async function in action.

[GitHub User Search Async/Await](https://repl.it/@wjohnson85/eggheadioasyncawait)
deploy on production server .........    git pull->  maven build -> run jar 
Tags: devops, java, todayisearched, discuss
Published: 2019-10-25 20:26:40

We started to decouple our codebase to multiple microservices.

we created a few java springboot microservices.

Our deploy strategy

Once we commit our files to git.
our deploy script will git pull the changes to the production server 
do -> mvn build -> move JAR to a path -> start it up.

And its incredibly fast.

What do you think about this approach?
Automate presentation speaker notes
Tags: discuss, beginners, api, programming
Published: 2019-10-25 20:25:30

What are <strong>speaker notes</strong> actually?💁‍♀️
I like the explanations that they are a <strong>mind map of the presentation</strong>.👆

<h3>Speaker notes’ workflow</h3>
Usually my workflow to prepare speaker notes is the following:
1. I prepare a separate document with my speech.
2. Then I need to sort out the theses from this text as speaker notes.
3. I prefer to have them printed in case something goes wrong. And, trust me, when you need to present - something goes wrong more often than you expect. Powerpoint starts to buggy, computer breaks up, meteorites fall...😅
4. Then I need to add speaker notes into each slide.

<p>It takes time...🤦‍♀️</p>

Or I can do vice versa:
1. <strong>Add speaker notes</strong> one by one into each slide.
2. <strong>Export speaker notes</strong> into a document and print.

I may also need to give speaker notes to team members, who also work under this presentation. Or share speaker notes with the audience.

<strong><i>How do you prepare speaker notes?<i/> Please share in comments.</strong>👇

<h3>Automate speaker notes</h3>
Being developers, we like to automate everything. So and I was looking for a way to <strong>automatically manage speaker notes</strong>.

<strong>[Aspose.Slides API](https://products.aspose.com/slides?utm_source=https://dev.to/aspose_slides/automate-presentation-speaker-notes-3dnc&utm_medium=email)</strong> was a good solution for me, as it also allows many other options as: <strong>copy slide notes</strong> from another presentations; <strong>convert slide notes into HTML</strong> in case I want to pubish it on the web; and others.

I will better show you how I <strong>add slide notes</strong>:
```csharp
// Create presentation
using(Presentation presentation = new Presentation())
{
    // Create slide notes
    INotesSlide notesSlide = presentation.Slides[0].NotesSlideManager.AddNotesSlide();
    notesSlide.NotesTextFrame.Text = "This is my very helpful slide note!";
    presentation.ViewProperties.NormalViewProperties.HorizontalBarState = SplitterBarStateType.Restored;

    presentation.Save("pres.pptx", SaveFormat.Pptx);
}
```

Then I may want to <strong>access slide notes for extracting</strong> them anywhere, or I would <strong>convert slide notes into HTML to publish them</strong> on web:
```csharp
    // Access slide notes for extracting
    var slide = presentation.Slides[0];
    NotesSlideEx notes = slide.NotesSlide;

    // Convert into HTML
    HtmlOptions opt = new HtmlOptions();
    INotesCommentsLayoutingOptions options = opt.NotesCommentsLayouting;
    options.NotesPosition = NotesPositions.BottomFull;
    presentation.Save("output.html", SaveFormat.Html, opt);
```

Easy!👌

It’s also possible to use Aspose.Slides from Java, C++ or other languages.


<strong><i>How do you automate working with speaker notes? What would you like to automate here?<i/> Please share in comments.</strong>👇