teleren/devto huggingface dataset:
Dev T-Shirt: "detached HEAD"
Tags: git, swag
Published: 2018-11-13 09:11:25

---
title: Dev T-Shirt: "detached HEAD"
published: true
description: Sharing my developer t-shirt design!
tags: git, swag
---

![detached HEAD](https://thepracticaldev.s3.amazonaws.com/i/0786bbl37w1i8vx6pj1t.jpg)

Hi all! I just wanted to share a T-Shirt I designed. If you've used git before, you've probably ended up in a "detached HEAD" state at some point or another. It's when you checkout a commit which is not a current branch.

It's a skull because... I needed more skull shirts :D

Since there can never be too many dev shirts, you can get it in a bunch of different styles and fits over at my Society6 store!

https://society6.com/cryptacular

This is me wearing it :P

![Hey it's me!](https://thepracticaldev.s3.amazonaws.com/i/ragfhcjq40fltaiv9gxg.jpg)
React js Contentful starting
Tags: contentful, javascript
Published: 2018-11-13 08:43:37

---
title: React js Contentful starting
published: true
description: How to start with React js and Contentful
tags: Contentful, javascript

---

Contentful is headless CMS that you can use for building your content from its ready back-end and fetch your content with RESTFUL-API. 

In this tutorial I am going to share with you how to start a simple project on Contentful and React js. 

This tutorial assumes that you are already familiar with React and creating React project.

I will explain creating and connecting to Contentful in steps.
 
But first you need to have a Contentful account, simply go to https://www.contentful.com/sign-up/ and sign up then sign in. 

- 4 simple steps for creating content on Contentful

First step: After you sign in go to the navbar to the left and choose to create a new space. This is where your data will be saved. For this tutorial I named the space 'Blog'.

Second step: is to make content type. If you are adding a structure for 'articles' make you content type as 'article'. When add content in next step you will find 'add article' button to add content. 

Let's continue making the data model.

After you created your content type you can find 'add field'. 

Add field -> text -> short text -> make the title 'post title'
Add field -> text -> long text -> make the title 'post content'
Add field -> text -> short text -> make the title 'post author'

If you are following you get the idea. You can add more fields of you would like to. 

On the top NavBar click 'content'. Save and go to content.


Third step: Adding content should be so simple. Just click 'add article' in case you chose your content type as 'article'. Then you are adding content as you would do on WordPress. You can use Lorem ipsum generators like http://lorem-ipsum.perbang.dk/ to generate content for testing.

Last step: is fetching content you created. 

You need to get your 'access token' and 'space ID' from Space setting -> API keys

```
import React, { Component } from "react";
import { render } from "react-dom";
import { createClient } from "contentful";


var client = createClient({
  space: "YOUR_SPACE_ID",
  accessToken:
    "YOUR_ACCESS_TOKEN"
});

class App extends Component {
  constructor() {
    super();
    this.state = {
      article: []
    };
  }

  componentDidMount() {
    client.getEntries().then(({ items }) => {
      this.setState({ articles: items });
    });
  }

  render() {
    return (
      <div>
        Content goes here
      </div>
    );
  }
}

render(<App />, document.getElementById("root"));

```
myConsole - A JavaScript editor for your phone, in JavaScript.
Tags: javascript, editor, online, cellphone
Published: 2018-11-13 08:37:28

---
title: myConsole - A JavaScript editor for your phone, in JavaScript.
published: true
description: A simple JavaScript editor to run in your phone.
tags: javascript, editor, online, cellphone
canonical_url: https://github.com/victorqribeiro/myConsole
cover_image: https://thepracticaldev.s3.amazonaws.com/i/jhrgvkenp3grqqnlccnx.png
---

# myConsole

A simple JavaScript editor for you phone, in JavaScipt.

![myConsole](https://thepracticaldev.s3.amazonaws.com/i/zuq9mrq9sacj8ha5snpd.png)

A live version of it is hosted [here](https://victorribeiro.com/myConsole).
Make WooCommerce Custom Order Status Payable
Tags: wordpress, woocommerce, showdev, discuss
Published: 2018-11-13 06:50:13

---
title: Make WooCommerce Custom Order Status Payable
published: true
description: 
tags: wordpress, woocommerce, showdev, discuss
canonical_url: https://harnerdesigns.com/blog/make-woocommerce-custom-order-status-payable/
---

Do you have a custom WooCommerce Order Status that you want to be able to take payments on? Look no further than the `woocommerce_valid_order_statuses_for_payment` filter. I spent an ungodly amount of time looking for this filter today. I knew what I needed, but I didn't know what it was called. I knew there was a `wc_order_is_editable` filter that you could add statuses too, so I figured there had to be one to be able to require payment on a custom order status.

## Make WooCommerce Custom Order Status Payable
After many trials and tribulations, I present to you my findings: 

```php
function filter_woocommerce_valid_order_statuses_for_payment($array, $instance)
    {
        $my_order_status = array('cancelled', '<custom_order_status>');
        return array_merge($array, $my_order_status);
    }

    // add the filter
    add_filter('woocommerce_valid_order_statuses_for_payment', 'filter_woocommerce_valid_order_statuses_for_payment', 10, 2);
```

This beautifully simple piece of code will add the list of order statuses to the statuses that can access the checkout or Form Pay.

## Why I Figured This Out

I developed a workflow that would allow a client to take deposits on custom orders. It involves programatically setting the order status to `deposit_paid` but the customer needs to still be able to pay the rest of the balance. By adding `deposit_paid` to the list of valid order statuses for payment, the customer can come back and pay the rest of the invoice when the order is ready to ship.

> ## This took me forever to figure out. I have no idea why.
> # What's the latest thing that's taken you the longest to figure out?

## Recent Posts
* Originally Posted Here: [Make WooCommerce Custom Order Status Payable](https://harnerdesigns.com/blog/make-woocommerce-custom-order-status-payable/)
* [Legacy API Accounts in BigCommerce](https://harnerdesigns.com/blog/legacy-api-accounts-in-bigcommerce/)
* [Fuck Facebook’s Text Overlay Tool](https://harnerdesigns.com/blog/fuck-facebooks-text-overlay-tool/)
* [BigCommerce Marketing Banners Adding Extra Commas](https://harnerdesigns.com/blog/bigcommerce-marketing-banners-adding-extra-commas/)
Dynamic AppEngine Configurations using Gradle Part 1
Tags: appengine, googlecloud, gradle, programming
Published: 2018-11-13 06:21:56

---
title: Dynamic AppEngine Configurations using Gradle Part 1
published: true
description: 
tags: #appengine,#googlecloud,#gradle,#programming
---

When working with AppEngine applications, often times we need to work with configuration files like appengine-web.xml, cron.xml, dispatch.xml etc. And also we have multiple environments to deal with like staging, alpha and production.

The problem is we need different configurations for each of those environments for example,

[Read On](https://medium.com/@rameshlingappa/dynamic-appengine-configurations-using-gradle-part-1-e3959a39f31b)
Who's Using Isolates? (Cloudflare article)
Tags: webdev, discuss, cloud, container
Published: 2018-11-13 04:38:17

---
title: Who's Using Isolates? (Cloudflare article)
published: true
description: Discussion on Cloudflare's recent Isolates blog article.
tags: webdev,discuss,cloud,container
---

Has everyone read [Cloudflare's recent article](https://blog.cloudflare.com/cloud-computing-without-containers/) on cloud computing without containers? It's a very interesting comparison, from their perspective, on containers with Lambda vs. their setup using Isolates. This was a new technology for me. I didn't see any posts on the technology on dev.to when searching for "Isolates" so maybe this is new for a lot of you as well!

What are your thoughts on the article, and about the future of server-less cloud computing? Do you agree with Cloudflare in that Isolates are the long-term future? Have you used Isolates before - how was that experience?
My test Environment https://github.com/danielprietsch/AgileDevOps
Tags: docker, swarm, traefik
Published: 2018-11-13 04:00:47

---
title: My test Environment https://github.com/danielprietsch/AgileDevOps
published: true
description: My test Environment https://github.com/danielprietsch/AgileDevOps
tags: docker, swarm, traefik
---

I need help in an environment I'm developing for studies and testing, accessible at: https://github.com/danielprietsch/AgileDevOps

- HTTPS SSL Certificates and Redirecting only to http:// "/" ??
- Copy the Traefik logs to volume in Linux (not in container) ??
- Parse Traefik logs???
- Creating a real Jenkins test GIT > JENKINS > ANSIBLE > DOCKER ??

Any contribution is coming! Thank you!
[IMAGE WORKFLOW][1]


  [1]: https://i.stack.imgur.com/E8YEY.png
C Pointer Review
Tags: c, pointers
Published: 2018-11-13 03:48:15

---
title: C Pointer Review
published: true
description: A brief, coded review of pointers in C
tags: C, pointers
cover_image: https://images.unsplash.com/photo-1465343161283-c1959138ddaa?ixlib=rb-0.3.5&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=1000&h=420&fit=crop&ixid=eyJhcHBfaWQiOjF9&s=274c2036601036078977f3b3bae4efb1
---

_This post was originally written February 24, 2017 during an embedded systems course. I'm migrating all my personal blog posts onto dev.to._

I was recently bogged down with an embedded systems project that took much longer than it should have. Part of the problem was using pointers again, so long after learning them the first time. All answers on StackOverflow were obvious once I saw them again, but what I really needed to be more effective was raw review and practice outside of project pressure.

A lot of language tutorials have detailed descriptions for each component of whatever they're doing, along with small code snippets to help "connect-the-dots." They're meant to teach. *This* post ends in a few sentences with a commented & ready-to run file reviewing basic C pointer assignment and access, arrays, structs, and function pointers. The comments will walk you through the code, while the output is experimental "proof" that it works.

I hope you find it helpful - happy reviewing!

[gist.github.com - A Review of C Pointers](https://gist.github.com/eburdon/9c34e719fa7dc872bc32639a7d5a3180)
Elixir: バージョン間の互換性と非推奨
Tags: elixir, webdev, tutorial, programming
Published: 2018-11-13 01:08:19

---
title: Elixir: バージョン間の互換性と非推奨
published: true
description: Elixir公式ドキュメント「Compatibility and Deprecations」の「Deprecations」に示されている互換性のポリシーと3つの段階についてご説明します。
tags: #elixir, #webdev, #tutorial, #programming
---

本稿は「[Elixir の互換性について](https://qiita.com/melpon/items/c808e546dc6671894ce6)」をもとに加筆・補正し、文章を整えました。


# 非推奨の機能の警告表示
Elixirは互換性を大事にしている言語です。そのため、古い機能も比較的長く残っています。

たとえば、[`HashDict`](https://hexdocs.pm/elixir/HashDict.html)を使うことは、Elixir 1.4から推奨されなくなりました(deprecated)。けれど、Elixir 1.7.4でも警告は出るものの、削除されていません。

```elixir
iex> HashDict.new()
warning: HashDict.new/0 is deprecated. Use maps and the Map module instead

#HashDict<[]>
```

また、[Elixir 1.3まであった`Enum.partition/2`](https://hexdocs.pm/elixir/1.3.4/Enum.html#partition/2)という関数は、Elixir 1.4からひっそりとドキュメントから消されました。しかし、今でも呼び出して使えます。

```elixir
iex> Enum.partition([1, 2, 3], fn(x) -> rem(x, 2) == 0 end)
warning: Enum.partition/2 is deprecated. Use Enum.split_with/2 instead

{[2], [1, 3]}
```

さらに、`Code.load_file/2`や`Code.loaded_files/0`および`Code.unload_files/1`などの関数は、[Elixir 1.7から非推奨](https://github.com/elixir-lang/elixir/releases/tag/v1.7.0)とされてドキュメントから除かれたものの、使っても警告は出ません。

deprecatedの警告がいつから出て、それらの機能がいつまで残っているのか気になるところです。


# 互換性のポリシー
答えはElixir公式ドキュメント「Compatibility and Deprecations」の「[Deprecations](https://hexdocs.pm/elixir/compatibility-and-deprecations.html#deprecations)」に示されています。機能の廃止は、つぎの3つの段階を踏んで進められるということです。


1. 機能をやわらかな非推奨(soft-deprecation)とします。CHANGELOGとドキュメントの機能リストでは非推奨とするものの、コードを効果的に動作させるため、**警告は出しません**。機能を使わないよう強いられることはないのです。
2. 機能を使ったとき**警告を出して**、非推奨であることが告げられます(hard-deprecation)。機能が円滑に削除できるよう、必ず代替手段が示されなければなりません。そのあと**少なくとも2マイナーバージョンが経過**してから警告が示されます。
3. **メジャーバージョンがリリース**されたとき、**非推奨の機能は削除**されます。つまり、現在のElixir 1.xで非推奨とされている機能は、Elixir 2.xで除かれるということです。

Elixir 1.5の`HashDict`にdeprecated の警告が出るのは、Elixir 1.2で`Map`という代替機能が追加されてsoft-deprecatedになり、２マイナーバージョンを経たElixir 1.4以降になったからです。

これに対して、Elixir 1.7で非推奨とされた`Code.load_file/2`や`Code.loaded_files/0`および`Code.unload_files/1`などは、代替機能としてそれぞれ`Code.compile_file/2`と`Code.required_files/0`そして`Code.unrequire_files/1`が備わったものの、２マイナーバージョンが経過していないため、soft-deprecatedとされているのです。

これらの機能は Elixir 2.0で削除されます。逆にいえば、ドキュメントから消えたりdeprecatedの警告が出るものの、Elixir 2.0までは残っていることが保証されています。


# なぜsoft-deprecationの段階があるのか
多くのユーザは、わざわざCHANGELOGを見ないでしょうし、これまで動いているモジュールのドキュメントを改めて調べることは少ないと思われます。ユーザが気づくのは deprecatedの警告が出たときです。その前に、わざわざsoft-deprecationという段階を経るのはなぜでしょうか。

おそらく、警告にしたがってただちに機能を削ったとき、古いバージョンで動かなくなってしまうことを防ぐためだと推測されます。

たとえばElixir 1.5から`Atom.to_char_list/1`や`Integer.to_char_list/1`といった`.*char_list.*`系の関数やアトムがすべて`.*charlist.*`に改められています。これによって、多くのライブラリが警告を出すようになりました。だからといって、すぐに直すとElixir 1.4で動かなくなってしまうなら、もう少し先に延ばそうということになるかもしれません。

しかし、`.*charlist.*`周りの実装は、実はElixir 1.3から入っています。つまり、警告が出た時点ですぐ直しても、過去２マイナーバージョンで動作することが保証されているのです。それが理由だとすれば、soft-deprecationはよくできた仕組みだと考えられます。


# まとめ
以上のとおり、Elixirは互換性をかなり大事にしています。Elixir 2.0までは、古いコードも動くようです。安心して計画的にアップデートを行いましょう。
On Plaintext Login Details
Tags: security
Published: 2018-11-13 03:47:04

---
title: On Plaintext Login Details
published: true
description: Should account login details be sent to users on sign-up?
tags: security
cover_image: https://source.unsplash.com/MZnuRv1ZASk/2000x1200
---

_This post was originally written January 17, 2017. I'm migrating all posts from my personal blog onto dev.to_

Recently, I registered for a new online community for ladies in technology. Part of the whole "get-out-there" goal. I went through the standard process of signing up with my email, using [LastPass](https://www.lastpass.com/) to generate a new password and save the entry in my vault, so on and so forth. I was pretty alarmed when I received an email half a minute later with all my login details... *including the password in plaintext*!

    "Congratulations on entering the tech community!

    The login information for your account is: 
    Email: email@email
    Password: password

    ..."

What are your thoughts on this? I asked around - it seems like this used to be standard practice. It's old, but still fine to use.

I explored the community a bit more and it was clear that the website doesn't handle any personal information about its users. There's no profile or chat section. The website is mostly links to local events and job postings. It's clear this isn't a high-security venture and strong password protection may not be necessary. That said, I truly think all services should take every step they can to help users protect and increase their online security. What if I wasn't using a password generator, and my unique password was actually already in use on another platform? Oops.

As an alternative, look at how Slack handles new users. When registering for a new channel, you receive a little email like so:

    "Your Slack Account Information

    Hi Erika, 

    Welcome to Slack! You've joined the team teamName. In case it's handy,
    here's a copy of your account details:

    Team Name: teamName
    Team Domain: http://teamURL
    Sign-in Email Address: email@email

    ..."

This serves the same purpose with all the info you need without the password. I like how it doesn't assume my email inbox is absolutely secure while still providing useful information I can archive.

I reached out to the new community's help desk and was really happy with the response. The company they hired said it's standard to include the password, but the community agreed that it should be removed for the extra security and so it will be phased out.

<br/>

## What do you think of emailing users their account information on sign-up? Still required? Should passwords be included?
A list of Flutter Resources that would help start learning Flutter
Tags: flutter
Published: 2018-11-13 03:32:50

---
title: A list of Flutter Resources that would help start learning Flutter
published: true
description: A list of Flutter Resources that would help start learning Flutter.
tags: flutter
---

Documentation: https://docs.flutter.io/

Github: https://github.com/flutter/flutter

StackOverflow: https://stackoverflow.com/questions/tagged/flutter

Gitter: https://gitter.im/flutter/flutter

Effective Dart Guide: https://www.dartlang.org/guides/language/effective-dart

Dart Tips: https://www.dartlang.org/resources/dart-tips

Flutter FAQ: https://flutter.io/faq/

Flutter Awesome: https://flutterawesome.com/

Flutter Rendering: https://www.youtube.com/watch?v=UUfXWzp0-DU

Flutter Engine: https://github.com/flutter/engine/wiki

Hot Reload: https://flutter.io/hot-reload/

Flutter Inspector: https://dart-lang.github.io/observatory

Dart Style Guide: https://www.dartlang.org/guides/language/effective-dart/style

Flutter Widgets: https://flutter.io/widgets/

Flutter Gallery App Code: https://github.com/flutter/flutter/tree/master/examples/flutter_gallery

Flutter Gallery Android App: https://play.google.com/store/apps/details?id=io.flutter.gallery

Flutter Layout: https://flutter.io/tutorials/layout/

Material: https://material.io

Icons: https://thenounproject.com

Images: https://unsplash.com

Fonts: https://fonts.google.com

Google APIs: https://pub.dartlang.org/packages/googleapis

Async and Futures: https://www.dartlang.org/tutorials/language/futures

Testing: https://flutter.io/testing
A curated list of awesome React.js libraries
Tags: react
Published: 2018-11-13 03:30:23

---
title: A curated list of awesome React.js libraries
description: A nice collection of often useful examples done in React.js
published: true
tags: react
---

A nice collection of often useful examples done in React.js

[Reactjs Example](https://reactjsexample.com/)

just want to share here because it might be useful for others learning it too!:
What's first? Frontend or Backend?
Tags: frontend, backend, ux, organizing
Published: 2018-11-13 02:41:38

---
title: What's first? Frontend or Backend?
published: true
description: Pondering thoughts about whether to start with frontend or backend first.
tags: frontend, backend, ux, organizing
---

As a fresher straight out of college, I've never really grasp the differentiation between frontend and backend development. I've barely digested the grueling computer science courses of my degree let alone understand the many stacks that make up the entire development process. As such, my first job was synonymous to trial by fire. I had to do everything from setting up a database, figuring out how to run a server, deciding the best design patterns to use and cultivate my inner aesthetic self just enough to make a decent looking page with CSS. 

Fast forward three years. 

Now I have a relatively good grasp of the development world. Although far from being considered a good coder, the technical terms and buzzwords no longer strike me as hieroglyphics from an alien magazine. Researching issues are no longer seems like an olympic chore. But one thing still itches me whenever I start a new project. Frontend or backend first? While this may not be a question for those that have specific roles on the team, knowing which to start first helps me tremendously in organizing my code. From experience, I've noticed the pros and con of doing each first.

Front end first
Pros -  Better organization of your design vision.
        Use front end elements to gradually map out backend functionality.
        Faster gratification from not having to redeploy.
        Have something to show at the end of the day.
        It's more fun.

Cons -  Clients think you're done.
        Nothing works (yet).

Back end first
Pros -  Tedious part is done.
        Requirements are quickly fulfilled.

Cons -  Have very little to show to client besides code.
        May not get a lot of feedback so may incur more refactoring later.
Seriously, periodically do brew cleanup.
Tags: homebrew
Published: 2018-11-13 02:28:54

---
title: Seriously, periodically do brew cleanup.
published: true
description: Before it's too late.
tags: #homebrew 
---

**EDIT:**  
Seems like that [since v2.0.0, homebrew decided that it should perform auto cleanup every 30 days,](https://brew.sh/2019/02/02/homebrew-2.0.0/) so it is rare to run into issues like below nowadays :) I'm keeping this up for historical reason (and possibly for other softwares that don't auto-cleanup themselves.)

I just found out that my Homebrew was keeping all the old installer for my upgradable Casks 😱

I ran `brew cleanup` to find to my horror:

```
_( _・ω)_<(me XD)@localhost H30 11/12 12:13:17)
> brew cleanup                                                                [~]
Removing: /usr/local/Cellar/apr/1.6.3... (60 files, 1.3MB)
Removing: /usr/local/Cellar/arpack/3.6.2... (22 files, 1.4MB)
...
Removing: /Users/(me XD)/Library/Caches/Homebrew/Cask/unity--2018.2.1f1,1a9968d9f99c.pkg... (940.3MB)
Removing: /Users/(me XD)/Library/Caches/Homebrew/Cask/unity--2018.2.6f1,c591d9a97a0b.pkg... (935.7MB)
...
Removing: /Users/(me XD)/Library/Caches/Homebrew/Cask/unity--2018.2.13f1,83fbdcd35118.pkg... (944.6MB)
Removing: /Users/(me XD)/Library/Caches/Homebrew/Cask/unity--2017.3.1f1,fc1d3344e6ea.pkg... (721.0MB)
Removing: /Users/(me XD)/Library/Caches/Homebrew/Cask/unity--2018.2.12f1,0a46ddfcfad4.pkg... (935.6MB)
Removing: /Users/(me XD)/Library/Caches/Homebrew/Cask/unity--2018.1.0f2,d4d99f31acba.pkg... (943.8MB)
...
==> This operation has freed approximately 19.9GB of disk space.
```

***19.9GB?!?***

I only have 250GB of space in total; that's a big chunk of data. If you are using Homebrew Cask to install your favorite apps, be sure to do `brew cleanup` (or use flag `--cleanup` on upgrades!)
How the entry-level user could understand ico marketing
Tags: icomarketing, icostrategies, cryptocurrency
Published: 2018-11-13 01:15:54

---
title: How the entry-level user could understand ico marketing
published: true
description: How to start ICO, if you're newcomer
tags: ico marketing, ico strategies,cryptocurrency
---

ICO is the abbreviation and it means Initial coin offering. This is an epoch of cryptocurrencies and tokens. People, who are interested in this, had noticed that ICO appeared not long ago and spread practically all over the world. Both organizers and investors are engaged into it. You shouldn’t be scared. Of course, it’s a new brunch but anyhow it opens new opportunities and gives lots of chances not only for earning money, but also for self-realization. 
More detailed about ico marketing read at web-page http://merehead.com/blog/ico-marketing-plan-strategy-budget-consulting/ We describe the strategies and budget construction here. You’d open for yourself that ico marketing isn’t as complicated as it could be seemed to you at the first glance. To achieve the goal the private investors or even companies should choose the most popular cryptocurrency exchange platforms and allocate the tokens only there. 
Of course, investing in the project the investor is waiting for high income, but firstly make the whole analysis of the market. Don’t be assuared that 1000 thousand dollars that you invest in the brunch would make you a millionaire. Don’t be in a hurry and consider all the details before starting investing money. No doubt ico marketing is profitable but only if the investor thinks everything over in a proper way!  
It’s better to focus the project in Japan or United States, or Korea, or China, or Russian Federation. You ask “Why?” I’ll answer that the richest investors are consentrated in these countries. 
Besides the geography consider who would you cooperating with and mind the staff.
Observe the latest tendencies in the cryptocurrency exchange market. You should be always in trend! Be flexible and confident in the strength of yourself and people who you’re working with.