teleren/devto huggingface dataset:
Python Wrapper For Indeed Job Search API
Tags: python, indeed, jobsearch
Published: 2018-07-31 21:51:03

---
title: Python Wrapper For Indeed Job Search API
published: true
description: A Python wrapper to fetch job listings from Indeed Job Search API
tags: Python, Indeed, Job Search
---

# Python Wrapper For Indeed Job Search API

![Python Wrapper For Indeed Job Search API](https://thepracticaldev.s3.amazonaws.com/i/76u4lfx01t8dlfkq4pds.jpg)


Recently, I was looking for a Python wrapper to work with Indeed API. Unable to find one that fulfills my requirements, I wrote a quick and simple Python script that consumes Indeed job search API and stores the search results in a CSV.

In order to run the script and fetch jobs from Indeed job search API, you must have:

- Indeed Publisher API ID, available for free from [here](https://ads.indeed.com/jobroll/xmlfeed)
- Python 3.x
- BeautifulSoup and Requests libraries

### Usage:
The code for Python wrapper for Indeed Job Search API is available at GitHub. [Download it from here](https://github.com/kashaziz/indeed-python-wrapper).

Open indeedapiwrapper.py, add following parameters to fetch job listings through Indeed Job Search API:

```
params = {
    'publisher': "",    # publisher ID (Required)
    'q': "",            # Job search query
    'l': "",            # location (city / state)
    'co': "",           # Two letter Country Code
    'sort': "",         # Sort order, date or relevance
    'days': ""          # number of days to fetch jobs, maximum is 7 days
    }   
```

**Note:**

- Publisher Id is required.
- To search jobs, either provide query string or combination of location and country code.
- To return relevant jobs, the script requires the presence of either query string or the combination of location and country code. In case query sting is not present and either one of location or country code is missing, the script will use “Karachi” and “pk” as default location and country code.

For example, following search parameters will search for all Python jobs in Karachi, Pakistan.

```
params = {
    'publisher': "0000000000000000",    # Use valid Id to get results 
    'q': "python",  
    'l': "karachi",  
    'co': "pk",  
    'sort': "date",                # Sort by date
    'days': "3"                    # get jobs for 3 days, including today
    }   
```

### Output:
The list of jobs will be saved in a CSV file “indeedjobs.csv” in the same directory where the script resides.

### Resources:
Indeed job search API documentation is available [here](http://opensource.indeedeng.io/api-documentation/docs/job-search/).

Code for Python wrapper for Indeed Job Search API [Download it from here](https://github.com/kashaziz/indeed-python-wrapper).
Queue - Data structure
Tags: queue, datastructures, algorithms, linkedlists
Published: 2018-07-31 21:49:12

---
title: Queue - Data structure
published: True
description: Crash course in Queue data structure
tags: Queue, Data structures, Algorithms, Linked lists
---

##Queue is data structure like array and stack. But here the first element added to the queue, will be the first element removed from the queue. So queue called first in first out (FIFO) or first come first serve

![Alt Stack](https://github.com/mohamedkhaledyousef/Crash-courses/blob/master/img/queue.jpeg?raw=true "queue")


##We can in queue:
**Enqueue(Key): To add key to collection**
**Key Dequeue(): To remove and return least recently-added key**
**Boolean Empty(): means,, Are there any elements?**

##Queue implementation:
**We can implement queue in several way (Linked list, Array, 2 Stack).**

##Queue implementation with linked list:
###There two things we must to know:

**The first** : When we enqueue, we are going to push to the back of the linked list
**The second** : To make sure the the queue list is empty , we make sure if the head is null or not

##Here the code using linked list:
{% gist https://gist.github.com/mohamedkhaledyousef/0f298c8003c30c65d85677e8ec1be6a3 %}

##Queue implementation with array:
**It’s easy to implement queue using array but pay attention in this case.**

##When we want to enqueue(g) maybe causes error!! WHY??
This case occurred when we have array say with size (5) but this array have (4) occupied by values

**Here example:**
![Alt Stack](https://github.com/mohamedkhaledyousef/Crash-courses/blob/master/img/enqueue.png?raw=true "enqueue") 

##if we did enqueue(g), The read and write would be both 2
* And it would be hard to distinguish read and write index 2 because the queue is full
* Or read and write index both 2 because the queue is empty
* So we have a buffer of at least one that can’t be written to make sure read and write are separate and and distinct if the queue isn’t empty

**Notice:**
one distinction between the array and linked list implementation 
 is that in the array implementation we have a maximum size that the queue can grow to so it is bounded

##Here the code using array:
{% gist https://gist.github.com/mohamedkhaledyousef/5d998a7ed638e0ef9fe4030056ab6cef %}

 
##Queue time complexity
###Cost for doing a dequeue and enqueue , all are O(1). And there is no “worst case”

###Finally … [Here] (https://github.com/mohamedkhaledyousef/Crash-courses/tree/master/Queue) you can find how to implement queue using 2 stack and all source code in c++
A Simple (Yet Powerful) Tip on Git and Vim
Tags: vim, git
Published: 2018-07-31 20:35:57

---
title: A Simple (Yet Powerful) Tip on Git and Vim
published: true
description: 
tags: vim, git
---

Here's a tip you might find useful if you work with `git` and you use Vim. I recently came up with it.

For example, I want to see a file in different branch while staying in my current branch(so without changing the branch). I could use command like:

```
git show branch_name:/path/to/file.pl
```


But what if I want to see this file in Vim? It's easy, I could run a command like:

```
git show branch_name:/path/to/file.pl | vim -
```


However, this way there's no syntax highlight, so we can fix this:

```
git show branch_name:/path/to/file.pl | vim - -c 'set syntax=perl'
```

That's nice :) now my Perl file is properly highlighted.


Okay, but what if I work with Perl, and Python, and Bash, etc. It's not very handy to type all of this every time.


Here's one solution - you could create aliases:

```
alias vim.py="vim - -c 'set syntax=python'"
alias vim.pl="vim - -c 'set syntax=perl'"
```

So next time you need to see a Python file in different branch than your current one, you could run:

```
git show branch_name:/path/to/file.py | vim.py
```


I hope you find this useful.

---

I share tips like this in Mastering Vim Quickly newsletter at http://masteringvim.com.
Who's looking for open source contributors? (July 31 edition)
Tags: discuss, opensource
Published: 2018-07-31 19:35:16

Please shamelessly promote your project. Everyone who posted in previous weeks is welcome back this week, as always. 😄

P.S. I usually post these on Monday but the week got off to a pretty hectic start since coming back from Google Next so I didn't get to it yesterday. Hopefully it didn't cause too much confusion.
Bad Product Ideas
Published: 2018-07-31 19:09:18

---
title: Bad Product Ideas
published: true
description: PeerTube's fight to break the YouTube stranglehold on video
tags: 
---

[PeerTube, the “Decentralized YouTube”, succeeds in crowdfunding](http://frame.bloglovin.com/?post=6443719287&blog=1029&frame_type=none)

I'm seeing folly all over the startup and tech landscape.  The Yuser app wants to be the next Facebook - with the added wrinkle that users get blockchain coin for eyeball grabbing content and no advertising.  And now PeerTube promises to break YouTubes' grip on video.

Sorry PeerTube, I don't think it will happen.  You are just a new Napster, and we all know what happened to Napster.  Sorry Yuser, the cost of policing your platform will eat you alive.

The bottom line is that PeerTube and Yuser have the same fundamental problem: user generated content with next to zero policing.  Both are designed with little to no oversight built in.  Because of this, all of the worst of humanity will spill into these communities.  They will become cesspools of trash.

I see a new security paradigm coming.  Yes we worry about DDoS attacks and fishing.   And the new security frontier is security from the nastiness of humanity.  PeerTube and Yuser will either have to spend tons of money securing their user generated footprints or be relegated the the corners of the internet where porn, terrorism, human trafficking, arms sales, and NeoNazi's find refuge.

Have they never heard of 4chan?
Do your commits pass this simple test?
Tags: git, scm
Published: 2018-07-31 18:07:51

---
title: Do your commits pass this simple test?
published: true
description: These are 5 qualities of a solid commit.  Do you have them?
tags: git, scm
cover_image: https://images.unsplash.com/photo-1432888498266-38ffec3eaf0a?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=f38005f4ef6c02f1e40c1a3af591f5e9&dpr=1&auto=format&fit=crop&w=1000&q=80&cs=tinysrgb
---

_[Photo by William Iven on Unsplash](https://images.unsplash.com/photo-1432888498266-38ffec3eaf0a?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=f38005f4ef6c02f1e40c1a3af591f5e9&dpr=1&auto=format&fit=crop&w=1000&q=80&cs=tinysrgb)_

Frequent.
Descriptive.
Atomic.
Decentralized.
Immutable.

I'll leave it up to your imagination to come up with a clever mnemonic to remember that acronym above.

I love writing about Git and SCM in general because I believe it's crucial to proper CI/CD practices.  It's how we submit our code.  It should matter.

I've come up with a solid metric for measuring the success and value of a commit.  It has 5 key points I've mentioned above.  

## Frequent

When did you last commit? 2 seconds ago or 2 hours ago.  The longer you wait, the more trouble you will have with having your commits tell a story.  How long did you wait before your last commit?

## Descriptive

Click.  That's usually the sound a camera makes when it takes a picture.  That's the same idea when Git captures a diff of your changes and you put your label on it.  I've found Git commit messages are oftentimes more useful than code comments. Can you describe your change verbosely, yet concisely? 

## Atomic

Are you the type that throws everything in a laundry bin or do you sort your clothes before washing?  We can relate laundry to commit messages, in a way.  Your commit should only have related changes.  Each commit should be easy to revert.  Keep your commits small and relevant and you will never have to undo hours of work.  Did you keep this commit small and only containing relevant changes, not ALL changes?

## Decentralized

This one is super easy.  Git doesn't automatically upload your commits to the "Cloud".  Everything is local until you push your commits to a separate repo.  Most of us humans use GitHub or something like it.  Have you pushed this commit yet?

## Immutable

A commit is a commitment.  Once it's done, do your best to avoid changing it.  That means timestamps, authors, and even the contents should never change after it's saved.  Is your commit a "forever commit"?
Quickly Change Directory to the Repo You Just Cloned
Tags: git, bash, zsh
Published: 2018-07-31 17:38:34

---
title: Quickly Change Directory to the Repo You Just Cloned
published: true
description: Learn how to shave off some keystrokes to boost your command line efficiency!
tags: git,bash,zsh
---

_Originally published at [hoelz.ro](https://hoelz.ro/blog/quickly-change-directory-to-the-repo-you-just-cloned)_

A common pattern in my shell usage is something like this:

```
  $ mkdir a-directory-name
  $ cd !$
```

For those of you who aren't familiar with it, `!$` is a Bash history expansion for the last argument of the previous command - so my example above creates a directory and then cd's into it.  However, this trick doesn't apply when using the single argument form of `git clone`:

```
  $ git clone hoelzro:linotify
  $ cd !$
  bash: cd: hoelzro:linotify: No such file or directory
```

So I augmented Bash's `cd` function to work in this context:

```
cd() {
    if [[ $1 =~ ^hoelzro: && ! -d $1 ]]; then
        cd ${1/hoelzro:/}
    elif [[ $1 =~ github:.*/ && ! -d $1 ]]; then
        cd ${1/github:*\//}
    else
        builtin cd "$@"
    fi
}
```

I've since converted to Zsh, so I also created a Zsh version as well:

```
function cd {
    local previous_command

    previous_command=$(fc -nl -1 -1)

    if [[ $previous_command =~ ^git && $previous_command =~ clone ]]; then
        if [[ ! -d $1 && $1 =~ (hoelzro|github): ]]; then
            local destination

            destination=$1
            destination=${destination#(github:*/|hoelzro:)}
            destination=${destination%[.git]}

            builtin cd "$destination"
            return
        fi
    fi
    builtin cd "$@"
}
```

So now when I `cd !$` after a `git clone`, my shell enters the copy of the repository I just cloned!  Both of these rely on using [remote shortcuts](https://hoelz.ro/blog/adding-remote-shortcuts-to-git), but since I use those almost exclusively, this works for me!
Creating a CI/CD pipeline for a .NET library: Part 1 - Intro
Tags: dotnet, library, ci
Published: 2018-07-31 17:30:18

---
title: Creating a CI/CD pipeline for a .NET library: Part 1 - Intro
published: true
description: Setting up a complete CI/CD pipeline for a .NET library, from building and testing in different platforms, visualizing code coverage and publishing the binaries to NuGet.
tags: #dotnet #library #ci
cover_image: https://thepracticaldev.s3.amazonaws.com/i/uk16cuvpdo1bg2ll8xuz.jpg
---

In this series of posts I want to talk about creating a CI/CD (continuous integration/continuous delivery) pipeline for a .NET library that’s distributed as a NuGet package. As reference, I’ll use the [GrpcExtensions](https://github.com/CodingMilitia/GrpcExtensions) library that I talked about in a previous [post](https://dev.to/joaofbantunes/dotnetifying-grpc-sane-edition-3d4k).

Given we’re in this new world of cross platform .NET, I want to build and test stuff in more than just Windows, so I’m using [AppVeyor](https://www.appveyor.com/) and [Travis CI](https://travis-ci.org/), where the former handles building on Windows and the latter handles the Linux and MacOS work.

Considering the use of more than one provider for the CI/CD pipeline, [Cake](https://cakebuild.net/) is useful to define the required tasks in a provider and system agnostic manner. It’s also cool that we can define the build tasks using C#, which is rather easy to understand given the rest of the project is already C#.

Finally, to have visibility on the tests code coverage I’m using [Coveralls](https://coveralls.io/) to host this information.

It would be also good to add some static code analysis to the mix, like [SonarQube](https://www.sonarqube.org/), but haven’t done it yet, maybe a good topic for another post.

**Disclaimer**:
I’m assuming the reader understands what I’m talking about from the very small intros I provide, but if I’m assuming wrongly (which is very possible) feel free to ask and I’ll answer and eventually improve the posts to take into account.

Going with a series of posts instead of a giant one to be (hopefully) easier to read. 
The following is the list of posts for easy navigation.

- Part 1 - Intro (this post)
- [Part 2 - Defining the build with Cake and publishing to NuGet](https://dev.to/joaofbantunes/creating-a-cicd-pipeline-for-a-net-library-part-2---defining-the-build-with-cake-and-publishing-to-nuget-4ph3)
- [Part 3 - Building on AppVeyor and Travis CI](https://dev.to/joaofbantunes/creating-a-cicd-pipeline-for-a-net-library-part-3---building-on-appveyor-and-travis-ci-4ai2)
- [Part 4 - Code coverage on Coveralls, badges and wrap up](https://dev.to/joaofbantunes/creating-a-cicd-pipeline-for-a-net-library-part-4---code-coverage-on-coveralls-badges-and-wrap-up-2bmp)

The accompanying code for these posts is [here](https://github.com/CodingMilitia/GrpcExtensions/tree/july-blog-post) (tagged to be sure the code reflects what's written here in the future).

PS: originally posted [here](https://blog.codingmilitia.com/2018/07/30/creating-ci-cd-pipeline-dotnet-library-part-01-intro).
How To Quickly Generate Google Fonts Preview
Tags: css, javascript, webdev, fonts
Published: 2018-07-31 17:20:06

---
title: How To Quickly Generate Google Fonts Preview
published: true
description: Generate a preview of Google Fonts on a single web page using a bit of JavaScript
tags: css, javascript, webdev, fonts
---

![](https://cdn-images-1.medium.com/max/1000/1*u__uoRfWE2nBbWyy9KEbHQ.png)

So many fonts are out there. How to preview and pick what we want? Here is how to generate a preview of the Google Fonts on a single web page using a bit of JavaScript:

[Read my article on Medium](https://medium.com/@jmatix/quickly-generate-google-fonts-preview-954dc9974a62)
Hubot - SSH Server Status
Tags: help, hubot, server, ssh
Published: 2018-07-31 17:18:00

---
title: Hubot - SSH Server Status
published: true
tags: help #hubot #server #ssh
---

Hi. I am writing a coffee script to check the server status. It was written in coffee script for hubot. I am getting some error while getting the arguments from the child_process function. I am pasting the code below for the understanding. 

Code:

child_process = require 'child_process'
module.exports = (robot) ->
  robot.respond /check status/i, (res) ->




    child_process.exec("sshpass -p 'password' ssh username@hostname 'sudo service httpd status'", (err, stdout, stderr) ->
      if err
        console.log(err)
      else
        console.log(stdout)
    )

Code explanation:

This(child_process) is a nodejs module and i am trying to perform the following task:

using ssh shell command i am logging into the server (ssh username@hostname) and then writing the shell command for checking the status of the server (sudo service httpd status).

Error: Response not ok: no_text

I think there is some problem with the child_process.exec() syntax.

I am using centos in virtual machine. I have saved the ssh public key in the .ssh/authorize_keys

Thanks.
What are your Interview tips and tricks? Besides having knowledge
Tags: discuss
Published: 2018-07-31 15:56:10

---
title: What are your Interview tips and tricks? Besides having knowledge
published: true
description: 
tags: #discuss
---

I'm curious on how you all manage is an interview. Tell me what's up ... for academical purposes

![](https://i.embed.ly/1/image?url=https%3A%2F%2Fthumbs.gfycat.com%2FCarefreeVariableChrysalis-size_restricted.gif&key=522baf40bd3911e08d854040d3dc5c07)
Learning Algorithms with JS, Python and Java 2: Palindrome
Tags: beginners, algorithms, learning, javascript
Published: 2018-07-31 15:46:00

---
title: Learning Algorithms with JS, Python and Java 2: Palindrome
published: true
description: 
tags: beginners, algorithms, learning, javascript
---

Here's my second attempt at solving the same problem using three different languages: JavaScript, Python and Java.

[Today's question](https://github.com/StephenGrider/AlgoCasts/tree/master/completed_exercises/palindrome) is to judge whether the given string is a palindrome.

##1 The Most Straightforward Solution
JavaScript:
```
function isPalindrome(str) {
    const reversed = str.split('').reverse().join('');
    return str === reversed;
}
```

Python:
```
def is_palindrome(str):
    return str[::-1] == str
```

Java:
```
static boolean isPalindrome(String str) {
	String reversed = new StringBuilder(str).reverse().toString();
	return reversed.equals(str);
}
```
Note that `return reversed == str;` doesn't work because `reversed` and `str` point to different objects.

#2. Elegant (But Redundant)
JavaScript:
```
function isPalindrome(str) {
    return str.split('').every((char, i) => {
        return char === str[str.length - i - 1];
    });
}
```

Its Python equivalent, without redundancy, would be perhaps:
```
def is_palindrome(str):
    return all([str[i] == str[-i-1] for i in range(len(str)//2)])
```

And Java:
```
static boolean isPalindrome(String str) {
	int n = str.length();
    return IntStream.range(0, n/2)
            .allMatch(i -> str.charAt(i) == str.charAt(n - i - 1));
}
```

#3. An Alternative With a For Loop
JavaScript:
```
function isPalindrome(str) {
    const n = str.length;
    for (let i = 0; i < Math.floor(n/2); i++) {
        if (str[i] != str[n - i - 1]) {
            return false;
        }
    }
    return true;
}
```

Python:
```
def is_palindrome(str):
   for i in range(len(str)//2):
         if str[i] != str[-i-1]:
                 return False
   return True
```

Java:
```
static boolean isPalindrome(String str) {
	int n = str.length();
	for (int i = 0; i < n / 2; i++)
		if (str.charAt(i) != str.charAt(n - i - 1)) {
			return false;
		}
	return true;
}
```

Notes:
5 / 2 is 2.5 in JavaScript and Python 3.
5 / 2 is 2 in Java.
5 // 2 is 2 in Python 3.


References:
https://stackoverflow.com/questions/11758791/python-3-2-palindrome
https://stackoverflow.com/questions/4138827/check-string-for-palindrome
My MacOS menubar
Tags: macos, menubar, showdev
Published: 2018-07-31 13:22:14

---
title: My MacOS menubar
published: true
description: 
tags: macos, menubar, showdev
---
Let us share some of our menubars on our MacOS?

![menubar](https://thepracticaldev.s3.amazonaws.com/i/o0no39v6w2b50kjv3ez4.png)

Better touch Tool for window positions and some gestures
Dropbox
1Password
Docker
JetbrainsToolbox for PHPStorm
Some istat menu network / cpu and mem info
Backblaze
Viscosity VPN
CloudApp
Rocket (emoji)
KeepingYouAwake (dont sleep display)
a lot of boring MacOS defualt icons