teleren/devto huggingface dataset:
On not being the best anymore
Tags: cto, expertise, evolution, career
Published: 2019-07-31 07:25:59

---
title: On not being the best anymore
published: true
description: I first, I thought being a CTO was like being the Jedi Master of a dev team. I was wrong.
tags: CTO, expertise, evolution, career
---

This post was originally published in french on my blog [skwi.fr](https://skwi.fr/2019/07/23/accepter-d-etre-depasse/).

There was a time when I thought that being a CTO was like being a Jedi Master : wise and with an absolute knowledge of web development ... or at least, the widest knowledge in the company.

Through the years, I changed my perspective about this job. Getting old made me more open about people and the variety of their intelligences. But I also didn't have the choice.

When I got from development to management, my job shifted from something technical to something more human centred. This shift didn't happen overnight, but my commitment to technical work was surely getting lower and lower. It wasn't the best context to maintain a technical expertise.

Reading blog posts, doing code reviews or getting my hands dirty are still important things to do. It helps me being relevant when setting the technical path for the team.

But it's important to admit that once I became CTO, I can not keep on being the best developer on the team.

And to be honest, it's healthy to strive for this situation. Not by getting less and less good, of course, but by working on elevating my team level and recruiting people with a higher level than me.

Being a CTO does not mean being the teacher, the one with all the knowledge, schooling its pupils. A CTO should be more like a coach, who may not be in a better physical condition than its athletes, but who knows how to help them get the best of their strengths.

This is not an easy step, especially after spending years building a technical expertise. But it's a mandatory step if you now want to build an outstanding team.
English Speaking Course in Gurgaon
Tags: english, englishspeaking, education, gurgaon
Published: 2019-07-31 07:04:59

Simpli English is one of the most trusted institute in Gurgaon that is helping  students to overcome their hesitation and become confident speaker with English Speaking Course in Gurgaon.


Visit: https://simplienglish.com/english-speaking-course-gurgaon
Who are all these people who are following me?
Tags: discuss
Published: 2019-07-31 07:04:21

---
title: Who are all these people who are following me?
published: true
description: Who are all these people who are following me?
tags: discuss
cover_image: https://thepracticaldev.s3.amazonaws.com/i/s6nyd3coypkj6jyqm7fx.png
---

Who are all these people who are following me? Are they bots? I don't think I'm that popular. Looking at their profile, I see that the base mass has recently registered and has no activity. 

Someone from the administration to monitor this situation?
React Tldr; Typescript: Working with Paths, Packages and Yarn Workspaces
Tags: typescript, react, workspaces
Published: 2019-07-31 06:56:30

- Typescript path aliases are useful for shortening import statements
and reaching modules from deep nested components.
- Deploying your own Typescript packages is an effective means of reusing your code and decreasing the size of your final projects.
- Where projects require multiple packages, yarn workspaces can be leveraged,
and used in conjunction with a dedicated tool called Lerna.

Source:https://medium.com/@rossbulat/typescript-working-with-paths-packages-and-yarn-workspaces-6fbc7087b325
What about Object.Method().Property in Typescript?
Tags: typescript, javascript, help
Published: 2019-07-31 05:14:23

CSEncoding.Default.GetString() was 
```typescript
declare namespace CSEncoding {
    declare namespace Default {
        function GetString(s: string, n1: number, n2: number): string;
    }
}
```
but what about `CSProcess.GetCurrentProcess().Id`? GetCurrentProcess is a function returning an object with a property? Is that how to read it??
How to minimize the WordPress plugins you use
Tags: wordpress
Published: 2019-08-01 12:58:32

---
title: How to minimize the WordPress plugins you use
published: true
tags: WordPress,wordpress
canonical_url: https://kevinhq.com/how-to-minimize-the-wordpress-plugins-you-use/
---

If you’ve been using WordPress for a while, chances are you’ve heard this kind of advice: minimize the WordPress plugins you used. This way, your site won’t get slower or at least it prevents it from being slower. That’s true. But, how much performance gain you get, depending on many other factors. Regardless of how… [Continue reading »How to minimize the WordPress plugins you use](https://kevinhq.com/how-to-minimize-the-wordpress-plugins-you-use/) ![](http://feeds.feedburner.com/~r/kevinhq/~4/ot3Uhu1_QSU)
Testing Node.js. How?
Tags: discuss, node, javascript, testing
Published: 2019-07-31 04:25:55

TBH I don't like writing test. But as the project grows changing one line of code can break your app if you don't know which part your app was dependent on that deleted line.

Different devs choose different tools for testing, which is sometime confusing.

So, what you choose for testing your Node.js apps?
Help with Magic Bar navigation on fullpage scroll 
Tags: javascript, jquery, fullpage
Published: 2019-07-31 04:22:04

I'm trying to get this navigation bar feature to work when scrolling between fullpage.js divs. I have gotten it to a point where it moves when hovering over other links and stays when those links are clicked, but when I scoll to another fullpage section, it doesn't move. I'm trying to figure out what code I should put in the onScroll fullpage.js hook. Any help would be appreciated!!

https://codepen.io/jcbbuller/pen/orKJvO

Fix: I think I fixed it, I'll post the solution later today.
Typescript type declarations
Tags: todayilearned, typescript, javascript
Published: 2019-07-31 04:08:44

Hey wow, you can embed namespaces within namespaces!
```javascript
        var resp = CSEncoding.Default.GetString(rBody, 0, rBody.Length);
```
I was wondering how I'd get that into `external.d.ts` and this is what works:
```typescript
declare namespace CSEncoding {
    declare namespace Default {
        function GetString(s:string,n1:number,n2:number):string;
    }
}
```
__LATER__

Uh oh, maybe you can't. Just reloaded the file and now I'm getting the following error:
```
A 'declare' modifier cannot be used in an already ambient context.
```
Tips of i18n for Spanish 
Tags: webdev, html, javascript
Published: 2019-07-31 03:25:30


# Internalization for Spanish 

Internalization is a big word, so I will use i18n for this article. If you are reading this, you understand English. But a lot of people in the world doesn't speak this language. I'm writing this to motivate you to translate your amazing apps, so more people could use them. I'm a native speaker in Spanish, so I will tell you about my experience.

If you want to write your app for another language, I recommend you to save the Strings in a file, so you can change this easily and access them later. I will share with you a few tips.

## Dates

If you are from the United States of America (USA), you use the format Month - Day - Year. To be honest, this could be confusing for other countries, because we use Day - Month - Year. Just consider telling what format are you using.

Example of date birth


```HTML
Fecha nacimiento: 
<input type="date" name="cumpleanios" step="1" min="2013-01-01" max="2013-12-31" value="2013-01-01">
```

## Names

In the USA, you are asked a middle name and surname. But in other countries when we talk Spanish, we can have two names, but not always and it's not the same than a middle name. My name is only Karina. Also, we use two surnames, the first from our father and the second from our mother. We need two surnames. They are called "Apellidos".

Example of form for name. 

```PHP
<p>Nombre: <input type="text" name="nombre" placeholder="Nombre"></p>

<p>Apellidos: <input type="text" name="apellidos" size="40" placeholder="Apellidos"></p>
```



## URL

We have accents and ñ. Unfortunately, you can't use them in URLs. Example, year in Spanish is "Año", but because you can't use the ñ, you could replace for "Ano". Don't. This translates to asshole. You will have to use another word for your URL. If you need to use some word with ñ, replace it with ni. Using my example, Año to Anios instead of Anos. 

```PHP
GOOD
www.karinarobledo.me/anios 
BAD 
www.karinarobledo.me/anos
```

## Words meaning different things in different countries

There's a lot of countries that speak Spanish, but even we speak the same language, we have differences in our language. One word could be a bad word in one country and a common word in other. One example is "Tortillera", in Spain means lesbian, while in Mexico means a person who makes tortillas. Just be careful.

Well, this it's the end. I hope it helps you to understand the differences in another language. In the past, I had to make changes in an enormous file, but now there's more support for configuration in other languages. As a developer, I'm thankful.
Is there an art to naming projects?
Tags: discuss, projects
Published: 2019-07-31 02:47:05

---
title: Is there an art to naming projects?
published: true
description: 
tags: discuss, projects
---

My first bootcamp project is due in a few weeks which has me thinking about what I should name my project.

How do you decide on a name for a project?

Previously, I've used whatever comes to mind or makes it clear that the project belongs to a specific lesson. I also feel like once you name something and put it on Github, you are stuck with it forever (or risk a dead URL).
Just finished the Python tutorial on Kaggle
Tags: python, learning, kaggle
Published: 2019-07-31 02:28:10

Kaggle has an amazing set of courses with well organised content over here: https://www.kaggle.com/learn/overview

I just finished the Python micro-course (https://www.kaggle.com/learn/python), and I wanted to tell folks that it's worth your time! I've done some Rails programming before, but majority of my recent work was in JS (and PHP before that), so I needed a quick intro.

I tried learning Python a couple times via the Python website, but it just wasn't as ergonomic as this free Kaggle course. It can be literally completed in 4-5 hours, has lots of humour peppered in which kept it really entertaining, and Python is a rather nice language :-D
Primary Debate Analysis Quickstart
Tags: discuss, python, beginners
Published: 2019-07-31 02:21:10

EDIT: After both nights of the debate concluded I did a more thorough write up. I'd encourage you to check that out.

{% link https://dev.to/charlesdlandau/visualizing-the-primary-debates-4ff6 %}

If you're watching the debate tonight and thought "how can I analyze the transcript data from this?" Here's some starter code to parse the transcript simply and easily.

```python
import pandas as pd
import sklearn as sk
import requests
import bs4

# http request
r = requests.get('https://www.washingtonpost.com/politics/'
    '2019/07/31/transcript-first-night-second-democratic-debate')
r.status_code

# Parse html
soup = bs4.BeautifulSoup(r.content)
graphs = soup.find_all('p')
utterances = [x.get_text() for x in graphs if 'data-elm-loc' in x.attrs.keys()]

# Parse utterances
utterances = utterances [2:]
seq = 0
data = []
for i in utterances:
    graph = i.split()
    if graph[0][-1] == ':':
        text = ' '.join(graph[1:])
        num_words = len(graph) - 1
        name = graph[0][:-1]
        seq += 1
    elif len(graph) > 1 and graph[1] == '(?):':
        # Cases like 'WARREN (?):'
        text = ' '.join(graph[2:])
        num_words = len(graph) - 2
        name = graph[0]
        seq += 1
    else:
        text = ' '.join(graph)

    data.append({"name": name,
      "graph": text,
      "seq": seq,
      "num_words": num_words})

df = pd.DataFrame(data)

# "Unknown", O'Rourke parsing errors
df = df[df.name != "(UNKNOWN)"]
df['name'] = df['name'].apply(lambda x: ''.join([char for char in x if char.isalpha()]))

# Example...
df.groupby('name').sum()['num_words'].plot(kind='bar')
```

![](https://thepracticaldev.s3.amazonaws.com/i/8lxx12ytavzepyn3h2m3.png)

(Image taken mid-debate, those are not final numbers)

![](https://thepracticaldev.s3.amazonaws.com/i/9lv9cehjbpfnghhy4b6p.png)

(Cleaned, post-debate numbers)

You can quickly get started with this code and more in an interactive notebook on Kaggle:

https://www.kaggle.com/charleslandau/democratic-debate-analysis-quickstart
Would you build social images with code?
Tags: discuss, product, html, css
Published: 2019-07-31 02:03:36

---
title: Would you build social images with code?
published: true 
description: Use HTML and CSS to build reusable and reusable and social images. 
tags: discuss, product, html, css
---


Really simple question. If I build an interface allowing for the sharing and creation of themes for social images, would you use it?

Imaging coding social twitter images, or dev.to banners in HTML and CSS and sharing that theme with others. Then being able to reuse it easily to create other social images. 

Interested? 

This is inspired by the work I did here [khrome.dev of image generator](https://khrome.dev/image)

If people are interested, I will put a signup page up and start building it this weekend. 

What features would you need to use this?
Como limpar o cache de DNS no Windows, Mac, Ubuntu e Chrome?
Tags: self, tech, cache, chrome
Published: 2019-07-31 03:41:31

---
title: Como limpar o cache de DNS no Windows, Mac, Ubuntu e Chrome?
published: true
tags: Self,Tech,cache,chrome
canonical_url: https://marquesfernandes.com/2019/07/30/como-limpar-o-cache-de-dns-no-windows-mac-ubuntu-e-chrome/
---

## O que é DNS?

DNS, do inglês Domain Name System (Sistema de Nomes de Domínios), atua como um tradutor de endereços de IP (192.168.0.1) para domínios ([marquesfernandes.com](https://marquesfernandes.com)), como uma espécie de agência dos correios que consegue transformar um CEP (IP) em uma rua (domínio).

## O que é cache de DNS?

Como o histórico de navegação, imagens e outros arquivos são salvos pelo seu navegador para melhorar a velocidade de navegação, o computador também armazena as localizações (endereços de IP) dos sites que você visitou assim ele evita ter de buscar toda vez qual IP ele deve acessar quando você entra em um site economizado o tempo de resposta e carregamento. Isto é o famoso cache de DNS, então se a referência de IP em um domínio é mudada no servidor de DNS, pode ser que você ainda esteja tentando acessar uma informação desatualizada.

## Como limpar?

Antes de mostrar algumas maneiras de limpar o cache de DNS do seu computador vale lembrar que dependendo da onde você está conectado podem haver outras camadas de cache na rede, muito comum em empresas que utilizam um sistema de proxy e o qual provavelmente você não tem acesso. Nessa situação você infelizmente vai precisar esperar o cache de DNS se renovar sozinho ☹.

### Windows

- Pressione Win + X para abrir o Menu
- Clique no botão direito do mouse em Comand Prompt e selecione Run as Administrator (Executar como Administrador).
- Digite o seguinte comando e pressione enter:

```
ipconfig /flushdns
```

Se o comando for efetuado com sucesso, você verá a seguinte mensagem:  
_Windows IP configuration successfully flushed the DNS Resolver Cache (A configuração IP do Windows limpou com sucesso o Cache de Resolução de DNS)._

### **MacOS**

1. Clique em Aplicativos
2. Clique em Serviços
3. Clique duplo no aplicativo Terminal
4. Digite o seguinte comando:

```
sudo killall -HUP mDNSResponder
```

### Ubuntu e distribuições Debian

1. Abra o terminal (normalmente o atalho é Ctrl+Alt+T)
2. Execute o seguinte comando:

```
sudo /etc/init.d/networking restart
```

Insira a senha root e aguarde a seguinte resposta: _[ok] Restarting networking (via systemctl): networking.service_

### Google Chrome

Abra o navegador Google Chrome, digite  **chrome://net-internals/#dns**  na barra de navegação e pressione o botão  **Clear host cache** :

![](https://marquesfernandes.com/wp-content/uploads/2019/07/image.png)

O post [Como limpar o cache de DNS no Windows, Mac, Ubuntu e Chrome?](https://marquesfernandes.com/2019/07/30/como-limpar-o-cache-de-dns-no-windows-mac-ubuntu-e-chrome/) apareceu primeiro em [Henrique Marques Fernandes](https://marquesfernandes.com).
background-size を使って画像を適切な枠に収めるのは object-fit を使ったらとても簡単だった
Tags: css
Published: 2019-07-31 00:08:56

CSS のプロパティに `object-fit` というのがあるのは知っていたけど便利だと思ったので調べてみた。

アイテムが複数カラムで一覧上にレイアウトされている場合、画像サイズの違いから段違いにならないようにするために画像が表示されている部分の枠のサイズを固定していることが多いと思う。
固定した枠に対して画像をアスペクト比を保ったまま、枠サイズに隙間が出ないようにしたり、隙間が出ても画像の切り捨て部分がないように伸縮させて表示させたりする。

## background-size を使った方法

今までは以下のようなマークアップで表示させていた。`img` 要素で一般的に表示する方法だと、JavaScript で画像ダウンロードしたものを枠に対してサイズ調整をしてはめていかなければいけません。

```
<ul class="items">
  <li class="item">
    <a>
      <img
        class="item__img"
        src="<base64エンコードした1pxの透明なダミー画像>"
        style="background-image: url(<画像URL>);" />
    </a>
  </li>
</ul>
```

```
.item__img {
  background-position: center center;
  background-repeat: no-repeat;
  background-size: contain;
  height: 200px;
  width: 200px;
}
```

このように、HTML では `img` 要素の `src` 属性にbase64エンコードした1pxの透明なダミー画像で表示させて、`style` 属性で `background-image` を指定する。次に CSS で `background-size: contain;` を指定することで、img 要素で指定した背景画像に対してサイズの伸縮をさせているので、手数としては多すぎる。

## object-fit を使った方法

`object-fit` を使う場合は、もっと簡単になる。

```
<ul class="items">
  <li class="item">
    <a>
      <img
        class="item__img"
        src="<画像URL>" />
    </a>
  </li>
</ul>
```

```
.item__img {
  height: 200px;
  object-fit: contain;
  width: 200px;
}
```

img 要素の CSS のクラスで `object-fit: contain;` と宣言すればいい。
このような宣言を書くことで、img 要素の中身(この場合は画像)がどのように枠に対して伸縮されて表示されるかを指定することができる。

## まとめ

すごく便利なプロパティだが、Internet Explorerは使えないので、採用する場合はターゲットブラウザを確認する必要がある。

また、今回用いたコードは[Github](https://github.com/tokuda109/playground/tree/master/object-fit)で公開している。

## 参照

* [object-fit](https://developer.mozilla.org/ja/docs/Web/CSS/object-fit)
I'm building a thoughtful Twitter assistant!
Tags: showdev, twitter, entrepreneur, indiedev
Published: 2019-07-31 00:08:04

---
title: I'm building a thoughtful Twitter assistant!
published: true
description: I'm building a twitter assistant that generates tweets for you based on your content, without making you look like a bot!
tags: #showdev #twitter #entrepreneur #indiedev
cover_image: https://i.imgur.com/qjBHNLI.png
---

A couple of months ago, I started experimenting with the Twitter API. My idea was to build a bot to share some digital art I created on my redbubble account by publishing a tweet once or twice a day with a random design and caption.

Once I got it working I thought "maybe more people could benefit from this 🤔" so I started working with [@maurogarcia_19](https://dev.to/maurogarcia_19) to scale the idea so it will be useful to anyone who wants to share links on Twitter regularly.

Our main concern was that we didn't want to create a "spam generator", so we built the idea around the concept of **sharing thoughtfully**. 

That's how Cephhi 🐙 came to be. 

## What is Cephhi?
Cephhi is a personal Twitter assistant. You feed him links, ideas and hashtags and he creates tweets regularly without repeating for as long as he can.

Check this video to see Cephhi in action:

{% youtube 3eIXCQpVnfo %}

## How's Cephhi *thoughtful*?
As I said before, for us this was the key for this project. We don't want cephhi to be a simple "bot"🤖 or a "scheduler". So these are the ideas we're working on to prevent that:

- The amount of tweets per day is limited to a maximum of 4.
- The amount of hashtags per tweet is also limited.
- It'll give you tips on how to keep an authentic image online.

>We're working really hard to make Cephhi a tool that encourages a **responsible social media usage** when sharing our content. We want to help content creators promote their work without replacing the **human factor** that, we believe, is crucial to stablish a healthy relationship with any audience.

## Project status
We launched the landing page a few weeks ago as a mean to communicate and validate the whole idea: [cephhi.com](https://cephhi.com)

Right now we're working on an MVP that will be available *for free* soon 😁.

***

## Thanks for reading!
If you want to know more about this project check the website and subscribe so we can let you know when its available: [cephhi.com](https://cephhi.com)

**We'd really appreciate any feedback, questions or comments** 😊
How trait with lifetime can be a trouble and how to fix it
Tags: rust
Published: 2019-08-01 05:47:26

---
title: How trait with lifetime can be a trouble and how to fix it
published: true
tags: rust
canonical_url: https://dannypsnl.github.io//rust/2019/07/31/how-lifetime-trait-can-be-trouble-and-how-to-fix-it.html
---

In my case, I have a trait called `Resource` for deserialize from bytes. Now I want to reuse a struct called `List` for others `Resource` so I write done:

```rust
struct List<T> {
    // ignore others field
    items: Vec<T>,
}

impl<T: Resource> Resource for List<T> {
    fn from_str(s: &str) -> Result<List<T>> {
        let list: List<T> = serde_json::from_str(s)?;
        Ok(list);
    }
}
```

Because `serde_json::from_str` requires `impl Deserialize` so we have to modify the code:

```rust
impl<T: Resource + Deserialize> Resource for List<T> {
    fn from_str(s: &str) -> Result<List<T>> {
        let list: List<T> = serde_json::from_str(s)?;
        Ok(list);
    }
}
```

It looks work but not. The problem is `Deserialize` actucally is `Deserialize<'de>`, when we use trait in declaration we have to satisfy all type parameters of course includes lifetime. Ok, so we write:

```rust
impl<'a, T: Resource + Deserialize<'a>> Resource for List<T> {
    fn from_str(s: &'a str) -> Result<List<T>> {
        let list: List<T> = serde_json::from_str(s)?;
        Ok(list);
    }
}
```

It looks good and works for most cases actually, however, in my code I hiding the whole get data and deserialize in a function, whatever it’s, would cause problem.

```rust
fn get_list_via_fetching_data<'a, T: Deserialize<'a>>() -> Result<List<T>> {
    let data = fetch(); // in my case is kubernetes api server but that's fine
    List::<T>::from_str(data)
}
```

Ok, you would find `data` is not live long enough for `'a`, why? Since anyway `'a` would be a outside lifetime and of course live longer than anything in the function. What can we do for this case? We have to reverse the relationship between others `Resource` and `List`, rather than see `List` as kind of `Resource`, we add a function `fn from_str_to_list(s: &str) -> Result<List<Self>>;` for trait `Resource`. Since in my case `Resource` impl `Sized` and `List` also has a detected size after applying a `Sized T` so `List<Self>` is `Sized`. Now we can have the function `get_list_via_fetching_data`.

Of course, for the most normal case I think we don’t need this one, and if at future `'_` lifetime introduced the problem could be resolved(but I’m not sure that is for this problem actually so just a guess).

Thanks for reading and see you next time.