teleren/devto huggingface dataset:
Maintaining an open source gem in the Hacktoberfest
Tags: ruby, community, hacktoberfest, opensource
Published: 2019-10-25 02:24:07

---
title: Maintaining an open source gem in the Hacktoberfest
published: true
description: Maintaining an open source gem in the Hacktoberfest
tags: ruby, community, hacktoberfest, open source
---

Some months ago I created a little gem to quickly access to different GitHub sections from the command line. The name of my gem is [vpr](https://github.com/JuanCrg90/vpr) (view pull request). 

The idea of this gem is simple, you call the `vpr` command + some instruction + a commit SHA and you can access to a Github section of your interest. For example, `vpr visit 123abc` sends you to the commit page of the selected commit.

![vpr visit command](https://res.cloudinary.com/juancrg90/image/upload/v1562970485/vpr/vpr_visit.gif)

In this Hacktoberfests I decided to open some issues to add the support for bitbucket pages. It was incredible the speed that the users started to contribute and recommend things for the project, like @andrewmcodes who added a GitHub action to run [standardRB](https://github.com/testdouble/standardrb) in the pull requests.

{% github https://github.com/JuanCrg90/vpr/issues/12 %}


 Even if this is a simple side project, I'm happy to have had the opportunity to be a maintainer this year. I hope the next year have the opportunity to host a contribution fest in my city.

All these contributions will be released to [RubyGems](https://rubygems.org) in November, thanks to all the participants for your support. If you are interested in know more about vpr, please visit the Github repository.

{% github https://github.com/JuanCrg90/vpr %}
Searching for a React Project to work on
Published: 2019-10-25 02:18:04

Hello React folks,

I'm tring to find ways to practice react to gain experience and knowledge to boost ny carrier and reposition myself as software developer. (Have been working in other industries for a while).


If anyone has an interesting side project or any team is looking for a volunteer or a team player, please give me a holler.

Thank your for your consideration.

Best regards,
Tae Ha Lee
Web Scraping Script in Ruby
Tags: ruby, webscraping
Published: 2019-10-24 16:27:52

I was working on a project and I had to scrape a web page so I look into the options and I found [Nokogiri](https://rubygems.org/gems/nokogiri "Nokogiri Ruby Gems").
Nokogiri is an HTML, XML, SAX, and Reader parser. Among Nokogiri's many features is the ability to search documents via XPath or CSS3 selectors.
To get the document I used [HTTParty](https://rubygems.org/gems/httparty "HTTParty Ruby Gems").
HTTParty makes http fun! Also, makes consuming restful web services dead easy.
For this example, I will be scrapping [https://rubygems.org/search?query=%s](https://rubygems.org/search?query=nokogiri).

## Script
The final script is given below:
```ruby
require 'HTTParty'
require 'Nokogiri'

class RubygemsScrapper
  attr_accessor :parse_page

  # initialize repo for ruby gems requires query string
  def initialize(q)
    doc = HTTParty.get("https://rubygems.org/search?query=#{q}")
    @parse_page ||= Nokogiri::HTML(doc)
  end

  # get the first result's version or if not found returns -1
  def get_latest_version
    begin
      parse_page.css('.gems__gem').css('.gems__gem__version').children[0].text
    rescue
      -1 # Not found
    end
  end

  # get the first result's link to ruby gems org or if not found returns -1
  def get_link
    begin
      "https://rubygems.org" + parse_page.css('.gems__gem').attribute('href').value
    rescue
      -1 # not found
    end
  end

  # Calling scrapper
  scrapper = RubygemsScrapper.new('yiya')
  p scrapper.get_latest_version
  p scrapper.get_link
end
```
This class would get the name of gem to be searched and returns the first element’s latest version and link to it.
The most important alias
Tags: shell, productivity, customization
Published: 2019-10-25 01:27:25

---
title: The most important alias
published: true
description: 
tags: shell, productivity, customization
---
You may have heard of shell aliases. In short, `alias` is a shell command that defines a substitution, e.g. with `alias clip='xclip -selection clipboard'` you can type `clip` in a command and it will be replaced by the part on the right.

I believe aliases are key to a productive and enjoyable command line experience. They are cheap to create and maintain, and they save you a lot of typing.

To me, one alias matters more than any other: `alias zc='vim ~/.zshrc'`. (feel free to replace `vim` with your favorite `$EDITOR`, and `.zshrc` with your favorite `$SHELL`).

With this alias, you can improve your development workflow in a snap. Just entered the same command three times in the last five minutes? Open a terminal, enter "zc", alias it, and enjoy.

---

The actual alias I use is `vim -n $ZSHRC; source $ZSHRC`. That way my changes are applied immediately upon exiting the file.

For more, see my [dotfiles](https://github.com/mlevesquedion/dotfiles).
Markdown to Pages format conversion
Tags: commandline, applescript, markdown
Published: 2019-10-25 01:25:33

---
title: Markdown to Pages format conversion
published: true
description: Convert 
tags: command line, apple script, markdown
---

I write a lot of things in Markdown and use Pandoc for a number of things. I haven't been able to find a way to convert markdown to pages format. At times I need to send a document in either docx or pages. It's easier in pages.

Pandoc of course is essential:

```
pandoc -o document.docx document.md 
```

It'd be great if I could get .docx to .pages conversion working in the command line somehow. So I fiddled. For too long.

Apple Script is able to accomplish this - and here is the basic thing of it:

```
set old_doc to POSIX file "/Users/username/path/to/docx/file.docx" as string

set new_doc to POSIX file "/Users/username/path/to/pages/file.pages" as string

tell application "Pages"
	set thisDoc to open old_doc
	save thisDoc in file new_doc
	close thisDoc
end tell
```

*Note: if you don't tell Pages to `activate` then this process will probably remain hidden behind other open windows - it's also quite fast*

I have yet to finish this little project. I plan to script it out more using `osascript` so that I will just be able to type `mdtopages document.md` in my terminal and end up with `document.pages`.
Unpopular opinion? I don't do puzzle coding tests.
Tags: discuss
Published: 2019-10-25 01:19:32

---
title: Unpopular opinion? I don't do puzzle coding tests.
published: true
tags: discuss
---

So, today, as part of a screening process for a freelancers agency, they sent me a puzzle coding test. I respectfully declined and said that probably I'm not a good fit.
What is your position?
Overloading in Clojure
Tags: clojure, todayilearned
Published: 2019-10-25 01:10:29

## Dear Atomic God, what is this ??? 🤯
![](https://media.giphy.com/media/aUms4Tfd5e6Tm/giphy.gif)
**Overload** is the ability to define multiple properties, methods, or procedures in a class with the same name but different parameters.

**You understood ?**
Well, I'll be clearer.

*If you create two procedures in your application with the same name and different parameters, you are using overhead.*

You may be asking, *"How can I create two procedures with the same name? How will I differentiate them?"*  
*Smart boy/girl you!!!*

You will differentiate the methods / procedures by the parameter list they will have, ie the methods/procedures/functions will have different parameters.

  
As in Clojure we use the functional paradigm is more how we can increase the **arity** of our function.

## So... What is Arity? 🤔
In mathematics, an area of ​​function or operation is the number of arguments or operands taken.
 The arity of a relation is the number of elements that compose as ordered n-tuples belonging to the relation.

## After this brief introduction, hands on 😁
![](https://media.giphy.com/media/S2a3xYDeV5jdC/giphy.gif)

Let's suppose we have an *array of names* and we want to count how many elements we have in it without the famous **length** or **count** of another languages like *javascript* or *c#*.
```clojure
(defn count  
  ([elements]  
   (count 0 elements)) ;First overload
  ([total elements]  
   (if (seq elements)  
     (recur (inc total) (next elements))  
     total))) ;Second overload
     
(println (count ["dylan" "inae" "leandro" "marcos"])) ;returns 4 
(println (count [])) ;returns 0
```
Simple like this, just add your params and what you want to do into `()`  and now you can implements many **aritys** in same function

`seq`➡ Implements a sequence, in the code above I implemented this to know if my array has elements, because if not this method returns null or `nil` in clojure

`recur`➡ Implements a otimized recursivity, prevents exceptions

`inc`➡ A method to sum 1 (like `++`, `value + 1` or `(+ value 1)` in clojure

`next`➡ Returns a seq of the items after the first. Calls seq on its
argument.  If there are no more items, returns nil.

  
For today is what I have to share, until next time 🤓

![](https://media.giphy.com/media/Zw3oBUuOlDJ3W/giphy.gif)
Day 8 - Project - Finishing Intuit Sign Up Page
Tags: codenewbie, html, css
Published: 2019-10-25 00:36:07

I completed the Intuit sign up page clone.

Going into it was a bit easier this time around for a few reasons:

1- I had just completed a project where I cloned a YouTube page. I got a bit more confident since this was the first project that I completed entirely on my own. The previous projects were with the course I took and the ones I attempted on my own were loosely based on the ones from the course.

2- This time, I planned the project. I drew the layout on paper. This forced me to think about the elements interact with each other. I still had to change the layout a bit. The area that has the CAPTCHA details has a background color that spans the width of the container but the rest of the elements in that section are in a container with padding. To solve this issue, I split that section from the other container so that the <code>main</code> tags had two children elements instead of one. The first child had the padding and the second had the background color



![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/gf7c5my9zh27hyrr81lk.png)

I am happy with the project and as I practice more, I am thinking of writing better and more efficient code instead of anything that works.
Sudo save from within VIM
Tags: linux, vim
Published: 2019-10-24 23:52:35

---
title: Sudo save from within VIM
published: true
description: Forgot to sudo?  No worries.
tags: linux, vim
---

This is a critical trick for using VIM.

Here's the scenario: you've opened up a file that you don't have write permissions for.  You've taken all this time to make all these edits, then you `:wq` to get outta there and BOOM!

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/cll134x9tzfu572gn068.png)

You forgot, you needed to sudo to edit the file.

I do this __all the time__ when editing `/etc/hosts`.

__What's the solution?__

Turns out it's really simple:

`:w !sudo tee %>/dev/null`

That's it.  It'll prompt you for your password, and you'll be able to write the file and quit.  Lifesaving technique here.

If you're interested in how this works, I have a quick explanation [over at my blog](https://matix.io/using-tee-to-sudo-save-in-vim/).

---

Hope this tip was useful for you!

If you're interested in Linux, VIM, Python, Django, React Native, and many other things, follow me here on dev.to or on [Twitter @connorbode](https://twitter.com/connorbode).

I'll keep posting the stuff I find useful!
Deleting With Empathy
Tags: docker, onboarding, devops, devrel
Published: 2019-10-24 23:16:54

When creating a project — besides having a working minimum viable product (MVP) — one of my main objectives is to allow others (and my future self) the ability to easily set up a development environment.

The idealized version of that looks something like this:

```bash
git clone git@github.com:ryderdamen/the_repository.git
cd the_repository
make install
make run
```

The one-command install requires a bit of extra work on my part, but it makes getting up and running a breeze for developers down the line. I like to use makefiles to get things set up — but anything really will do.


One of the things I like to do once a month is something I call **“deleting with empathy”**. Every month or so, I completely delete my local development environment for a shared repository.

The idea behind it is that if I’ve set it up properly, this action should be inconsequential; I should only require a few extra keystrokes to be back where I was ten minutes prior.

Even if I’ve built a one-command install script, it can so often drift from the actual processes required to get a repository up and running. Deleting with empathy allows me to periodically review if it’s functional, and change anything that needs to be fixed.

What are your thoughts? Do you often find your setup documentation drifts? Do you have one-command installation scripts?
Day 19 : Glorious
Tags: hiphop, code, coding, lifelongdev
Published: 2019-10-24 22:29:05

_liner notes_:
- Professional : Pretty productive day. Made some revisions suggested by team members to the Use Case write up and submitted it again. Did some quick CSS to add padding to the application. Also updated the GitHub repository's readme to add some project details and instructions on how to get the application to run locally. Made sure that I was able to get the repository running a few times. I sent it to a couple of team members to see if they have any issues getting it running. The team also got together for our weekly catchup session. Finished my day watching some orientation training videos I haven't had a chance to watch.

- Personal : So yesterday, I came up with how I want a side project to function and be laid out. Got so excited while researching that I didn't go to be till like 2am. haha The feeling is so glorious and what I love about coding! This also clears the way and gives a reason for buying the GoPro Max camera. Been watching a lot of videos and reviews for the camera. Still doing more research before I make my decision about purchasing. For the rest of the night, I'll be working on mapping out how I want the side project to work and putting together tracks for the radio show.

![Redwood National Park Forest in Califorinia](https://thepracticaldev.s3.amazonaws.com/i/w4gmiq64ri8frl17y4r0.jpg)

Tomorrow is FRIDAY! Whew! This week flew by! Tomorrow I'm hoping to put a bow on the project I've been working on for at least till Vonage Campus happens next week. I'll probably continue refactoring the code since it's a good exercise in learning React. Want to finish up all the orientation videos. Do my laundry. Finish up the radio show prework. Work on the design for my new side project, look over old side projects and maybe buy the GoPro Max.  

Have a great day!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube BJDMSctOnQY %}
Midtype helps builders iterate on web apps quickly
Tags: graphql, react, webdev, startup
Published: 2019-10-24 22:13:29

I am Jay - a backend developer working on [Midtype](https://www.midtype.com) along with my friend Neel. 

Neel is a frontend engineer who wanted a better Firebase so he can iterate on web apps faster and independently. So we started Midtype together. Midtype is GraphQL-based Backend-as-a-Service. Here is how [Midtype compares with Firebase](https://www.midtype.com/blog/firebase-alternative/).

We have only been working on it for a few months, but just launched a free-tier plan. Hoping to get feedback from web app builders looking to iterate faster.
Understanding JavaScript Array Series XX - Array.unshift()
Tags: javascript, beginners, webdev
Published: 2019-10-24 21:58:56

Yesterday, you asked a question saying **What if I want to put back the element I have removed either from the start of the array or the end of the array?**. Can't recall asking this? Check this article to refresh your memory.

{% link https://dev.to/nedyudombat/understanding-javascript-array-series-xviii-array-pop-4o05 %}

Have you heard about the `Array.unshift()`? No?

This method adds a new element or a bunch of elements to the start of the array and returns the new length of the array. This is the opposite of `Array.shift()` as it adds to the beginning of the array, while `Array.shift()` removes from the beginning of the array.

**Can you show me the syntax?** Yeah sure.
```javascript
const elem = arr.unshift(item1, item2, item3, ..., itemN);
```
**[item1, item2, item3, ..., itemN]:** These are the elements to be added to the array.

**[arr]:** This is the array you want to add the new elements to.

**[elem]:** This value holds the new length of the array after the successful addition of elements to the start of the array.


**Cool, it is kind of similar to array.push(), except here it adds the element from the beginning of the array. Please, can you show us an example?** Sure why not.

```javascript
const arr = [2, 3, 4, 5];
arr.unshift(1);
console.log(arr) // [1, 2, 3, 4, 5];
```

**What happens if an array is passed as the argument to `unshift()`**

```javascript
const arr = [2, 3, 4, 5];
arr.unshift([0, 1]);
console.log(arr); // [[0, 1], 2, 3, 4, 5];
```
In this case the entire array that is passed as an argument is passed as one argument to the array.

## **Conclusion:**
* **`Array.push()`:** Add items to the end of an array.
* **`Array.pop()`:** Remove items from the end of an array.
* **`Array.unshift()`:** Add items to the start of an array.
* **`Array.shift()`:** Remove items from the start of an array.


That's all for today, see you next time.

Here is the link to the other articles on this Array series written by me:
* [What is an Array?](https://dev.to/nedyudombat/understanding-javascript-array-series-i-what-is-an-array-l1i)
* [Alternate ways of Creating an Array.](https://dev.to/nedyudombat/understanding-javascript-array-series-ii-alternate-ways-of-creating-an-array-26c8)
* [Array Properties](https://dev.to/nedyudombat/understanding-javascript-array-series-iii-array-properties-43co)
* [Array Loops & Iteration Part I] (https://dev.to/nedyudombat/understanding-javascript-array-series-iv-array-loops-iteration-part-i-334j)
* [Array Loops & Iteration Part VII `(find())`] (https://dev.to/nedyudombat/understanding-javascript-array-series-x-array-loops-iteration-part-vii-18dc)
* [Array Loops & Iteration Part VIII `(findIndex())`] (https://dev.to/nedyudombat/understanding-javascript-array-series-xi-array-loops-iteration-part-viii-17gp)

Got any question, addition or correction? Please leave a comment.

Thank you for reading. :thumbsup:
CSS is my New Friend
Tags: css, html, website, beginners
Published: 2019-10-24 21:46:34

 So, I knew from the beginning that CSS and I were gonna click. Since the start of my journey into the world of coding, I have heard CSS numerous times and every time its about how fun and creative it is and all the amazing things you can do with it. It always caught my attention, not because its “fun”, well maybe partly, but because what motivates me and excites me about learning all this code stuff is being able to CREATE things like websites and apps. The front end stuff they say. I say, The Designer. 
	So I started to put together my website this past week. To do that, I had to learn HTML first. So HTML I am liking as well. I was picking up on everything pretty quickly and feeling like I was getting the hang of things. What that includes is that I was putting code in my HTML index when it technically should have been in my CSS.  When I was first corrected, I was a little bothered and wished it could all just be in the same thing, I mean, I was on a roll and it appearing how I wanted it to appear. So having to switch it up and move majority of my codes into a separate CSS sucked, but only at the time. I get it now. 
	There are so many more options and cool things you can do within CSS while HTML is quite limiting I began to realize. CSS stands for Cascading Style Sheets. Its purpose is to style markup languages (like HTML or XML). Therefore, CSS is worthless on its own, unless associated with an HTML document. CSS brings an HTML document to life, by choosing fonts, applying colors, defining margins, positioning elements, animating interactions, and much more. For an example on how to use CSS is like this. It works is by selecting an HTML element (like a paragraph), choosing a property to alter (like the color), and applying a certain value (like red). That is just something simple. I am still on the “simple” stage of CSS but I am learning so much more everyday. It really is gonna be what makes all of this fun, to me anyways. I highly recommend to all you new devs out there to check it out and really play with it. I am finding that just switching codes around and swapping words for words or colors for colors just to get the hang of things is really helping me figure things out. I cant wait to see all I can do with this wonderful thing that is my new favorite friend.
For fun, how infinite can we go?!
Tags: webdev, fun, discuss
Published: 2019-10-24 21:30:54

---
title: For fun, how infinite can we go?!
published: true
description: a fun little thing
cover_image: https://thepracticaldev.s3.amazonaws.com/i/rxc68rk1zmnx435lkhbi.png
tags: webdev, fun, discuss

---

Just for fun, take a screen shot of the last screenshot, how infinite can we go?! 

![screen shot of screen shot](https://thepracticaldev.s3.amazonaws.com/i/rxc68rk1zmnx435lkhbi.png)


---

Varymade LLC.

Current projects are https://charactergenerator4000.com and https://coex.dev. Please check them out and let us know your thoughts.
What is SiteGround?
Tags: siteground, hosting, webhosting, wordpress
Published: 2019-10-24 21:05:10

A popular and highly-regarded web hosting service for WordPress, SiteGround offers excellent WP speeds and security solutions. These capabilities ensure that you get the Website speed and security that you need. It has a myriad of features that you will find very beneficial, which include automatic updates, CDN, GIT version control, one-click installation and WP caching. These functionalities are intended to keep your site running all the time.

What’s great about SiteGround is its provision of location-specific web hosting services. This is made possible through the service’s data centers in the United States, Asia and Europe. Uptimes of 99.9% are guaranteed with the platform’s fast servers. The vendor also does not take security lightly, having security measures in place such as antispam apps, hotlink protection and anti-hacking monitoring capabilities. You can also be sure that your passwords are safe with the service’s Leech Protect feature. Password checking and password strength enforcement can also be done using its password checker.

In addition, SiteGround provides freebies that include daily backups, free setup, free domains, unlimited bandwidth and emails, free setup and migration and free CloudFlare CDN. A built-in control panel enables users to create multiple email addresses. It can likewise access open source apps such as PrestaShop, CS-Cart and Magento, among others. These features are ideal for users who want to set up online stores, shopping cart or other eCommerce components.

The service comes in a variety of pricing schemes, which start at $3.95 per month. You can also avail of a free trial but the vendor offers a 30-day money back guarantee.

For more information, check out this [SiteGround web hosting review](https://www.onlinetoolsexpert.com/siteground-web-hosting-review/).