teleren/devto huggingface dataset:
On Glitch This Week
Tags: glitch, glitchthisweek, showdev
Published: 2019-04-18 13:18:49

---
title: On Glitch This Week
published: true
canonical_url: https://glitch.com/@glitch/glitch-this-week-april-17-2019
series: Glitch This Week
cover_image: https://cdn.glitch.com/02863ac1-a499-4a41-ac9c-41792950000f%2FdevToTWoGBanner.png?1555591590875
description: Just a few projects that caught our eye this week on Glitch (April 17, 2019).
tags: glitch,glitchthisweek,showdev
---

Hey everyone, this is the first post in what will become a regular "Glitch This Week" series, in which we round-up just some of the amazing projects that fantastic creators have made on [Glitch](https://glitch.com/) this week.

## [Chaos Equations](https://glitch.com/~chaos-equations)

Inspired by a [math art video on YouTube](https://www.youtube.com/watch?v=fDSIRXmnVvk&vl=en), design technologist [Jered Danielson](https://glitch.com/@jereddanielson) created "[chaos-equations](https://glitch.com/~chaos-equations)". It's a real-time visualization and animation of dynamic chaos equations. While the GUI is built with React, the visualizations are hardware accelerated and rendered with WebGL via [Three.js](https://threejs.org/).

{% glitch chaos-equations app %}


## [SponCron](https://glitch.com/~sponcron)

Writing [Cron](https://en.wikipedia.org/wiki/Cron) expressions can be a little bit tricky. The right order of values to get the timing I want is always something I have to look up. But "[sponcron](https://glitch.com/~sponcron)" by [Anna Bialas](https://glitch.com/@annabialas) and [Thang](https://glitch.com/@nguyent) might change that. It spontaneously generates a cron expression along with its human-readable form, so you can see and learn from the results different values create.

{% glitch sponcron app %}


## [Play Board Template](https://glitch.com/~playboard-template)
Lastly, [Emily Withrow](https://glitch.com/@emilywithrow) and [John Keefe](https://glitch.com/@jkeefe) from the Quartz Bot Studio created "[playboard-template](https://glitch.com/~playboard-template)". It helps facilitate user testing for interactive audio experiences and accompanies a blog post they wrote about [rapid prototyping for voice apps](https://bots.qz.com/986/relatively-rapid-prototyping-for-voice/) like those used on Alexa and Google Home devices. With it, you can design voice conversations and flows before getting mired in technical implementation challenges.

{% glitch playboard-template app %}

I hope these apps will help you with your own code projects. Check out the other featured projects in [this week's round-up on Glitch](https://glitch.com/@glitch/glitch-this-week-april-17-2019).
Remote work for junior devs
Tags: webdev, career, remotework, junior
Published: 2019-04-18 13:10:43

---
title: Remote work for junior devs
published: true
description: 
tags: webdev, career, remotework, junior
---

Hi! Long time lurker but this is my first post. I was wondering if remote jobs offer good growth and learning opportunities for new developers who have just entered the market. Can mentoring happen in those situations? 

Please share your experiences or knowledge!
GraphQL library for Python - Strawberry
Tags: webdev, beginners, python
Published: 2019-04-18 12:49:01

---
title: GraphQL library for Python - Strawberry
published: true
description: 
tags: webdev, beginners, python,
---

I recently came across an interesting library for GraphQL. Strawberry is a new GraphQL library for Python 3, inspired by dataclasses. An initial version of Strawberry has been released on GitHub. To follow the project, you can sign up to get updates on the Strawberry site or github. Links below:

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

https://strawberry.rocks/

Strawberry is created by @patrick91 who is also an organizer of @pyconit. It was originally announced during Python Pizza Berlin.

{% twitter 1115266087342563329 %}

#PyPi release and demo

Alpha version on PyPI: https://pypi.org/project/strawberry-graphql
Demo on Heroku using Starlette: https://demo.strawberry.rocks/graphql

#Installation

```
pip install strawberry-graphql
```

Getting Started

Create a file called app.py with the following code:

```
import strawberry


@strawberry.type
class User:
    name: str
    age: int


@strawberry.type
class Query:
    @strawberry.field
    def user(self, info) -> User:
        return User(name="Patrick", age=100)


schema = strawberry.Schema(query=Query)
```

This will create a GraphQL schema defining a User type and a single query field user that will return a hard-coded user.

To run the debug server run the following command:

```
strawberry run server app
```

Open the debug server by clicking on the following link: http://0.0.0.0:8000/graphql

This will open a GraphQL playground where you can test the API.

{% github strawberry-graphql/strawberry %}
Shell Function for Pulling PRs
Tags: shell, github, git
Published: 2019-04-18 09:18:51

---
title: Shell Function for Pulling PRs
published: true
description: 
tags: shell, github, git
---


Fetching PRs opened by others for reviewing or testing new functionalities is a common task. Generally, you'd do the following for this:

`git fetch upstream pull/<PR_NUMBER>/head:<BRANCH> && git checkout <BRANCH>`

Typing this everytime can soon become irritating and you can't have an alias for it because PR number and branch name will vary.

So, shell function comes to the rescue! Functions can take parameters, so it makes our lives easier in this case.

So, if you want a shorthand for the above commands, try the following:

* Put this in your shell configuration file like, .bashrc or .zshrc :

<script src="https://gist.github.com/modasserbillah/3494b7df63a6f677c6ba397399f3d9ed.js"></script>

* Source the config file with `source ~/<Shell_Config_File_Name>`

* Fetch and checkout a PR branch with: `pr <PR_NUMBER> <USER:BRANCH>`

The shell function is a bit opinionated. I prefer to name branches as originally named by the author in their fork. This helps keep track when you have a lot of branches.

GitHub has recently introduced a copy button beside the branch name.

![copy_button](http://modasserbillah.ml/img/github_copy_button.png)

So, it makes it easier just to click that button to copy the branch name but it comes with a user name as well. But you don't have to worry about it, just copy it as it is with the button and use that as the second variable to call the shell function. The first line of the function splits and takes only the branch name to use it as the new branch name.

Happy hacking!

*Initially published at: http://modasserbillah.ml*
I think to learn C for wasm
Tags: discuss
Published: 2019-04-18 12:12:00

---
title: I think to learn C for wasm
published: true
tags: discuss
---

![what](https://media.giphy.com/media/oOxBQwNqGwxeWLDF6A/giphy.gif)

Hey 👋 

I think start learn C for wasm because it's a very interesting technology, but last time I write code on C in the 2013 year.

And now I want to start again. Maybe I start challenge and write what I do and how I fell it.

What do you think about this?
Porquê programar?
Tags: python, iniciante, linguagem
Published: 2019-04-18 11:33:52

---
title: Porquê programar?
published: true
description: Motivos para aprender a programar computadores
tags: python, iniciante, linguagem
---


Meu desafio pessoal na área de desenvolvimento de sistemas iniciou em 1986, e consistiu, na época, aprender Clipper; para mudar um sistema "corporativo", que emitia folha de pagamento, controlava estoque, imprimia pedidos e notas fiscais, entre outras funcionalidades, com o qual eu já trabalhava como usuário.

Lembro que desejava fortemente alterar coisas do programa. Sequências de menus, disposição de telas, fluxo de certas rotinas, etc. Essas mudanças facilitariam o meu trabalho e o de outros funcionários do escritório. Incentivado pelo próprio desenvolvedor daquele sistema, que me deu acesso ao código, parti para o desafio adolescente que me faria tomar um "rumo" na vida.

### Porquê programar?

Mitchel Resnick, diretor do grupo Lifelong Kindergarten, do MIT Media Lab, [afirma](https://exame.abril.com.br/carreira/por-que-aprender-programacao-e-tao-crucial-quanto-saber-ler/) que a programação é uma das habilidades do século 21, e deveria ser tão importante quanto ler ou escrever. Segundo ele, em um mundo repleto de tecnologia, quem não aprender a programar será programado. Software está cada vez mais em tudo, e a "Internet das coisas" é um próximo passo no caminho da nossa sociedade tecnológica. A importância de aprender a codificar vai além das oportunidades de emprego. Uma das possibilidades desse aprendizado é ver o mundo de outras maneiras.

Outra possibilidade importante, que gosto de ressaltar, é que quem aprende a programar aprimora sua proteção digital, seja individual ou corporativa. Utilizar programas dos quais você pode acessar o código fonte, é uma das formas de garantir melhor sua segurança. Ter certeza que aquele aplicativo que você usa, na empresa ou no seu celular, não está roubando dados sem que ninguém perceba.

Codificar permite, ainda, que se possa contribuir na construção do mundo tecnológico, através da participação em projetos de código aberto, principalmente. E mesmo que não seja um projeto "open source", é possível influenciar a sociedade, a cultura e a economia, entre outras áreas, através da programação de sistemas e aplicativos. Mesmo que não seja sua preocupação "melhorar o mundo", vocẽ vai poder melhorar sua própria vida, criando automatização para tarefas chatas, demoradas e/ou repetitivas, o que vai te possibilitar mais tempo para outras coisas, quiçá mais importantes.

Por último, mas não menos importante, programar pode (e deve) ser divertido!


#### Aprenda programação online

* [Hour of Code](https://hourofcode.com/pt)
* [Code Academy](https://www.codecademy.com/pt)
* [Code School](https://www.codeschool.com/courses#all)
* [LearnCafe](http://www.learncafe.com/cursos-online/informatica-e-internet/linguagens-de-programacao?order=date&filter=free)
Why Are Coding Standards Important?
Tags: codequality, career, beginners
Published: 2019-04-18 10:41:10

Almost every language has a set of standards that developers advocate. Off the top of my head and coming from a PHP background, PSR standards spring to mind. These standards are essentially a set of rules on how you should name your files, variables, classes and even non-naming issues such as line length.

But why are these standards important? I mean if it works isn’t that the main thing? Why do I have to follow these strict rules that tell me how I should code!?

Well, hang on a minute let’s put the brakes on. Coding standards are important, but it is important to know **why** you should be doing them, rather than just following them because you feel like you should.

##Why are coding standards important?

Coding standards are there for a reason. They are designed to try and make the code you write as maintainable as possible. I want to especially emphasise this if you are working within a team. If you are all following the same set of rules on how you should write your code, it is far easier for other developers to understand it, contribute to it and to help maintain it.

But it is not just for those within teams.

It is also important if you are working solo. Even if it is a project that will never be shared with anyone. By consistently following these standards, if you stop working on a project and come back to it 6 months later it will be far easier to understand the code instead of having to spend hours or even days reading the code trying to understand what is happening.

Having knowledge and experience in coding standards is also beneficial for getting hired. Companies like to know that the code you write can easily be maintained by other developers in the team. Or if you were to leave, that another developer could come along and understand what you are doing.

Coding standards aren’t there to be a hurdle you have to jump over. They are there to stop the headache down the road. If you start using them, it will become muscle memory and you won’t even realise you are doing it.

*This article was originally posted here: [https://www.georgehanson.co.uk/blog/why-coding-standards-are-important](https://www.georgehanson.co.uk/blog/why-coding-standards-are-important)*
Freelancers vs Companies 
Tags: freelancers, companies, hirefreelancers, hirecompany
Published: 2019-04-18 10:19:24

---
title: Freelancers vs Companies 
published: true
description: Businesses and persons often need a web app developer to create software that can solve their problem and it can be accessed from anywhere. Whom to hire: Agencies vs freelancers for remote development? How to hire developers and how much does it cost to hire a developer is a real question and most of us are clueless at that moment. First of all, you need to decide how much work has to be done on your web app then you can move forward with respective hiring methods for following listed conditions: 
tags: freelancers, companies, hire freelancers, hire company
---

<img src="https://thepracticaldev.s3.amazonaws.com/i/15cmlt406le8y0oefx6k.png" alt="freelancers vs companies">

Businesses and persons often need a web app developer to create software that can solve their problem and it can be accessed from anywhere. Whom to hire: Agencies vs freelancers for remote development? How to hire developers and how much does it cost to hire a developer is a real question and most of us are clueless at that moment. First of all, you need to decide how much work has to be done on your web app then you can move forward with respective hiring methods for following listed conditions:

Read the full article here: **<a href="https://www.decipherzone.com/blog-detail/Remote-web-developers-from-agencies-vs-freelancers--whom-to-hire-">Remote web developers from agencies vs freelancers, Whom to hire</a>**
Why And How To Lazy Load Angular Libraries
Tags: angular, frontend, rxjs, javascript
Published: 2019-04-18 09:49:10

---
title: Why And How To Lazy Load Angular Libraries
published: true
tags: angular,frontend,rxjs,javascript
canonical_url: https://medium.com/@tomastrajan/why-and-how-to-lazy-load-angular-libraries-a3bf1489fe24
---


![](https://thepracticaldev.s3.amazonaws.com/i/k0fuatl3og3pvn8mqtn8.jpg)

> This article is based on a real life experience from a large enterprise environment with more than 60 SPAs and cca 30 libraries…

Angular libraries are great way to organize code! Angular CLI comes with an amazing built-in support to create, build and test library projects inside of the standard workspace.

## What are we going to learn?

* Taxonomy of the Angular libraries based on their purpose
* Different ways of implementing library (Angular CLI workspace vs monorepo)
* Standard lazy loading of the application modules
* How to NOT lazy load modules from Angular libraries
* How to DO proper lazy loading of modules from Angular libraries
* How will this change (for better) with Angular IVY


[Read more...](https://medium.com/@tomastrajan/why-and-how-to-lazy-load-angular-libraries-a3bf1489fe24)
Engineering yourself to become a better Engineer
Tags: showdev, blog, engineering, advice
Published: 2019-04-18 09:38:08

---
title: Engineering yourself to become a better Engineer
published: true
description: My thoughts around engineering, with some from-my-own-experience advice.
tags: showdev,blog,engineering,advice
---

This was [originally posted on my blog, where I discuss all things engineering, sysadmin, labbing!](https://kuby.ca/engineering-yourself-to-become-a-better-engineer/).

There's this paradox that you need to be as fast as possible when programming - just ship it they say. I'd like to argue the counter - perfect what you can, then ship it. It's important to get a MVP out there, but wha tis equally as important is making the MVP suitable enough for potential customers to want to remain on the platform. When I find a MVP, I make a point of spending 10 minutes on it - in 10 minutes if I don't understand the ultimate goal - or it's not possible to do as advertised within reason - it's lacking engineering, not features.

This goes hand in hand when you want to improve yourself, in order to understand yourself better - make yourself a MVP. You're the customer of your own skillset - how do you face a task? A question I strike often is, "if I showed up at your desk, gave you 20 things to do on your first day, and went 'oh by the way, I have a meeting so good luck see you tomorrow!', how would you react?" - You wouldn't be surprised how many hopefuls tell me, "I'd dive right in and get it all done to perfection before you get back in, I'd go the extra mile and ensure to ..." - Not the answer we've wanted to hear. Let's be real here, you're only going to get a few things done, personally, I'd spend the day introducing myself and getting to know everyone first, then get the tasks done the next day.

This is just one example out of many, I've often found that during interviews, the average person overstates their confidence and ability. I'd rather you aim high and miss, then to shoot low and hit. Tell me straight up with no sugarcoating your abilities, it won't mean you can't work - in fact, it shows you're willing to be honest with yourself. Everyone wants a 10 year junior developer, and unfortunately most people give into it, even if they have excellent experience.

My takeaway for all those who are seeking careers in computer science-related fields:

1. No is a perfectly acceptable answer
2. Find the right job for you, don't listen to the people around you - make the decision based on where you want to be in a few years down the road
3. Don't jump ship because it's tough
4. Be nice to everyone, despite their attitude towards you
5. Finally, to err is human - to blame others shows management potential./s
This space intentionally left blank
Tags: dailywriting
Published: 2019-04-18 14:27:46

---
title: This space intentionally left blank
published: true
tags: daily-writing
canonical_url: https://marcusblankenship.com/this-space-intentionally-left-blank/
---

I didn’t write to you yesterday because I had nothing interesting to say.

As a young Team Lead, I would not have done this.

Back then I believed that saying _something_ was always better than saying _nothing_.

Even when I had no specific ideas to contribute, I would open my mouth and fill the void of silence.

Why?  That’s how I thought leaders acted.

Only later would I learn that wasn’t true.

Do you find yourself tempted to do the same thing?

What might you do instead when you have nothing to say?

Take care,  
Marcus

[The upcoming Software Leader Seminar teaches you how to overcome this so your team becomes the problem-solvers.](https://marcusblankenship.com/software-leader-seminar-2019/)

The post [This space intentionally left blank](https://marcusblankenship.com/this-space-intentionally-left-blank/) appeared first on [Marcus Blankenship](https://marcusblankenship.com).
TypeScript Tutorial - return based on args
Tags: tutorial, typescript, webdev, showdev
Published: 2019-04-18 07:26:24

---
title: TypeScript Tutorial - return based on args
published: true
tags: tutorial, typescript, webdev, showdev
canonical_url: https://blog.graphqleditor.com/advanced-typescript-tutorial-return-based-on-args/
series: TypeScript Tutorials
description: Advanced typescript tutorial - return based on args
---

Hello, This is the third article of the advanced typescript tutorial series. Today I'll cover basic usage of generic functions

```typescript
type Point = {
  x?: number
  y?: number
  z?: number
}
const myFunc = <T extends Point>(args: T): T => {
  return args
}
```

As arguments, I'll provide an object containing Point properties. This function will only return Partial of `Point` based on provided parameters in `args` argument;

```typescript
const result = myFunc({
  x: 1,
  y: 1,
})
```

And the intellisense for such function is
![Typescript return correct args](https://thepracticaldev.s3.amazonaws.com/i/wd6g9ewwqjnnqd3v99b3.png)

As you see there is no `z` property here. Typescript already knows we provided these 2 args and it should return only them!

This part is super short as I can provide the infinite number of generic functions usages.
A Dead simple object validator 
Tags: showdev, dev, javascript, validator
Published: 2019-04-18 06:02:56

---
title: A Dead simple object validator 
published: true
description: This is Dead simple validator. No Recursions though.
tags: showdev,dev,javascript,validator
---

As i said it's simple to the core

> Compares the validation object with model and returns its invalid / does not exist.

```javascript
async function validator(requestObject, validatingObj){

  let paramsError = {
    missingParams: [],
    invalidParams: [],
    message: ''
  }
  
  function constructMessage(_paramsError){
    let missingParamsMsg = `Missing the following parameters ${_paramsError.missingParams.join()}`;

    let invalidParamsMsg = `The Following parameters are invalid ${_paramsError.invalidParams.join()}`;

    return missingParamsMsg + '. ' + invalidParamsMsg;
  }


  await Object.keys(validatingObj).map(validParam => {
  Object.keys(requestObject).includes(validParam) 
    ? typeof validatingObj[validParam] === typeof requestObject[validParam] ?
       '' : paramsError.invalidParams.push(validParam) : paramsError.missingParams.push(validParam);
  })

  paramsError.message = constructMessage(paramsError);

  return paramsError;
}
```

Now let's see an example on how to use it.

```javascript
let requestObject = { username: 'one', mailid: 123123, rides: [] };
let validatingObj = {
  username: "",
  mobile: 0,
  mailid: "",
  age: 0,
  rides: { driverid: 0, carModel: '' }
}

//validating object with the request object
validator(requestObject, validatingObj).then(paramsError => {
  console.info('paramsError',paramsError);
}).catch(err => {
  console.error("\nError",err)
})
```
stl-part-viewer web component updated to v1.0
Published: 2019-10-30 00:20:12

---
title: stl-part-viewer web component updated to v1.0
published: true
date: 2019-04-18 04:47:30 UTC
tags: 
canonical_url: https://justinribeiro.com/chronicle/2019/04/17/stl-part-viewer-web-component-updated-to-v1.0/
---

Ever since [lit-html](https://lit-html.polymer-project.org/) hit 1.0, I’ve been meaning to get around to updating `<stl-part-viewer>`. Well, that day finally came after I needed to use it for a couple of projects this week.

With version 1.0 ([available on npm](https://www.npmjs.com/package/@justinribeiro/stl-part-viewer)), only a few changes:

1. LitElement base class updated to 2.1.0
2. Three.js updated to r103

To use, grab with npm or yarn.

```
npm i @justinribeiro/stl-part-viewer # or yarn add @justinribeiro/stl-part-viewer
```

Now start displaying those parts!
FireSQL Challenge: Can You Create A Scenario To Create a SQL Injection Attack?
Tags: challenge, discuss, php
Published: 2019-04-18 03:34:55

---
title: FireSQL Challenge: Can You Create A Scenario To Create a SQL Injection Attack?
published: true
description: 
tags: challenge, discuss, php
---

I build a NoSQL solution on top of a SQL database. Take a look at this library https://github.com/ua1-labs/firesql.

Can you create a scenario where you successfully attack the underlying SQL database using a SQL Injection technique?