teleren/devto huggingface dataset:
The Platypus
Tags: devops, architecture
Published: 2019-05-10 22:45:04

---
title: The Platypus
published: true
description: Evolutionary systems tend to be easier to work with - but sometimes you get something that just plain doesn't make sense.
tags: Devops, architecture
---

I'm usually an "evolution over revolution" sort when it comes to systems.  I don't like make big sweeping changes - they tend to break things, they tend to have a really big "blast radius", and so on.

But evolutionary systems tend to have the same problems that natural evolution has.

Sometimes, evolution creates a platypus. ![platypus](https://upload.wikimedia.org/wikipedia/commons/f/f2/Platypus_BrokenRiver_QLD_Australia.jpg)


Look at it.  Just-- Just *look at it*.  Its existence is a mystery - it has a bill; it lays eggs; it swims around; it has poisonous claws.  And it's a mammal.  None of those things make any sort of sense.  But somehow, somewhere, those things made it when tons of other species didn't.  At some point, the environment was such a way that a platypus was better suited to survival than other species, or at least not so bad that it killed them off.

When you work on an evolving system, you will eventually find a system that you just stare at blankly, nod your head, and wander off, because its very existence makes no sense. ![Jackie Chan WTF: "Why does this thing even exist?  What possible collection of forces could have possibly led to this?"](https://i.imgflip.com/30o0ag.jpg)

This is a platypus system.  No matter how much we try to understand why it exists, we never really will.  It probably does things that no other system of its kind does, and we're not sure why; maybe it's a mail system that also plays chess, and no one quite understands why.

So what should we do with these types of systems?  Look, your guess is as good as mine.  I'm fine trying to make them extinct.  Mammals shouldn't have bills, and an HTTP server should't have a roguelike in the logs.
Can I Get Some Feedback? (Moment.js in particular)
Tags: help, discuss, moment, javascript
Published: 2019-05-10 21:53:30

I'm setting up this thing for work where we would display on our website if a customers order is going to be shipped out today or on the next available business day. Our cut off is 12 Noon Mountain Time, and we only ship out M-F. 

Here's the relevant code: 

```js
var now = moment().tz("America/Denver");
var availableDays = [1, 2, 3, 4, 5];
var todaysCutoff = now.clone().hour(12);
var expectedProcessing = "";

// If today is after 12 Noon, Expected Processing goes to tomorrow.
if (now > todaysCutoff) {
	expectedProcessing = now.clone().add(1, 'day');
} else {
	expectedProcessing = now.clone();
};

// If Expected Processing is not during the week, set to Monday of next week
if (!availableDays.includes(expectedProcessing.day())) {
	expectedProcessing =  expectedProcessing.add(1, 'week').day(1);
};


$("#processing").html("Expected Ship Date: " + 
	expectedProcessing.format("MMMM Do YYYY hh:mm")
);

```

Basically, if it's after Noon, set the Ship Date to the next day. If the Ship Date is a weekend, push it out to the next Monday. 

As far as I can tell it works, was just curious about the feedback from someone more knowledgable than me on Moment.js/moment-timezone. 

Thanks!
GitHub announces GitHub Package Registry
Tags: news, npm, github, javascript
Published: 2019-05-10 20:58:00

---
title: GitHub announces GitHub Package Registry 
published: true
description: Discussing the announcement of of GitHub Package Registry
tags: news, npm, github, javascript
---

GitHub just announced **GitHub Package Registry**.  They set up an info page you can check out: **https://github.com/features/package-registry**

Follow Tierney Cyren (@bnb) on [Twitter](https://twitter.com/bitandbang) to follow along live.

{% twitter 1126949464407547904 %}
{% twitter 1126950003832786944 %}

**What are your reactions to the announcement?**
What was your win this week?
Tags: discuss, weeklyretro
Published: 2019-05-10 18:23:30

---
title: What was your win this week?
published: true
description: Got to all your meetings on time? Started a new project? Fixed a tricky bug?
tags: discuss, weeklyretro
cover_image: https://cl.ly/188e843c2985/download/Image%202019-02-15%20at%202.36.37%20PM.png
---

⏪⏪⏪⏪⏪⏪

Looking back on your week -- what was something you're proud of?

All wins count -- big or small 🎉

Examples of 'wins' include:

- Getting a promotion!
- Starting a new project
- Fixing a tricky bug
- Cleaning your house...or whatever else that may spark joy 😄

Happy Friday!
Debugging a Pip Package in Visual Studio Code
Tags: python, pip, vscode, debug
Published: 2019-05-10 18:06:30

---
title: Debugging a Pip Package in Visual Studio Code
published: true
description: For those rare cases where someone ELSE is wrong. Or so you think.
tags: python, pip, vscode, debug
cover_image: https://thepracticaldev.s3.amazonaws.com/i/4180poszvlcme6i6j67r.jpg
---

Let's consider the case where you're writing some ***incredibly*** important business logic in a simple environment and you want to see exactly what the **pyjokes** package is doing when you call *get_joke()*.

**business_logic.py**:
~~~python
from pyjokes import get_joke
print(get_joke())
~~~
The package's [Git repository](https://github.com/pyjokes/pyjokes) is often a great place to start, but sometimes you want to be able to step through the package. 
Here's what you can do:
<ol>
   <li>
      Activate your virtual environment (if you haven't already)
   </li>
   <li>
      Uninstall the package <code>pip uninstall pyjokes</code>
   </li>
   <li>
      Reinstall the package from source with the editable flag
      <div class="highlight">
         <pre class="highlight bash">
pip install --editable git+git@github.com:pyjokes/pyjokes.git#egg=pyjokes
</pre>
      </div>
      <ul>
         <li>
            <code>--editable</code> can be shortened to <code>-e</code>
         </li>
         <li>
            You aren't limited to Git repositories! You can also use "svn+" and "bzr+" and a few others. See Pip's <a href="https://pip.pypa.io/en/stable/reference/pip_install/#vcs-support">VCS support documentation</a>
         </li>
         <li>
            <code>#egg=[Custom Name]</code> creates a directory [Custom Name].egg.info relative to the project path. You probably won't care about this, but it's required.
         </li>
      </ul>
   </li>
   <li>
      The pyjokes repository can now be found in <code>[virtual environment folder name] > src > pyjokes</code>. But this isn't exactly what we're interested in.
   </li>
   <li>
      Find where the source code actually exists in the repository, in this case it's a subfolder with the same name. Sometimes it's a subfolder called "src". <code>[virtual environment folder name] > src > pyjokes > pyjokes</code>
   </li>
   <li>
      Move this folder up to the root level of your project. For example, this project directory now contains the following files and directories:
<ul>
<li>pyjokes (folder)</li>
<li>venv (virtual environment folder)</li>
<li>business_logic.py</li>
   </li>
</ul>
<li>Almost done! Set the breakpoints you want in the pyjokes source code, open business_logic.py, switch to the VSCode debugger and press the green run button. Two prompts will appear, select Python for the first and "current file" for the second!
</li>
</ol>

As an added bonus, you can edit the package too--good luck debugging!
What do you wish you knew about Developer Relations?
Tags: discuss, community, devrel
Published: 2019-05-10 17:58:41

---
title: What do you wish you knew about Developer Relations?
published: true
description: A conversation... what do DevRel professionals wish devs knew about their job? And what do devs wish they knew about DevRel?
tags: discuss, community, devrel
---

Developers (and Ops folks!) - what do you wish you knew (or better understood) about DevRel?

And DevRel folks - what do you wish developers knew about your job?
Tip: Disabling Links As Buttons in Gatsby
Tags: javascript, gatsby, react, webdev
Published: 2019-05-10 17:22:12

---
title: Tip: Disabling Links As Buttons in Gatsby
published: true
description: How to use Link as a button and disable it.
tags: #javascript #gatsby #react #webdev
---

I was working on my Gatsby blog project today and ran into a little quirk. I wanted navigation buttons to let the user go to the next and previous posts in the blog. I wanted those buttons to be Gatsby Links. Simple enough, right? However, when the user reaches the very first post or the very last, I wanted said button links to be disabled.

For example:

```javascript
        <Link
          disabled={!nextPost}
          className="button"
          to={nextPost ? nextPost.node.fields.slug : "/"}
        >Next Post</Link>
```

See, if nextPost is falsy, the Link should be disabled. Except, in practice I found that despite it appearing disabled it still can be clicked and fired off. And it will sling them to the index page of the site.

After a little digging around Google, I figured out this neat trick. It required I add this class to my CSS.

```css
.disabled-link {
  pointer-events: none;
}
```

After that I just needed a ternary statement put this before the component's return JSX.

```javascript
 const disabledNext = nextPost ? "" : "disabled-link"
```

To finish, I morphed my Link button into this:

```javascript
        <Link
          disabled={!nextPost}
          className={`button ${disabledNext}`}
          to={nextPost ? nextPost.node.fields.slug : "/"}
        >Next Post</Link>
```

The .disabled-link CSS class makes it so it can't be clicked at all, returning the disabled functionality to it that I intended. Bing, bang, boom!
Change mailto handler in Firefox
Tags: gmail, handler, firefox, mailto
Published: 2019-05-30 00:23:09

---
title: Change mailto handler in Firefox
published: true
tags: gmail,handler,firefox,mailto
canonical_url: 
---

![](https://cdn-images-1.medium.com/max/600/1*O6fHQhlnJeiKc5BJ45PfRw.png)<figcaption>Firefox Logo</figcaption>

Edit file:
```
~/Library/Application Support/Firefox/Profiles/[profile\_name]/handlers.json
```

section: `schemes.handlers.mailto`

![](https://cdn-images-1.medium.com/max/360/1*gzkVgnOB-8HNsB4xejx4Hg.png)<figcaption>Gmail Logo</figcaption>
The easiest way to implement api
Tags: help
Published: 2019-05-10 16:00:20

---
title: The easiest way to implement api
published: true
tags: help
---

I know I might be laughed at that bad place or something.

But I am not a programmer. I have some knowledge but rather little.

I would like to implement api on ready-made cms. How to approach this more easily?
Will you find some examples of how to do it in the shortest way?

It can be wordpress, mybboard, ipboard.

What does it want to do in a shortened form

The user creates a new post. Then i want the script to search for a keyword in this post e.g. "book" and it's best if this keyword is in a specific field/div(but, how to do a specific div in a post ?)

And then add to this keyword information from api. Thanks
Why you should participate in Google Season of Docs
Tags: writing, opensource
Published: 2019-05-10 15:54:04

---
title: Why you should participate in Google Season of Docs
published: true
description: 
tags: writing, opensource
---

[Season of Docs](https://developers.google.com/season-of-docs/) is Google Open Source’s new program to help technical writers contribute docs to open source projects by working with mentors and earning a stipend for the participating in the program.

Season of Docs is a unique program that pairs technical writers with open source mentors to introduce the technical writer to an open source community and provide guidance while the writer works on a real world open source project. The technical writer in turn provides documentation expertise to the open source organization.

Here’s why you should [participate in Season of Docs](https://developers.google.com/season-of-docs/docs/tech-writer-guide):

### Build your tech writing portfolio

[In last week’s video](https://www.youtube.com/watch?v=68ddwfpXHrE&feature=youtu.be), I discussed how my open source GitHub profile serves as my technical writing portfolio. I shared how my publicly accessible GitHub profile helps me demonstrate my technical skills, tech writing skills, collaborative skills, and flexibility and proficiency with tech writing tools.

Participating in Season of Docs and writing documentation for an open source project is an excellent way to build your tech writing portfolio.

### Work with mentors

My favorite thing about Season of Docs is the opportunity to work with mentors. Contributing to open source projects is a daunting prospect; especially if you haven’t worked with GitHub and other open source tools before. Having a mentor who can guide you through the overwhelming parts of the process and is invested in your success is incredibly helpful.

### Earn a stipend

After a successful project evaluation at the end of the program, Google will pay you a stipend calculated based on your location. For details, see [Technical writer stipends](https://developers.google.com/season-of-docs/docs/tech-writer-stipends).

## Work with us!

I am participating in the program as a mentor for [Hydra Ecosystem](https://www.hydraecosystem.org). 

I found Hydra Ecosystem right here on dev.to! And I am so glad I did :)

Check out our [project ideas](https://www.hydraecosystem.org/seasonofdocs-2019) and if you find the project interesting and would like to work with us, [apply to the program](https://developers.google.com/season-of-docs/docs/tech-writer-application-hints) as a technical writer and select the Hydra Ecosystem project. And feel free to contact me if you need help coming up with a proposal for the project. I look forward to hearing from you 🙂

Bonus: To know about additional ways to find open source projects and then choose the project that’s right for you, check out this video:

{% youtube c4c7er-TBm8 %}
Completing the Todos #1 - The Beginning
Tags: design, development, todolist, journey
Published: 2019-05-10 15:19:11

---
title: Completing the Todos #1 - The Beginning
published: true
description: One women's path to creating her ultimate To Do List.
tags: design, development, to-do-list, journey
---

Back in college, we had an assignment. We had to make a To Do List app, that followed all these different rules, using Firebase and AngularJS. My prof wanted me to use Onsen (because I'm just that good)(ha), but I didn't and stuck with the original rules.

Reader. This project broke me.

Everything was going fine until... it wasn't. The  real kicker was that the code was all correct, and should have been working... but it wasn't. I spent WEEKS trying to figure out what was wrong. Me and my prof had SO MANY sessions and phone calls trying to figure it out.

And I didn't figure it out. Still got 110/100 on the project.

__But now__

I want to try it again. This project will not win. I will break it!

I might not use Firebase and AngularJS. From what I gather, there's something new called FireStore that I might have to look into. I've been looking into Vue a bit, and might try and figure that out. (If anyone has any recommendations, please leave them in the comments! I would be SO grateful.)

But we are starting from square 1. As I can do both UI/UX Design and Web Development, we're starting with wireframes. 

And I'm *excited*. I can't wait to start this project and try to expand my knowledge, while at the same time trying to document it on here! 

I've got a basic design in my head, and I think it will work? Hopefully? 

This is just the beginning. The first To Do completed on the quest to create the ultimate To Do List. 

Let's get this started.

~ Sharkie
ngx-editorjs - An Angular module for EditorJS
Tags: angular, opensource, webdev, showdev
Published: 2019-05-10 15:11:37

---
title: ngx-editorjs - An Angular module for EditorJS
published: true
description: A new module for Angular that allows EditorJS to be use in your applications
tags: angular,opensource,webdev,showdev
---

Today I have published my first full Angular module - `@tinynodes/ngx-editorjs` on [NPM](https://www.npmjs.com/package/@tinynodes/ngx-editorjs).

The module is a set of features for Angular (7+) to create and control [EditorJS](https://editorjs.io) instances.

A [demo application](https://tinynodes-ngx.firebaseapp.com/ngx-editorjs-demo) is available to see the editor in action, and the source is also available in the [`@tinynodes` monorepo](https://github.com/tanepiper/ngx-tinynodes).

## Included Features

The library exports several features once the `NgxEditorJSModule` has been included in your project.

#### NgxEditorJSDirective

This is the main directive which can be used on any element with the `[ngxEditorJS]` selector and and `id` attribute.

```html
<div id="my-editor" ngxEditorJS></div>
```

This will handle creating the editor instance via the `NgxEditorJSService`

#### NgxEditorJSComponent

This component can be used in any Angular component using the `<ngx-editorjs>` tag. Again this component can take a set of blocks, it also provides a `holder` input for overriding the ID.

```html
<ngx-editorjs [holder]="holderProperty"></ngx-editorjs>
```

#### NgxEditorJSService

This service provides handling the life-cycle of the EditorJS instances, and exposes the underlying [EditorJS API](https://editorjs.io/api) - in future releases more of the API will be exposed via service methods to make controlling the container easier.

The module is configurable and allows EditorJS plugins to be injected into the library - (see [README.md](https://github.com/tanepiper/ngx-tinynodes/blob/master/libs/ngx-editorjs/README.md)) on how to do this in a AOT-friendly way.

## Next Steps

Before release I had to resolve an issue with AOT compiling and injecting EditorJS plugins - this means version `1.1.0` has already been released - now this is resolved I want support additional feature in the editor, as well as provide unit test coverage and better documentation and demo.

If you find any issues or have feature requests these can be left on the [GitHub Issues](https://github.com/tanepiper/ngx-tinynodes/issues) page.
Job offer for developers in Lisbon, PT
Tags: react, php, javascript, career
Published: 2019-05-10 14:51:23

---
title: Job offer for developers in Lisbon, PT
cover_image: https://thepracticaldev.s3.amazonaws.com/i/2wskhxc0pvya6usps6zw.gif
published: true
description: Job posting
tags: react, php, javascript, careers
---

My team is expanding.
We are a Lisbon-based Scrum team working for an overseas company, developing revolutionary products for the gaming and sports betting industry, which will soon be in production across the World.
We are in urgent need of at least 1 backend and 3 frontend developers. Junior to senior. We use Javascript, Node, Angular, React, React Native, ionic, Redux, Java, Memcached, PHP, Symfony, RabbitMQ, MariaDB, Jenkins, and anything else that gets the job done.

We don't deploy on Fridays (usually...) and we don't do extra time (definitely!), unless it has to do with beer instead of code.

You must be located in Lisbon and you must be fluent in English, as you will be working in an international environment. You will be offered a proper full-time job offer with all the perks. This is NOT a freelance gig.

HTML bricklayers need not apply. Only developers with solid notions of current software development best practices, please.

Someone else is taking care of the recruitment process. I'm just trying to help. Please reply with a comment to the following LinkedIn post, so I can have all the replies in one place:
https://www.linkedin.com/feed/update/urn:li:activity:6532617752622964736/
Salesforce Fields Not Updating With C# Web Service
Tags: salesforce, webservice, learning, troubleshooting
Published: 2019-05-10 14:32:24

---
title: Salesforce Fields Not Updating With C# Web Service
published: true
description: Salesforce has a number of different field types that can be modified programmatically and I wanted to share my discovery on how to make changes to any non-text/number fields (what I call "special" fields).
tags: Salesforce, Web Service, Learning, Troubleshooting
series: Salesforce SOAP API Services

---

This week I made a <del>silly</del> discovery while I built out some new functionality for the Salesforce Asset Updater application I've been assigned to create at work. I'm hoping that by sharing this discovery here, I can save someone else the time sink of trying to figure out why their fields won't update!

Salesforce has a number of different field types that can be used on each object. These range from the simplest text type fields all the way up to more complex lookup fields with relationships to other objects. Non-text fields such as Number, Checkbox, Date, and Picklist require a very simple but essential extra step during object initialization to indicate to Salesforce that a change must be made to these fields.

As a reminder, typical Salesforce object initialization for update and creation with only string fields looks like:

    Account newAccount = new Account{
        Id = GetSalesforceId(custName),
        Phone_Number__c = custPhone,
        Shipping_Address__c = custAddress,
    }

Once you attempt to create or update fields that are of a non-string type (such as a Checkbox), you must provide the desired field value and also update the field's "specified" field as seen in the example below: 

    Account newAccount = new Account{
        Id = GetSalesforceId(custName),
        Phone_Number__c = custPhone,
        Shipping_Address__c = custAddress,
        /*Updating Checkbox field below*/
        Is_Premium_Customer__c = true,
        Is_Premium_Customer__cSpecified = true
    }

There is no clear exception or error output letting you know you've forgotten this crucial step. The only indication that you've attempted to modify one of these special fields without including the specified field is the field just refusing to update without any complaints. Personally, I spent almost an hour trying to figure out where I went wrong before the right google search finally led me down a path to this solution.