teleren/devto huggingface dataset:
On creating my first CLI Gem
Tags: codenewbie, ruby
Published: 2018-10-03 23:26:48

---
title: On creating my first CLI Gem
published: true
tags: code-newbie,ruby
canonical_url: 
---

You code the way you do anything else in life. So for me, that means spending roughly three times as long agonizing over the thing than actually doing the thing. However, I’m not too sad, as learning to code has brought that factor down (you should have seen me in grad school…)

Often, I spend so long in the planning phase trying to decide which idea is “best”, that I lose sight of the objective. My Flatiron classmates have been enormously helpful in this process, reminding me that for this, my first project as a web software developer, I’m not expected to re-create Google (or even Altavista). And that as a beginner, I won’t be able to make anything useful until I can make something usable. Sometimes it’s easy for me to get discouraged when something I make isn’t immediate useful or novel, and this gets in the way of even starting.

But, one evening I made the initial commit, and had a functioning CLI gem the next evening. It was a puny little thing, and I still had a “To Do” list and “should maybe do” and “would be nice” lists. But I was surprised, all the same. Avi’s walk-through videos proved very useful, and even through I had watched them through at least once before, following along with my content helped me learn even more still.

### Into the weeds…

For example, all this time I thought I had to stay with Ruby 2.3.1 for the labs because most gems didn’t work with later versions. But, in going “off-road”, I ran into a similar problem with Nokogiri, despite uninstalling and reinstalling, . Several dives into Stackoverflow and Github forums later, I found this gem (pardon the pun, I’ll see myself out): gem install –user-install nokogiri. Gems were being installed in a place ruby wasn’t expecting (or rather, rvm wasn’t expecting)

### The product (approximately)

My gem, called [Pharmacy-Finder](https://github.com/ddhogan/pharmacy_finder), accepts a user’s zipcode and tells you the single closest location from each of two different popular drugstore chains in the US. Obviously, this forces the user to willfully suspend disbelief for a few minutes and forget that the rest of the internet doesn’t exist and search engines aren’t a thing. But I can already see how these smaller gears can fit into a larger machine with access to databases, a more intuitive UI, and more complex object models.

_Originally published at_ [_donnacodes.com_](http://donnacodes.com/2017/08/31/on_creating_my_first_cli_gem/) _on August 31, 2017._
3 Steps to DRY
Tags: programming, devtips, productivity, webdev
Published: 2017-08-30 23:57:03

---
title: 3 Steps to DRY
published: true
description: How to avoid code repetition without over-engineering
tags: programming,devtips,productivity,webdev
cover_image: https://ichef-1.bbci.co.uk/news/624/cpsprodpb/D635/production/_87373845_stormtroopers_getty976b.jpg
---

Don’t Repeat Yourself: it’s a crucial refrain to remember. Avoiding repetition in your codebase saves development time and improves maintainability, but getting there isn’t always easy. Repetition can come in many forms, from a copy/pasted low level function to multiple similar UI components with separate implementations. I’ll focus on the latter as I present three steps that help me DRY.

##1. There Is No Pattern

Before obsessing about DRY, don’t forget its counterpart, YAGNI: Ya Ain’t Gonna Need It. The quest for DRY can lead to over-engineering: added complexity to handle a pattern that never emerges. While smart engineering is always flexible, be wary of adding large costs to enable reuse if you think that reuse may never happen.

##2. Establish a Pattern

If there is a pattern in the system, let it emerge. How long you wait depends on your team and your system, but always actively encourage design details that move the overall design towards one that can be abstractly implemented. This also ensures a consistent experience for your users.

##3. Code the Pattern

Once a pattern has been established, code the pattern. Don’t wait too long! At this point the cost of creating a reusable component has obvious benefits, and you want to take advantage of that benefit when the next feature comes along. If you wait too long, you pay double the cost: the initial cost of repeating yourself, and the cost of refactoring it later. 

##Case Study: “Category Table”

A few years ago I started a new application and I needed a table-like component with rows representing categories that expanded to reveal a form. There were a few of these tables, but all different. I wrote CSS that could be reused between the tables, but I didn’t attempt to write a single component for these “category tables”. I knew that the design was in flux and that making it generic enough would introduce a lot of complexity.

Eventually it became clear that we would use this category table in many places. So when new features were designed using a variant of the table, I ensured that the new iterations were consistent with requirements of the old tables, laying the foundation for a reusable implementation.

As soon as we could see that the different tables in our app were really instances of the same thing, my colleague created a Javascript component that was flexible enough to work for all of them. Then I refactored all the existing tables to use the new component. New category tables continued to appear, but we were able to continue using the reusable component, saving many days of development time.
We're Stephanie Hurlburt and Rich Geldreich, ask us anything!
Tags: ama
Published: 2017-08-30 17:28:27

---
title: We're Stephanie Hurlburt and Rich Geldreich, ask us anything!
published: true
description: We own a company called Binomial and we make a texture compression product called Basis.
tags: ama
cover_image: https://thepracticaldev.s3.amazonaws.com/i/js5lgmbq7llzmnyxd1jz.jpg

---

We're [Stephanie Hurlburt](http://stephaniehurlburt.com/) and [Rich Geldreich](https://sites.google.com/site/richgel99/), ask us anything!


We own a company called [Binomial](http://www.binomial.info/) and we make a texture compression product called Basis. Textures take up most of a game's data, so if you reduce the size of your textures, you're going to improve performance in your game as well as reduce download sizes/times. The product has gained great interest across the industry and we actively collaborate with the Khronos Group to make sure our file format is also an industry standard.

Before working on Basis, we did consulting under Binomial and we both worked in the game industry before that. Through Binomial we helped optimize VR demos, most notably under Intel's Project Alloy headset. Before that, Rich worked at Microsoft and Valve on game titles like Age of Empires 3, Portal 2, DotA 2, and Halo Wars. Stephanie worked on VR demos at Oculus and on graphics optimization at Unity.
Rails Girls Novo Hamburgo -RS
Tags: codelikeagirl, womenwhocode, railsgirls
Published: 2019-10-08 23:45:23

---
title: Rails Girls Novo Hamburgo -RS
published: true
date: 2017-08-30 15:01:41 UTC
tags: codelikeagirl,women-who-code,rails-girls
canonical_url: https://medium.com/@debborafernandess/rails-girls-novo-hamburgo-rs-59ae70b2b0c
---

Em março de 2017, tive o prazer de participar do #RailsGirlsNH2017 na Feevale de Novo Hamburgo: foi uma experiência incrível!

O clima da galera foi sensacional o tempo todo, as gurias do Rio Grande do Sul, tanto as participantes quanto as organizadoras, são muito unidas e engajadas!

![](https://cdn-images-1.medium.com/max/640/1*4qpAUODG4WHkbMyfVT7fWg.jpeg)

Dessa vez, tive a honra de palestrar pela [Locaweb](https://medium.com/u/aa05497bb32d) apresentar um pouco do básico de [Ruby e de Rails](https://docs.google.com/presentation/d/1BxiEWgTaWiG47RsY4SMujN7jUKcCdbo0quhWWft0UQU/pub?start=false&loop=true&delayms=3000&slide=id.g35f391192_04) após a palestra da **_Milena Lacerda_** que apresentou [noções de Front-end](https://speakerdeck.com/milenevlacerda/a-sopa-de-letrinhas-do-front-end-bora-entender).

Nesta edição do Rails Girls em Novo Hamburgo, seguimos a versão de app rails do site do [Maujor](http://www.maujor.com/railsgirlsguide/), que deriva da versão original do [RailsGirls](http://guides.railsgirls.com/app), pulando a parte de configuração, pois usamos o [CodeAnywhere](https://codeanywhere.com/) para diminuir a curva de aprendizado. #FicaDica

**O que aprendi no RailsGirls e porque já quero voltar**

O formato do #RailsGirls é desafiador: em um curto espaço de tempo as participantes recebem informação sobre o ecossistema de desenvolvimento (Git, Agile, Ruby, Rails, REST, etc ) e colocam imediatamente em prática.

Sempre acontece em dois dias: um dia para apresentação do ambiente de TI, do quão importante é ampliar a diversidade neste ambiente e como ingressantes e veteranos podem e precisam se empenhar para isso e outro dia para colocar de fato a mão na massa.

No momento final, as gurias fazem apresentações de seus projetos, do código e das ideias; e foi muito gratificante ver o brilho de “Eureka” nos olhos das garotas, a alegria em produzir algo real em tão pouco tempo.

> A troca de experiências também foi sensacional, alguns coaches partilharam sobre como é seu dia-a-dia ou como foi seu começo e como é importante continuar a insistir para ser uma boa programadora.

Gostaria de ter participado de um projeto assim lá atrás quando comecei a programar, mas agora, poder colaborar um pouco que seja com iniciantes foi um dos melhores momentos como programadorA.

Espero que as participantes continuem a estudar e se qualificar como desenvolvedoras, estarei sempre disponível a ajudá-las sempre que a necessidade surgir.

A toda galera da organização, aos patrocinadores e à #Locaweb que me incentivou a partilhar no evento um pouco de como foi e é a minha carreira como mulher na área de desenvolvimento, o meu **_Muito Obrigada_**!
Blameless Post Mortem Meeting Template
Tags: agilejustculturelean
Published: 2017-08-30 02:18:31

---
title: Blameless Post Mortem Meeting Template
published: true
description: A simple meeting template for a Blameless Post Mortem
cover_image: https://thepracticaldev.s3.amazonaws.com/i/q7adt3ou9dmlkp8w9nl4.jpg
tags: agile just culture lean
---

Production incidents may be the **worst** kind of lean IT waste.

Let's stop having them!

Paste this as the content of meeting invites to keep everyone informed on what a Blameless Post Mortem is and why we should *always* conduct them.

# Blameless Post Mortem Template

**Agenda**:
- Dissect the events as we understand (timeline)
- Discuss actionable steps that can be taken to assert this error (as we understand it) does not happen again

**Outcomes**:
- List of actionable ideas (stories/epics)
- *NOT*: “pay attention! or “be more careful!”
- Follow-up meeting to observe progress on  

----

# Blameless Post Mortem Notes:

If you have to do something manually more than once, automate it so you never have to do it again.

## Prime Directive
> Regardless of what we discover, we understand and truly believe that everyone did the best job they could, given what they knew at the time, their skills and abilities, the resources available, and the situation at hand.

## [“blameless Post-Mortem](https://codeascraft.com/2012/05/22/blameless-postmortems/)

> Lack of understanding of how the accident occurred all but guarantees that it will repeat. If not with the original engineer, another one in the future.

#### Having a “blameless Post-Mortem process means that engineers whose actions have contributed to an accident can give a detailed account of:
- what actions they took at what time,
- what effects they observed,
- expectations they had,
- assumptions they had made,
- and their understanding of timeline of events as they occurred.
- and that they can give this detailed accountÂ without fear of punishment or retribution.

#### Avoid cycle of name/blame/shame:
1. Engineer takes action and contributes to a failure or incident.
2. Engineer is punished, shamed, blamed, or retrained.
3. Reduced trust between engineers on the ground (the “sharp end”) and management (the “blunt end”) looking for someone to scapegoat
4. Engineers become silent on details about actions/situations/observations, resulting in “Cover-Your-Ass engineering (from fear of punishment)
5. Management becomes less aware and informed on how work is being performed day to day, and engineers become less educated on lurking or latent conditions for failure due to silence mentioned in #4, above
6. Errors more likely, latent conditions can’t be identified due to #5, above
7. Repeat from step 1
Send a fax from the command line with Python and Phaxio
Tags: python
Published: 2019-07-06 00:15:12

---
title: Send a fax from the command line with Python and Phaxio
published: true
tags: python
canonical_url: https://sean.lane.sh/posts/2017/08/Send-a-fax-from-the-command-line-with-Python-and-Phaxio/
---

_Note in 2019: I've created a small side project website that let's you quickly send off a fax with no hassle in case you don't want to mess with a Python script: [FaxASAP.com](https://faxasap.com)_

If you want to send a simple fax quickly, cheaply, and painlessly, Phaxio and Python make a nice combo. Below is a litte script that I wrote, based on this [Ruby script by Pete Keen](https://www.petekeen.net/command-line-faxing) that is slightly out of date. There are Phaxios Python libraries, but I ran into a couple issues, and this seems to be the most brain-dead simple solution. Pros: No external dependencies. Cons: It uses the `shell=True` parameter for `subprocess.call`, but that shouldn’t be an issue since you’re only using this to send a quick fax at 2 AM and you don’t want to pay UPS/FedEx/whomever too much money for that privilege tomorrow, right?

Note that I’m not affiliated with Phaxio in any way, it just happens to be late, I needed to send a fax, and they checked all the right boxes. I stumbled on Phaxio, but for someone just wanting to send a quick fax once every year or so, it’s great. Pricing is about $0.07 a page (and I received $1.00 account credit just for signing up at the time of writing this), so it’s perfect for my use case.

## Setup

1. Sign up for an account with [Phaxio: https://www.phaxio.com/](https://www.phaxio.com/)
2. Get your API Keys: [Phaxio API Credentials](https://console.phaxio.com/api_credentials)
3. Put them into the script below (You can also use the Test keys to make sure this works before trying too.)
4. Run the script, for example, if I saved the script to `fax.py`, I’m sending to Tommy Tutone, and my file to send is `letter.pdf`, I would use the following: `./fax.py +15558675309 /path/to/letter.pdf`

```python
#!/usr/bin/env python3
from subprocess import call
import sys

if len(sys.argv) <= 2:
	print("Usage: send_fax NUMBER FILENAME...")
	exit(-1)

number = sys.argv[1]   
api_key = 'put_api_key_here'
api_secret = 'put_api_secret_here'

command_args = [
  "curl",
  "https://api.phaxio.com/v2/faxes",
  "-u '{}:{}'".format(api_key, api_secret),
  "-F 'to={}'".format(number)
]

for file in sys.argv[2:]:
	command_args.append("-F 'file=@{}'".format(file))

call(' '.join(command_args), shell=True)
```

The script can be found in this GitHub Gist here: [https://gist.github.com/seanlane/67504bf39696de8c0bc88ad89844f9df](https://gist.github.com/seanlane/67504bf39696de8c0bc88ad89844f9df)

Feel free to fork it and suggest improvements.
Why It's Easy to Ignore the Lack of Diversity in Tech w/ Rebekah Michael
Tags: techtalks
Published: 2017-08-29 18:33:48

---


title: "Why It's Easy to Ignore the Lack of Diversity in Tech w/ Rebekah Michael"
published: true
description: "Why an engineer with 14 years experience finally took notice, got angry, & what she did about it."
cover_image: https://thepracticaldev.s3.amazonaws.com/i/f3m63iutl2xvlf1n9eqy.png
tags: #techtalks
---


_Found this great talk and wanted to share it with the DEV community._

{% youtube OOQfQwxCOF0 %}

### Main Argument

When individuals feel different, they feel forced to "fake it"/appear to be someone else in order to work in technology environments. [Rebekah](https://twitter.com/bekahmichael?lang=en) feels that it's crucial to an industry founded on problem solving, that we seek out those that have experience with different problems than our own and who can bring to light solutions that would otherwise not be considered. But, for that to be possible they need safe spaces where they can stop “faking it”.

### Let’s Discuss

How can we build work communities where no one is "faking it"? Where it's safe to talk about your challenges, to fail, and to have a different background/perspective from the others at your company?
The life, death, and resurrection of my dear friend Charlie proxy
Tags: shortfiction, opensource, fanfiction
Published: 2018-03-16 19:58:14

---
title: "The life, death, and resurrection of my dear friend Charlie proxy"
published: true
tags: short-fiction,open-source,fanfiction
canonical_url: https://medium.com/@episod/the-life-death-and-resurrection-of-my-dear-friend-charlie-proxy-95e351bc2430
---

When [Charles](https://www.charlesproxy.com) expires, he no longer breathes in your traffic orchestrations. His little thready lungs simply stop working, the ports all closed. Charles’ eyes shut, and he stops remembering and recording.

Insert a coin to continue what was a pretty good life for Charles. Helping&nbsp;you.

Maybe Charles remembers more than he lets on. Maybe Charles is still alive enough to pass a few packets around to NORAD. Charles is waiting for your&nbsp;payment.

I have a Charles Proxy license I purchased in 2010. That makes Charles and I pals. I actually call him Charlie. I don’t think the 4.0-series Charles likes nicknames.

Of course, Charles was way cooler back then before everyone else heard of him. He used to play LARPAnet festivals with his band, Charlie Proxy & the Unsecured Connections: _the Masquerade_. When I hear about the kids today not paying for their Chuckles, I just get&nbsp;mad.

**What about&nbsp;James?**

[James](https://github.com/james-proxy/james) is a far left deadbeat free as in who cares black sheep of a brother to Charles. They never really got along, though when James was young Charles showed little Jimmy everything he knew about port forwarding. Charles trusted Jimmy then but then he got hard into secured tunnel packet sniffing, stealing shared secrets just to keep the habit. Based on my friend Charlie’s advice alone, Debian refuses to package James to this&nbsp;day.

**You finally buy a&nbsp;license**

Charles restarts but is not what he once was. His lurking all murky. His wild patterns match too greedily, lazily even. He refuses to check or sum, drops shady characters as the bits rolls by, confusing ones for zeroes and zeroes for elevens and elevens for line&nbsp;noise.

If only you’d paid for Charles&nbsp;sooner.

![](https://cdn-images-1.medium.com/max/200/1*lpMFBkMekZBxc_z8FBTdYQ.png)<figcaption>Mr. Nosey by Charles Roger Hargreaves</figcaption>
What should I do when I get hit on by colleagues?
Tags: anonymous, advice, womenintech
Published: 2017-08-29 16:58:29

---
title: What should I do when I get hit on by colleagues? 
published: true
description: Considering I'm just starting out and I don't want to burn any bridges, but I also don't want to build the WRONG kinds of bridges, what should I do?
tags: anonymous, advice, womenintech
---

_This is an anonymous question sent in by a member who does not want their name disclosed. Please be thoughtful with your responses, as these are usually tough questions to ask and answer._

>I'm just starting out in the software industry and I've experienced my first couple of instances of being hit on by people I solely consider an industry colleague or contact. 

>It's a pretty disheartening feeling that I'm sure many of you are familiar with. 

>Considering I'm just starting out and I don't want to burn any bridges, but I also don't want to build the _wrong_ kinds of bridges, what should I do?
Turn any callback into promise with babel-plugin-promise
Tags: javascript, promises, babel, plugin
Published: 2017-08-29 12:50:03

---
title: Turn any callback into promise with babel-plugin-promise
published: true
description: Convert an existing callback API to promise
tags: javascript, promises,babel,plugin
---


briefly,I will tell you how to convert an existing  callback to promise.

We will need to use babel.

For example, let's take a [request](https://www.npmjs.com/package/request) from npm and convert it to a promise

```code
yarn add babel-plugin-promise --dev
```

```javascript
require("babel-polyfill");

import request from "request";

//@promisify<err,res> req
__ = request(arg1);

console.log(req("http://www.google.com"));

req("http://www.google.com")
    .then(res => console.log(res.body.length))
    .catch(err => console.log(err));

```

let's check

![](https://res.cloudinary.com/dmtrk3yns/image/upload/q_auto:best/v1504010920/ice_screenshot_20170829-164745_z1ixn5.png)

quite quickly

[babel-plugin-promise](https://git.io/v5nOl)
Why does `2.toString()` break but `2..toString()` works?
Tags: javascript
Published: 2020-08-31 14:26:44

---
title: Why does `2.toString()` break but `2..toString()` works?
published: true
date: 2017-08-29 00:00:00 UTC
tags: javascript
canonical_url: http://blog.gnclmorais.com/dot-dot-tostring
---

```
> 2.toString()
Uncaught SyntaxError: Invalid or unexpected token
> 2..toString()
"2"
```

The reason `2.toString()` doesn’t work in JavaScript but `2..toString()` works is something I always found puzzling but never got to the bottom of it… until now, when I found myself with some free time and this question back in my mind.

The explanation for this quirky behaviour seems to be connected with the JavaScript parser, which acts in a **greedy** way, i.e., it tries to match the longest valid operator each time. In this case, as it parses and evaluates character by character, when it reads the number `2` it expects to be parsing a number, so `2` is valid. The next character, `.`, is also valid in a number (_decimal_ number, but still, valid). Now the following character, `t`, is not valid in a number, so an error is thrown:  
`Uncaught SyntaxError: Invalid or unexpected token`.

In the second case, `2..toString()`, it processes everything the same way but, when it runs into the second dot, it knows it cannot be a number since it found one dot before, the decimal separator. So the number it has so far (`2.`) gets converted to a `Number` (`2.0` which is `2`) and them `toString` is called on it, finally returning `"2"`. A simple way to allow a `toString()` invocation on a number would be to wrap that number with parentheses, clearly encapsulating the number evaluation: `(2).toString()`.

Basilly, `2..toString()` is the same as having `2.0.toString()`:

```
> 2..toString()
"2"
> 2.0.toString()
"2"
```

### Resources

- [Double dot syntax in JavaScript](https://stackoverflow.com/a/24891388/590525)
- [Why does “a + + b” work, but “a++b” doesn’t?](https://stackoverflow.com/a/7491960/590525)
How do you find a balance
Tags: discuss
Published: 2017-08-28 19:45:38

---
title: How do you find a balance
published: true
description: 
tags: discussion
---

Recently I realized how important it is to have a healthy Work-Life balance especially when it comes to burning out. I have a few side projects that I'm currently working on along with learning new technologies and things of that nature. The change in my routine I found most effective was waking up early (around 5-5:30am) and getting to work on one of my projects before I go to work. This has helped me tremendously and made me more effective. 

For those of you who are balancing multiple things such as work, side projects, learning and so on, how do you find a balance and avoid burnout?