teleren/devto huggingface dataset:
How to make gifs for your Github using Giphy - Is there a better way?
Tags: beginners, giphy, github, gifs
Published: 2020-10-19 00:01:54

---
title: How to make gifs for your Github using Giphy - Is there a better way?
published: true
description: 
tags: beginner, giphy, github, gifs
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/f4mqta8z2eueln3iqa63.png
---

If you're trying to spruce up your Github readme's you're probably looking to add a gif or two showing how your app works or the UI navigation. I've been trying to find an easy way to make gifs without having to resort to my usual way of screen recording in Quicktime and editing it down in After Effects and then compressing it in Photoshop.

![Job Scraper gif](https://dev-to-uploads.s3.amazonaws.com/i/kv2lzglri2bpw5wmis15.gif)

I think I found a good way to do if you're using a Mac. [Giphy has made a Capture App](https://giphy.com/apps/giphycapture) that's really super useful and really easy to use! Just select the screensize and hit record. 

![Screenshot of Giphy app in use](https://dev-to-uploads.s3.amazonaws.com/i/eb55b1ch5v4g1w6bcmpa.png)

The video clip shows at the bottom of the app and once you click on it it'll bring you to a customization menu where you can resize it to trim down on file size or skip frames. 

![Giphy screen capture settings](https://dev-to-uploads.s3.amazonaws.com/i/zxq2fck89rpobf2fe4v6.png)

If you're not uploading the final gif in your actual Github repo, then it'll need to be under 5mb in total size. Depending on how complex your readme is, you might need to split it into other gifs.

I think this is a pretty great and easy way to make gifs and if you've got Photoshop you can extend longer gifs by compressing them further with the options they provide. You can see my gifs in action here in my [job tracker app](https://github.com/denvermullets/joberino-portal-api)

Do you know of any easier or better ways to make screencap gifs? I'd love to revamp the workflow.
How to keep a branch in sync with the main branch in Git?
Tags: git
Published: 2020-10-19 00:00:00

---
  title: How to keep a branch in sync with the main branch in Git?
  published: true
  tags: Git
  date: Mon Oct 19 2020 05:30:00 GMT+0530 (India Standard Time)
  canonical_url: https://melvingeorge.me/blog/keep-local-branch-in-sync-with-master-git
  cover_image: https://melvingeorge.me/_next/static/images/main-ee349b6fa5a08178421a6c48d6bcb87a.jpg
  ---
  [Originally posted here!](https://melvingeorge.me/blog/keep-local-branch-in-sync-with-master-git)
  
To keep the local git branch in sync with the remote `main` branch first, you need to get the latest commits from the remote `main` branch.

### Note: `main` is the new name for `master` branches if you are using Github 🌟.

So first, If you are in the branch where you want the latest commits. Then you need to change to your local `main` branch. This can be done using this command,

```bash
git checkout main
```

Then you need to pull or get the latest commits from the remote `main` branch. This can be achieved using this command,

```bash
git pull main
```

After that, you can change to the branch you need to sync the `main` branch using this command,

```bash
git checkout your_branch_name
```

Then all you have to do is merge the latest commits from the `main` branch we just fetched.

This can be done using this command,

```bash
git merge main
```

That's it. You are done.

### Sometimes you may get merge conflicts during the process, there you need to decide upon which changes you need to keep and which changes to be removed.

### Feel free to share if you found this useful 😃.

---
Anki for Programmers
Tags: anki, study, programming
Published: 2020-10-19 00:00:00

---
title: Anki for Programmers
date: 19-10-2020
spoiler: To Ankify, or not to Ankify?
published: true
tags:
    - anki
    - study
    - programming
---

Should I convert this piece of information to an Anki card or not? Is a question often arises when I’m studying software development. For theory, Anki is always the default choice. But when there is code involved for me it usually doesn’t make sense to convert it into an Anki card.

## Atomic

One rule for Anki cards I abide by, is that they should be atomic. They ask me a simple question with a short answer to mark them as successfully answered. Another habit I have is to practice my Anki cards every single day, to keep that habit going I need to make sure the cards are as simple as possible and I can answer them anywhere I am. 90% of the time I am practicing my Anki cards on my phone. I try to do them just when I wake up. My phone is next to me, and instead of starting to browse Twitter in the morning as my default behavior. I practice my Anki cards.

## Notion

That’s the main reason I don’t want to write pieces of code in my Anki cards for me to have a successful answer. Instead, when I feel like a new piece of information I want to learn needs to be encoded in code, I’ll use Notion. I have made a database in Notion where I keep my coding based exercises. I have buckets of 1 day, 7 days, 16 days, 35 days and 120 days. Which is based on the SuperMemo spaced repetition algorithm. Each successfully completed exercise moves into the next bucket. And with formulas in Notion you can automate and see what the next date of practice will be automatically. With a column showing exercises which are overdue and need to be completed as soon as possible.

## My Golden Rule for Learning

“Anki + Practice + Learn by doing + Multiple resources” is my golden rule of tackling a new topic quickly. Learning should be hard, otherwise you aren’t really doing anything. I’ll explore these topics more in future posts.
DVR Features in Live streaming
Published: 2020-10-20 18:05:15

---
title: DVR Features in Live streaming
published: true
date: 2020-10-19 00:00:00 UTC
tags: 
canonical_url: https://api.video/blog/product-updates/dvr-features-in-live-streaming
---

Video playback on the web allows users to skip forward or rewind. This lets people quickly find the piece of the video they are looking to view, or to move backward and rewatch critical sections of the video. The idea of jumping ahead or rewinding is generalised under the term 'seeking'.

The api.video player offers 2 ways to seek. The most commonly used approach is to click ahead or backwards on the video timeline to seek over large sections of the video. Additionally, we offer buttons below the timeline bar to seek back 10 seconds or ahead 20s: 

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/gk11ji13ddar5k8zfr04.png)


## Live Seek: Video DVR 

If you have ever watched an api.video Livestream, you may have noticed that the same buttons appear in a livestream. This is not an accident - you can seek backwards during a livestream!! 

Imagine you're watching a talk, and you want to hear the speaker repeat a point. With many videos, you might just have to put an asterisk in your notes, and then watch the recorded video when it is posted online. Even with api.video's recording feature making the video available almost immediately after the presentation, this can take a lot of effort to re-hear the point you missed. 

With the DVR feature in our livestreams, you can simply press the 10s backwards button in our player (maybe a couple of times, depending on how far backwards you'd like to go), and you can re-hear the critical information you want \*right away\* without having to wait for the recording. 

You can rewind as often as you'd like. If there is a quiet portion in the presentation, you can then "skip ahead" to watch closer to live. See it in action with this video:

https://embed.api.video/vod/vi5dcd0uAAHx00mDDZfdsinx

The DVR feature allows up to 5 minutes of total "rewind" of a livestreaming video - allowing your users to very carefully pick through the information being presented in your videos without missing a thing.
Got the tee
Tags: hacktoberfest
Published: 2020-10-18 23:27:05

What a jolt of happiness this morning when I checked my inbox and found an email from Digital Ocean letting me know all my PRs had passed the review period and I qualified for this year's t-shirt!

It was my first time contributing to open source and even though it was a little daunting at first, I'm glad I did. Getting comfortable being uncomfortable is addicting!
Upping Your Speaker Game With Auto Posting from PowerPoint
Tags: publicspeaking
Published: 2020-10-19 03:14:49

---
title: Upping Your Speaker Game With Auto Posting from PowerPoint
published: true
date: 2020-10-18 22:28:16 UTC
tags: publicspeaking
canonical_url: https://www.aaron-powell.com/posts/2020-10-19-upping-your-speaker-game-with-auto-posting-from-powerpoint/
---

Last week I was procrastinating on my talk for [NDC Sydney](https://ndcsydney.com) and realised I had a lot of links that I wanted to share with people who would be watching the session, but wasn’t sure what would be the best way to do it. As a virtual event, NDC had a slack channel for the conference, so it’d just be a case of putting the links in there.

But I started to wonder, how could I make it a bit more interesting, and then I remembered that a couple of weeks ago I came across this tweet from [Scott Hanselman](https://hanselman.com/)

{% tweet 1305520517529567233 %}

As someone who’s been doing a bunch of stuff with OBS, I liked the idea, it’s a nifty way to change up the experience when presenting and giving the audience something different compared to your traditional picture-in-picture view.

And this gave me an idea, since we can use the PowerPoint interop API to read the notes, why couldn’t we use it to push to Slack instead?

So, I built that. You’ll find the code on GitHub for [PowerPoint to Places](https://github.com/aaronpowell/PowerPointToPlaces), along with some instructions on how to get it working.

<video controls>
<source type="video/mp4" src="https://www.aaron-powell.com/images/powerpoint-to-slack.mp4"></source>
</video>

Feel free to give it a try, but be aware that it’s written by me, for me, so I make no claims that it’ll work for you, but if people think it’d be a useful tool, let’s make it more general purpose!
Sparrow plugin to lint Terraform scripts using tflint go utility
Tags: terraform, go, rakulang, sparrowhub
Published: 2020-10-18 22:14:46

---
title: Sparrow plugin to lint Terraform scripts using tflint go utility 
published: true
description: How to lint Terraform scripts using Sparrow plugin 
tags: terraform, golang, rakulang, sparrowhub
//cover_image: https://direct_url_to_image.jpg
---

# SYNOPSIS

Meet Sparrow [plugin](http://sparrowhub.io/plugin/tflint/0.000001) to lint Terraform scripts using [tflint](https://github.com/terraform-linters/tflint) go utility.

Let's get started

---

Setup tom helper.

```bash
$ tom --edit tflint
```

```perl
task-run "lint my code", "tflint", %(
 args => [
   "examples",
   [
     "force", 
     "no-color"
   ]
 ]
);
```

Put your Terraform scripts to a directory.

```bash
# put your terraform code to `examples/` directory
$ mkdir examples
```

Run it.

```bash
$ tom tflint
22:10:29 10/18/2020 [repository] index updated from file:///home/ubuntu/repo/api/v1/index
22:10:30 10/18/2020 [lint my code] os: linux
22:10:30 10/18/2020 [lint my code] run [/home/ubuntu/sparrow6/plugins/tflint/linux/tflint examples --force --no-color] ...
22:10:30 10/18/2020 [lint my code] 1 issue(s) found:
22:10:30 10/18/2020 [lint my code]
22:10:30 10/18/2020 [lint my code] Error: "t1.2xlarge" is an invalid value as instance_type (aws_instance_invalid_type)
22:10:30 10/18/2020 [lint my code]
22:10:30 10/18/2020 [lint my code]   on examples/example.tf line 3:
22:10:30 10/18/2020 [lint my code]    3:   instance_type = "t1.2xlarge" # invalid type!
22:10:30 10/18/2020 [lint my code]
```
# Args

See [tflint](https://github.com/terraform-linters/tflint) documentation.

# OS supported

* `linux`

* `mac os`

# Author

Alexey Melezhik

---

That is it. Checkout new plugins on [SparrowHub.io](http://sparrowhub.io). I've been adding new stuff weekly.
Testing Command Line Tools
Tags: node, javascript, typescript
Published: 2020-10-18 22:07:22

# Overview
I think you all know the popular library for creating CLIs called [yargs](https://github.com/yargs/yargs). That is what we are going to be using. Our CLI should reverse a string.
```
$ reverse reverse --string string
gnirts
```
# Setup
Create a folder for your project. Then run these commands inside of it.
```
$ npm init -y
$ npm install -D typescript @types/yargs @types/node
$ npm install --save yargs
```
Make sure you set the `bin` attribute of your `package.json` to `dist/cli.js` and the `main` to `dist/index.js`. Make your `tsconfig.json` look like this:
```json
{
    "compilerOptions": {
      "esModuleInterop": true,
      "module": "CommonJS",
      "moduleResolution": "node",
      "outDir": "./dist",
      "target": "ESNext"
    },
    "exclude": ["node_modules", "**/*.spec.ts"],
    "include": ["src/**/*"]
  }
```

# Creating The CLI
Inside `src/cli.ts`, write this:
```typescript
#!/usr/bin/env node
import yargs from "yargs";

yargs
  .scriptName("reverse")
  .usage("$0 <cmd> [args]")
  .command(
    "reverse [string]",
    "reverse the string",
    (y) => {
      y.positional("string", {
        type: "string",
        default: "string",
        describe: "string to reverse",
      });
    },
    (argv) => {
      console.log(argv.string.split("").reverse().join(""));
    }
  )
  .help().argv;
```
and now you have a working CLI!

# Unit Testing API
First before we create actual tests, we need to change the structure of the project. Create a file called `src/index.ts` and put this inside of it:
```typescript
export function reverseString(str: string) {
    return str.split("").reverse().join("");
}
```
Inside of `src/cli.ts` add an import statement to the top to import `reverseString` from `index.ts` and change the callback to do this:
```typescript
console.log(reverseString((argv.string as string)));
```
So now our CLI has the structure to support unit testing!
So now run these commands:
```
$ npm install -D mocha chai
```
Also, set your `test` script to `tsc && mocha test/**/*.js`.
Now under `test/api/reverseString.spec.js` write this:
```javascript
const { expect } = require("chai");
const { reverseString } = require("../../dist/index");

describe(".reverseString", () => {
  it("should reverse properly", () => {
    expect(reverseString("foo")).to.equal("oof");
  });
});
```
But, this really isn't testing the actual CLI, just the API under it.
# Testing the CLI
Under `test/cli/reverse.spec.js` write this:
```javascript
const { expect } = require("chai");
const { execSync } = require("child_process");

const test = (args) => {
  return execSync(`node dist/cli.js reverse ${args}`).toString();
};

describe("CLI", () => {
  it("should use the positional argument", () => {
    expect(test("--string foo")).to.equal("oof\n");
  });
  it("should use the non positional argument", () => {
    expect(test("foo")).to.equal("oof\n");
  });
});
```
This is probably the worst way to test it, so if you have a better way, feel free to put it in the comments.
Rails Search Bar
Tags: rails, postgres, webdev, tutorial
Published: 2020-10-18 21:56:01

A search bar is an especial feature as a web application grows. There are several ways to implement this feature in a Rails application. This article will explore one of these, by searching a Postgres database with the `pg_search` gem.

## Install pg_search

In a smaller application you can  query the database using ActiveRecord, a simple way to prototype search and filtering. It allows you to quickly find related records for databases of fewer than 1000 records, but, as your database grows, ActiveRecord queries can get overly complex and make your app lag.

Install the gem as usual. Add `gem pg_search` to your `Gemfile` and `bundle install`.

There are two basic search configurations with `pg_search`, a Single Model search scope or a multi Model configuration. In my case I am only using the Single Model configuration, but you can read more about [multi-search](https://github.com/Casecommons/pg_search#multisearchable) in the documentation.

I am using my [Rails Your Congress](https://github.com/eclectic-coding/rails_your_congress) as an example, and I am setting up a search bar on the Senator's search page.

## Model
To start using `pg_search`, you need to include `PgSearch` in your model and set up the `pg_search_scope`:
```ruby
class Senator < ApplicationRecord
  include PgSearch

  scope :sorted, ->{ order(last_name: :asc) }

  pg_search_scope :global_search,
                  against: [:first_name, :last_name, :state],
                  using: { tsearch: { prefix: true } }
end
```
In this example, I am searching from the Senator resource, by `first_name`, `last_name`, and `state`.

## Controller
Since, I am providing a search on the index page, the index method in the Senators controller:
```ruby
class SenatorsController < ApplicationController

  def index
    if params[:query].present?
      @senator_search = Senator.global_search(params[:query])
      @senators = @senator_search.paginate(page: params[:page], per_page: 20)
    else
      @senators = Senator.paginate(page: params[:page], per_page: 20)
    end

    respond_to do |format|
      format.html
      format.json { render json: { senators: @senators } }
    end
  end
  ```
  In this method, we set a conditional to determine if we are searching or not. If we are searching we are setting two instance variables. The variable `@senators` is used in the views, and I had to set up two variables to get `will_paginate` to play nicely with the `pg_search` results.

## Improvements
With each search the entire page re-renders. So next week we will look at how I set up StimulusJS to make the Senator container reactive.

## Footnote

This has been fun. Leave a comment or send me a DM on [Twitter](http://twitter.com/EclecticCoding).

Shameless Plug: If you work at a great company, and you are in the market for a Software Developer with a varied skill set and life experiences, send me a message on [Twitter](http://twitter.com/EclecticCoding) and check out my [LinkedIn](http://www.linkedin.com/in/dev-chuck-smith).
Hacktoberfest-2020 :)
Tags: hacktoberfest
Published: 2020-10-18 21:32:04

## What I Learned From Hacktoberfest 

<!-- What did you learn that can help others contribute to the project you worked on? What did you learn that can help the users of that project?! -->
I learned a lot while contributing to different projects. Earlier before this , I used to think that contributing to others project is tough ,but by contributing this October , I got introduced to open source. 
Kudos to Digital Ocean, Intel, and Dev for organizing this event.
Looking forward to continue contributing to Open Source in the future.
my first hacktoberfest :)
Tags: hacktoberfest, hacktoberfest2020
Published: 2020-10-18 21:31:56

This was the first time I made contributions to projects on Github and I was only able to do so due to Hacktoberfest 2020. Before that, I had a certain fear of making a pull request, because I didn't know the basics of Git and thought that people would reject my contributions because I did something wrong... or whatever, that I wasn't good at. I say this because Github is a Universe still being explored by me, that I'm getting to know little by little. And Git, was something that I haded problems to "record" the commands in my mind...

But finding repositories that brought in your README step by step to make pull requests gave me some peace of mind. Another thing that helped me a lot was this video of the Brazilian programmer Claudson Oliveira:

{% youtube Du04jBWrv4A %}

## What I Learned From Hacktoberfest 2020

And beyond finally learning how to make extraction requests, I learned that the amazing open source projects have easy, complicated and difficult questions to solve. Another thing is that you don't just have to contribute code. You can help translate a structure or you can contribute README that needs proofreading or more content.
 
### My contributions
I started with the basics: learn to pull request with Git. And for that, I followed the steps described in the README and sent my name to this repository [codersanjeev/learn-git](https://github.com/codersanjeev/learn-git). This was just a test. 😌

Okay, after that I went hunting for projects that needed contributions (and that were using the Hacktoberfest tag). I tried to give priority to Brazilian repositories for two reasons: Brazil is my country and the content in Portuguese would facilitate my understanding. Discovered that the [Perifacode](https://github.com/perifacode/conteudo-gratuito) project has a repository that accepts tips from free technology courses, so I contributed by adding the SoloLearn website to the README.

Another README that I contributed, was for one that lists the best tests of (Buzzfeed to relax us programmers)[https://github.com/dandaramcsousa/grandes-testes-do-buzzfeed]. Cool huh? 

But... I didn't just want to mess with README. I wanted to contribute with codes. And recently, I started studying Python so I had the idea of ​​looking for repositories that would accept simple Python algorithms that did something interesting. 🐍

So I contributed to this repository (iagotito/hacktoberfest)[https://github.com/iagotito/hacktoberfest], sending an algorithm in Python that converts the temperature from Celcius to Fahrenheit. And for this repository (manish-virgat/Hacktoberfest-Python)[https://github.com/manish-virgat/Hacktoberfest-Python], sending an algorithm that returns if the letter typed is a vowel or consonant. Nice!

![cat](https://dev-to-uploads.s3.amazonaws.com/i/9kbrt10wgkaon71lplzf.gif)

That's it. This was a brief description of my first participation in Hacktoberfest and now that I have learned, I will continue contributing to the community 💜