teleren/devto huggingface dataset:
PowerShell Core | Terminal-Icons + Nerd Fonts
Tags: customization, powershell, centos7, terminal
Published: 2019-11-17 17:26:01

---
title: PowerShell Core | Terminal-Icons + Nerd Fonts
published: true
date: 2019-06-22 03:32:30 UTC
tags: customization,powershell,centos7,terminal
canonical_url: 
---

Tips | Customizando o seu terminal PS

![](https://cdn-images-1.medium.com/max/1024/1*GvMef2yMZWhHMXOFOjyiQg.jpeg)

E ae, pessoal, beleza? Falando hoje sobre um pacote bem legal desenvolvido por [Brandon Olin](https://twitter.com/devblackops). O Terminal-Icons proporciona uma interface amigável que no terminal não é padrão deste tipo de aplicação.

Esse projeto é bem legal pra dar um pouco mais de visibilidade para os arquivos quando estamos no modo terminal, ele utiliza o projeto [NERD FONTS](https://github.com/ryanoasis/nerd-fonts#glyph-sets).

No link abaixo temos um passo a passo para que a fonte seja reconhecida e funcione no nosso terminal.

{% gist https://gist.github.com/markwragg/6301bfcd56ce86c3de2bd7e2f09a8839 %}

![](https://cdn-images-1.medium.com/max/950/1*rcLq0ZG4BHeM79S65hjm2A.png)

![](https://cdn-images-1.medium.com/max/958/1*DhSmN8r1zLlNK0kZXYVztw.png)<figcaption>Ajuste da fonte, botão direito na barra</figcaption>

Obs: se você utiliza o terminal integrado do Visual Studio code a fonte não é reconhecida infelizmente 😫, porém abrindo o terminal é sucesso 😍 tudo funciona perfeitamente utilizando a fonte correta 😄.

Para teste criei alguns arquivos vazios, segue abaixo o script que utilizei para criar a massa de arquivos:

{% gist https://gist.github.com/EwertonJordao/0393aadf0b1f4ce614737c8c9705de8c %}

➕ Demo CentOS:

Fiz o download da mesma fonte [LiberationMono](https://github.com/ryanoasis/nerd-fonts/releases/download/v2.0.0/LiberationMono.zip) após a instalação alterei no meu terminal para utiliza-la e a mágica acontece 🎉.

![](https://cdn-images-1.medium.com/max/1024/1*hSMlE1Wh0WRC0H18ndY4-A.png)<figcaption>Exemplo CentOS</figcaption>

É isso pessoal, não se esqueça, PS é vida ❤️
Learn Database Administration - PostgreSQL Database Administration (DBA) for Beginners
Tags: sql, beginners, tutorial, webdev
Published: 2019-06-22 03:15:23

In this video, we will go over the basics of the PostgreSQL. We will cover topics ranging from installations, to writing basic queries and retrieving data from tables. We will also explore the logic of joining tables to retrieve data and much more.

The course also covers the basics of creating tables, storing data with data types, and working with expressions,  operators, and strings.

Topics also includes:
    Installing PostgreSQL
    Loading sample database
    Creating database and tables
    Performing CRUD operations
    Joining Tables
    Using aggregate and analytic functions
    Creating views and triggers

What you’ll learn
    Install PostgreSQL Server
    Load sample database
    Create a database
    Create a table
    Insert data into tables
    Update existing records inside a table
    Delete Records in a table
    Remove duplicate records
    Query data from a table
    Create a subquery
    Get data from multiple tables
    Create and manage roles
    Create a view
    Create tablespace
    Backup and restore database
    Filter and sort data
    Use various operators
    Use aggregate and analytic functions
    Create triggers

{% youtube aUfPf-clLLs %}

**Thanks for reading** ❤
If you liked this post, share it with all of your programming buddies!
Follow us on **[Facebook]( https://www.facebook.com/moriohdotcom)** | **[Twitter]( https://twitter.com/moriohdotcom)**
Using React with Stimulus JS
Tags: react, webdev, typescript
Published: 2019-06-22 02:48:49



I have written a few articles about how much I like Server Side Rendering (SSR) and using [Stimulusjs](https://stimulusjs.org/).

But sometimes you need the power of React to help you. How can we include React when we need it without weighing down our website when we don't?

It's actually not too tough with built in code splitting in Webpack or parceljs. So let's go throught the basics.

### Our Stimulus Controller

```javascript
import {Controller} from "stimulus";

export default class extends Controller {
	//Load the React code when we initialize
	initialize(){
		this.reactComponentPromise = import("./reactComponent");
	}
	connect(){
		this.reactComponent = await this.reactComponentPromise;
		
		const reactRoot = this.targets.find("reactRoot");
		const props = {
			onChange: this.onChange.bind(this)
		}
		this.reactComponent.render(reactRoot, props);
		
	}
	onChange(){
		//Some sort of thing to do with the changes.
		//Hit the API?
		//IDK you decide
	}
	disconnect(){
		const reactRoot = this.targets.find("reactRoot");
		
		this.reactComponent.destroy(reactRoot);
	}
}
```

It's pretty simple. But now we can load a react component and enjoy code splitting to not weigh down our app!

What does this look like on the React Side?

### The React Code


```javascript
	import ReactDOM from "react-dom";
	
	import Something from "./Something";
	
	function render(node, props){
		ReactDOM.render(node, <Something {...props} />		
	}
	
	function destroy(node){
		ReactDOM.unmountComponentAtNode(node);
	}

	export {
		render,
		destroy
	}
```

This is really all there is to it.

Keep in mind as well that React is pretty smart. You can call `render` with new props from your Stimulus controller and it won't break anything.

### The HTML

Finally the html to put it together. It's nothing major

```html
<div data-controller="react-controller">
	<div data-target="react-controller.reactRoot"></div>
</div>
```

## Conclusion

There is a great case for mixing technologies in your applications using the right too where you need it.

You can easily mix React where you need to do some heavy lifting and still keep your app mostly SSR for the rest of your pages with Stimulus.

If you have any questions let me know!
Save Pandas objects to HDF5
Tags: python, gsoc, tardis
Published: 2019-06-22 01:16:02

## What is HDF5?

HDF stands for **"Hierarchical Data Format"** and it was designed to store enormous amounts of data. Originally was developed at the *National Center for Supercomputing Applications* and now it's supported by *The HDF Group*, a non-profit corporation.

## Why use HDF5?

- At its core HDF5 is binary file type specification.

- It has the  ability  to  **store many  datasets**, user-defined  **metadata**,  optimized  I/O,  and the ability to query its contents.

- Many programming languages have tools to work with HDF.

- HDF allows datasets to live in a nested tree structure. **In effect, HDF5 is a file system within a file.** The 'folders' inside this filesystems are called *groups*, and sometimes *nodes* or *keys* (or at least these terms are used indistinctively).

## Toolbox
There are at least three Python packages which can handle HDF5 files: `h5py`, `pytables`,  and `pandas`.

Also, there are a few tools to visualize them: **HDFViewer** (Java), **HDFCompass** (Python) and **ViTables** (Python). They can be found at the Ubuntu repositories, but often they don't work as expected. 

Fortunately, **ViTables** is available in the `conda-forge` package channel and works flawlessly.


## Example #1: Dump a DataFrame

```python
import pandas as pd

# Create an example DataFrame
data = {'A': [1,2,3], 'B': [4,5,6]}
df = pd.DataFrame.from_records(data)

with pd.HDFStore('test.h5', mode='w') as f:
    f.put(key='/new_dataset', df)
```

## Example #2: Write metadata

Maybe one of the most interesting aspects of HDF is the ability to store metadata*.

```python
meta = { 'date': '21/06/2019', 'author': 'epassaro'}

with pd.HDFStore('test.h5', mode='a') as f:
    f.get_storer('/new_dataset').attrs.metadata = meta
```

\* the good old FITS format can do this as well!

## Example #3: Write metadata to root ("/")

```python
meta = { 'date': '21/06/2019', 'author': 'epassaro'}

with pd.HDFStore('test.h5', mode='a') as f:
    f.root._v_attrs['author'] = 'epassaro' 
```
Books about computing
Tags: interview, computerscience, books, architecture
Published: 2019-07-18 02:12:40

- [Code](https://www.amazon.com/Code-Language-Computer-Developer-Practices-ebook/dp/B00JDMPOK2/ref=sr_1_2?keywords=code&qid=1561161802&s=books&sr=1-2) explains how telegraphs evolved into computers
- [The System Design Primer](https://github.com/donnemartin/system-design-primer) explains design patterns for composing a single application out of a network of machines operating in different capacities
- [The Design of the Unix Operating System](https://www.amazon.com/Design-UNIX-Operating-System/dp/0132017997/ref=sr_1_1?keywords=the+design+of+the+linux+operating+system&qid=1561161824&s=books&sr=1-1) explains how Unix provides software an interface to hardware
- [Introduction to Networking](https://www.amazon.com/Introduction-Networking-How-Internet-Works-ebook/dp/B00YD7M92S/ref=sr_1_3?crid=W6HCN4KHWVC&keywords=introduction+to+networking&qid=1561161870&s=books&sprefix=introduction+to+networking%2Cstripbooks%2C191&sr=1-3) explains how data is encoded and sent over the internet
- [Cracking the Coding Interview](https://www.amazon.com/Cracking-Coding-Interview-Programming-Questions/dp/0984782850/ref=sr_1_3?crid=1BPMZ8RWH3S70&keywords=cracking+the+coding+interview&qid=1561161894&s=books&sprefix=cracking+the+coding+interview%2Cstripbooks%2C160&sr=1-3) explains the data structures that are the building blocks for algorithms
- [Mastering Bitcoin](https://www.amazon.com/Mastering-Bitcoin-Programming-Open-Blockchain/dp/1491954388/ref=sr_1_1_sspa?keywords=mastering+bitcoin&qid=1561161993&s=gateway&sr=8-1-spons&psc=1) explains how a publicly powered peer to peer network can use a protocol to consistently and reliably reach consensus
- [Silence on the Wire](https://www.amazon.com/Silence-Wire-Passive-Reconnaissance-Indirect-ebook/dp/B008FRNHVY/ref=sr_1_1?crid=2AQUB3YLRTCK8&keywords=silence+on+the+wire&qid=1561162014&s=gateway&sprefix=silence+on+the+wire%2Caps%2C172&sr=8-1) explains how widely used tools, libraries, and hardware components are vulnerable to exploitation
Rebase Master
Tags: git, vsc, rebase, master
Published: 2019-10-16 13:56:26

---
title: Rebase Master
published: true
tags: git, vsc, rebase, master
canonical_url: https://tech.serhatteker.com/post/2019-06/rebase-master/
---

## Rebase
While you've been working on something, probably you've been working on a branch on-and-off, or lots has happened in other branches.

The best solution would be to rebase your branch onto master. This keeps the history tidy and makes things a lot easier to follow.

Update your feature branch from master:

1. Switch the `master` branch

  ```
  $ git checkout master
  ```

2. Get `remote` updates:

  ```
  $ git pull
  ```

3. Switch back to your `local` branch:

  ```
  $ git checkout local_branch
  ```

4. Make the `rebase` magic:

  ```
  $ git rebase master
  ```


5. Push your `local` branch to  `remote`:

  ```
  $ git push
  ```

  `--force` flag will be needed if you've already pushed your branch.

  ```
  $ git push --force
  ```
  __\**Warning** :__ Think and check twice before doing this.



### comparing branches
If you want to compare your `local` and `remote` feature branch before "forced push":

```
$ git diff <master_branch_path> <remote_branch_path>
```

For example:

```
$ git diff feature origin/feature
```

Where `feature` is your `local` branch and `origin/master` is your `remote` branch.


### Git - Your branch and 'origin/xxx' have diverged
If you receive below error:

```
Your branch and 'origin/xxx' have diverged,
and have 1 and 1 different commit(s) each, respectively.
```

It is normal. This happens if you rebase the branch which was previously pushed to the `origin` repository. Rebase rewrites history, so after it you'll have different `local` and `remote` state.

We had a history like this:

```
... o ---- o ---- A ---- B  master, origin/master
                   \
                    C  branch_xxx, origin/branch_xxx
```

And we "rewrote" the history like this:


```
... o ---- o ---- A ---------------------- B  master, origin/master
                   \                        \
                    C  origin/branch_xxx     C` branch_xxx
```

The solution:

```
$ git push origin branch_xxx --force
```

So the actual state will be like:

```
... o ---- o ---- A ---- B  master, origin/master
                          \
                           C` branch_xxx, origin/branch_xxx
```

As said before:

__\**Warning** :__ Think and check twice before doing this.

------
For more details:

[git-scm — Git Branching - Rebasing](https://git-scm.com/book/en/v2/Git-Branching-Rebasing)
👷 Higher type safety for TypeScript
Tags: typescript, type, tools, typesafe
Published: 2019-06-21 23:23:20

<p align="center">
  <a href="https://github.com/pirix-gh/ts-toolbelt">
    <img alt="logo" title="ts-toolbelt" src="https://raw.githubusercontent.com/pirix-gh/ts-toolbelt/master/.github/logo.png" width="300">
</a>

## 💣 The problem

Have you ever found yourself needing to change an external type from another library, or just needing specific fields to become optional?

**Or maybe you just wanted to update a type, but deeply?**

**Or even just simply concat to tuples together into one?**


A week ago, this was not possible... Until today.


## 🤔 But how?

What if I told you that most of the pain of TypeScript could be put away forever?
So that you can focus on what matters now, not working around TS' limitations??

![](https://thepracticaldev.s3.amazonaws.com/i/z3m07qv7ivfmkmmaaomt.gif)

These are just a few examples for the most common type manipulations. 


## 🍩 So what is it?

I am proud to annouce [**ts-toolbelt**](https://github.com/pirix-gh/ts-toolbelt). A **100% tested** type library that makes coding with TypeScript even **safer**. But not only, it will also make your software more **robust** and more **flexible**.

![](https://thepracticaldev.s3.amazonaws.com/i/gaboujxqehb5k234x3zy.gif)

It uses the type system itself for TypeScript to **compute** more complex types. In other words, its API exposes types that trade **CPU & RAM** for higher type safety.

**ts-toolbelt** completes TypeScript with a collection of more than **150** tested types. It's goal is to improve type correctness while adding a whole new set of **features** to TS. 


## 🥅 Goals
* This package aims to be the home of all **utility types**
* Keep reasonable **performance**, so it will not bloat TS
* Computed types are always **readable**, like if you typed it
* Software that's more type-safe, **flexible** & more **robust**
* Bring a whole new set of extra **features** to TypeScript
* Types can be combined together to create even more types!


## 🏁 Getting Started

#### Prerequisites

```sh
npm install typescript@^3.5.0 --save
```

#### Installation

```sh
npm install ts-toolbelt --save
```

#### Hello World

```ts
import {Object} from 'ts-toolbelt'

// Merge two `object` together
type merge = Object.Merge<{name: string}, {age?: number}>
```

The project is huge but very well documented with a website (and a search bar). So if you're ready to be type-safe, [**here's my repository**](https://github.com/pirix-gh/ts-toolbelt).


This is my first open-source project, your comments are more than welcome 😉
Android dev.to app always offline
Tags: meta, discuss
Published: 2019-06-21 23:08:11

Is anyone else having issues with the dev.to Android app?

I run the Android Betas and for the last I think 2ish days the dev.to Android app hasn't been working to me. It consistently has said that I'm offline and shows me the (awesome) offline drawing page

I can access dev via my browser, but the app hasn't been working.

Anyone else seeing this?

Is there anything I can share to help any debugging efforts?
My IndieWeb timeline
Tags: indieweb
Published: 2019-10-04 20:54:54

---
title: My IndieWeb timeline
published: true
date: 2019-06-21 22:47:57 UTC
tags: #indieweb
canonical_url: https://social.johanbove.info/2019/06/22/my-indieweb-timeline
---

Going to list up how I got to join the [#indieweb](https://social.johanbove.info/tag/indieweb) - pecha kucha style\* - ish... - presentation to follow 🤞

- 2017 - Got fed up with ad-revenue supported social media silos being commercially exploited and digitally tracked and followed.
- 2017 / 2018 - Tested Mastodon, but getting overwhelmed by an overload of uninteresting posts and I couldn't decide which Mastodon instance to join. Also had some concerns over how the open-source project is managed. And setting up an own instance required a more expensive web host service and the setup is something I couldn't do on my, otherwise excellent, web host company Antagonist. ([https://<wbr></wbr>www.antagonist.nl](https://www.antagonist.nl))
- 2018 / 2019 - Finding out about SOLID by thé Tim Berner's Lee - got involved (a little) by looking at the current source-code for the SOLID (beta) user interface and tried to fix a bug. Contributed to testing and writing some docs together with Melvin. Was a tough cookie to swallow because of lots of old code and a funky user-interface which has a bit of a learning curve. Tried my best to wrap my head around RDF and Linked-Data. Was a bit set back by academic talk on how Solid is going forward. Impressed by all the cool JavaScript demos and got to know some amazingly smart and clever people. (Melvin, Ruben, Lieven, ...) Plus the project has an important source in my birthplace Ghent, Belgium. But I am currently not following up the project so much any more... Mostly because I cannot run Node.JS servers on my web host.
- 2019 - Found out about the IndieWeb movement in a podcast by Mozilla and decided to start using Known. Impressed by Tantek and Aaron's work. Got a lot of welcome help by Greg and other Indieweb "gurus". Was happy to see that Known was running nicely on Apache2 with PHP and MySQL, but it was a little concerning to see that Ben and the Idno project went through really tough times. Luckily Marcus is doing an excellent job in keeping the open-source Known project alive-and-kicking.

Learning about webmention, microsub and micropub and getting to try out all Aaron's and other talented developer's apps, gave me hope and motivation that this could be how the - personal - Web should continue to evolve into.

 

The Indieweb principles rock! [https://<wbr></wbr>indieweb.org/<wbr></wbr>principles](https://indieweb.org/principles)

 

\* [https://<wbr></wbr>en.wikipedia.org/<wbr></wbr>wiki/<wbr></wbr>PechaKucha](https://en.wikipedia.org/wiki/PechaKucha)
Pushing Left, Like a Boss — Part 5.5 — File Uploads
Tags: programming, tutorial, beginners, security
Published: 2019-06-21 22:47:32

---
title: Pushing Left, Like a Boss — Part 5.5 — File Uploads
published: true
description: The 5th section of this series details various examples of secure coding.
series: Pushing Left Like a Boss
tags: programming, tutorial, beginners, security
---

###[This series, and my blog, have moved!](https://wehackpurple.com/pushing-left-like-a-boss-part-5-5-file-uploads/)


Allowing files to be uploaded to your applications (and therefore your network) is risky business. In fact, it just may be the [riskiest functionality](https://www.owasp.org/index.php/Unrestricted_File_Upload) that you can add to a web application.

If you decide to include file uploads in your applications, you should:

1. Scan all uploaded files with an application to analyze the files for malicious characteristics such [AssemblyLine](https://www.cse-cst.gc.ca/en/assemblyline) (free from the Canadian Government, which can be installed locally so you do not need to share your files with a 3rd party), [Cylance](https://www.cylance.com/en-us/index.html), [FireEye](https://www.fireeye.com/) or [Virus Total](https://www.virustotal.com/).
2. Follow the advice in the [OWASP File Uploads cheat sheet](https://www.owasp.org/index.php/Input_Validation_Cheat_Sheet#File_Upload_Validation).
3. Watch [Episode #14 of the OWASP DevSlop](https://www.youtube.com/watch?v=p8tQ9v7ddkg&t=1s) show with [Dominique Righetto](https://twitter.com/righettod) to see code and more on how to implement these safeguards. This episode is in French with English Subtitles (most episodes are recorded in English). While you are at it, why not [subscribe to our YouTube channel](https://aka.ms/DevSlopshow)? If you like this blog, you are likely to also enjoy the show.

![Start Security Earlier! SecTor 2018](https://thepracticaldev.s3.amazonaws.com/i/cu5kl4e2o7z09xuw3bbx.jpeg "Start Security Earlier! SecTor 2018")
######Start Security Earlier! SecTor 2018

Here are some points to take home, as summarized from the [OWASP File Uploads Cheat Sheet](https://www.owasp.org/index.php/Input_Validation_Cheat_Sheet#File_Upload_Validation), written by [Dave Wichers](https://twitter.com/wichers):
· Ensure the application is...

###[Read the rest of this article on my NEW blog!](https://wehackpurple.com/pushing-left-like-a-boss-part-5-5-file-uploads/)
Dumb Computer Messes Up Simple Sandwich
Tags: girlswhocode, computerscience, computercoding, teachingisfun
Published: 2019-06-21 22:42:48

---
title: Dumb Computer Messes Up Simple Sandwich
published: true
description: A Computer making a messy PBJ Sandwich
tags: GirlsWhoCode, computerscience, computercoding, teachingisfun
---

This morning I played role of deaf, dumb and blind (2 are already true - 1 is debatable by some 😉) by taking the role of a computer in making a PBJ sandwich as part of a video talking about one of the things we do w/ Girls Who Code. Here's part of the video - things got a bit messy. 🤪🤪
How should we "fix" recruiting?  
Tags: discuss
Published: 2019-06-21 22:20:02

Do you think the tech community needs a new recruiting or staffing model? There seems to be a large amount of agreement that recruiting, interviewing, and staffing in tech is "broken" (with many more development jobs than people), but there aren't many "fixes".  One concept is to put developers first with some sort of company (startup?) that solves common recruiting issues like making commissions/hourly rates transparent, offering to replace code exercises or technical interview "whiteboarding" with vetted personal web sites, and actually having recruiters that have technical knowledge (enough to Google acronyms, at least!)

Anyone have other ideas?  How does this sound?