teleren/devto huggingface dataset:
(!QuickFix) != (QuickFix != nil)
Tags: objectivec
Published: 2019-04-14 13:35:09

---
title: (!QuickFix) != (QuickFix != nil)
published: true
tags: objectivec
canonical_url: https://zeitschlag.net/quickfix-quickfix-nil/
---

A colleague of mine works on a pretty important feature. He uses a seperate git-branch for this, so that his changes can be reviewed and thoroughly tested before being merged into the app.

While working on that feature, he fixed some easy-to-fix, but important bugs on this exact branch. In the end, he got stuck due to another reason.

As some customers were waiting for these bug fixes, we wanted to release a new version. We remotely sat together to cherry-pick the bug-fix-commits into their own branch and while doing that, I quickly applied some cosmetic changes. Nothing adventurous, you know, but only minor things to make things more readable. Things like this:

```
if (!object) { /* ... */ }

```

turned into this:

```
if (object != nil) { /* ... */ }

```

If you're more mindful than I've been over the past couple of days, you might ask: "WTF are you doing?! THIS IS JUST WRONG!". And I have to admit: You're absolutely right, it is. The correct version of this would be:

```
if (object == nil) { /* ... */ }

```

I heavily overestimated myself and due to the fact, that these were just small changes, I didn't test the app afterwards myself, because, you know, what could possibly go wrong with these small changes? 😂🙃

Combined with my inattention this turned out to be more or less disastrous: Not one, but two of these changes broke the app. Thankfully, our testing team did a better job. They tested the app before shipping and they complained. I doublechecked my changes and quickly found the wrong code. I fixed it and everything was fine again.

So, hopefully I've learned some things from this:

- Check everything, even — and especially — tiny quick fixes
- Even tiny things can break your neck.
- Don't rush. Take your time to do good work and test it.
- This can happen to humans. A friend wanted me to include this so you don't feel too bad, if this happens to you, too.

Thanks for reading.
GraphQL Code Generator
Tags: graphql, beginners, webdev, showdev
Published: 2019-05-17 14:14:48

---
title: GraphQL Code Generator
published: true
description: Generate code out of your GraphQL schema with GraphQL Code Generator.
tags: graphql,beginners,webdev,showdev
cover_image: https://thepracticaldev.s3.amazonaws.com/i/aqmqdlvsjd4hiui3vyb2.png
canonical_url: https://blog.graphqleditor.com/graphql-code-generator/
---


[GraphQL](https://graphqleditor.com/) is a hot technology. Its recent rise created a niche for multiple tools, like [GraphQL Code Generator](https://graphql-code-generator.com/), having one thing in common - making using GraphQL easier & more pleasant experience.

GraphQL Code Generator is a tool that generates code out of your GraphQL schema. How? By analyzing the GraphQL schema & documents and parsing it, then GraphQL Code Generator outputs code at a wide variety of formats. 

The creators currently support & maintain plugins for:
- TypeScript
- Flow
- React
- Angular
- MongoDB
- Stencil
- Reason

GraphQL Code Generator let you choose the output that you need, based on plugins, which are very flexible and customizable. You can also write your own plugins to generate custom outputs that match your needs.

The GraphL Code Editor You can also try it out online:

[![GraphQL Code Generator](https://thepracticaldev.s3.amazonaws.com/i/d466labpl8lz2bhluqdd.png)](https://graphql-code-generator.com/#live-demo)

or just dive intro their GitHub repo:
{% github dotansimha/graphql-code-generator %}
docker swarm mysql service, when scaled not working
Tags: help, docker, dockerswarm, devops
Published: 2019-05-17 13:52:03

---
title: docker swarm mysql service, when scaled not working
published: true
tags: help, docker,docker-swarm,devops
---

I simply created one swarm node (master). Wrote  a docker-compose with multiple service one of them is mysql. Now, when I scale mysql container I get connection issue. The mysql has a volume defines as 

```
volumes:
  - ./mysql:/var/lib/mysql
```
Default Value of a Dictionary, Python Trick 
Tags: python
Published: 2019-05-17 13:17:10

When you need get a value from dicctionary is very easy, anybody know how do it, but i believe this solution is unknow from a  new programer of python.



the most common way to get a value from dictionary:

```python
computer_component = {"output":"monitor","input":"teclado","storage":"SSD"}
get_component = computer_component['output']
print(get_component)
```

the problem with that is when  value not exists in dictionary:
```python
computer_component = {"output":"monitor","input":"teclado","storage":"SSD"}
get_component = computer_component['internet']
print(get_component)

#output:
#Traceback (most recent call last):
#  File "main.py", line 2, in <module>
#    get_component = computer_component['internet']
#KeyError: 'internet'
```

Ok, you can  validate if value exists:

```python
computer_component = {"output":"monitor","input":"teclado","storage":"SSD"}

if "internet" in computer_component.keys():
  print(computer_component["internet"])
else:
  print("internet 404")

#output:
#internet 404
```

but the best way to get value from  a dictionary is this:

```python
computer_component = {"output":"monitor","input":"teclado","storage":"SSD"}

print(computer_component.get("output","404"))

#output
#monitor

#--in case when value not exists:
print(computer_component.get("internet","404"))
#output
#404
```
where the  firt param is the value and the second is the value by default.


Forgive me, but my English is a little bad, I want to improve it.
100 Days of Code Challenge
Tags: challenge, 100daysofcode, careerchanger
Published: 2019-05-17 12:32:57

---
title: 100 Days of Code Challenge
published: true
description: don't want to wake up and find out all my code has been for work in months... again
tags: challenge, 100daysofcode, career-changer
---

#I looked at my github profile today 

_and realized... it has been months since I wrote anything outside of work._

I have so many ideas and things I've planned to do! So many projects to work on! But, for an entire almost 3 months, I've only written code for work and done maybe three leetcode challenges. _Easy ones_. 

So this challenge is serious: Starting on Wednesday, 5/22 (because I will be traveling until Tuesday) I will push something to github every single day. And it will be related to one of my projects on at least 75 of those days. 

It's realer and more serious if you tell people about it, is it not?
Deep Work Dev
Tags: beginners, javascript, webdev
Published: 2019-03-18 12:54:36

---
title: Deep Work Dev
published: true
description: 
tags: Beginner, Javascript, Web Dev
---

# First Post, The

-------
Learning: Javascript
-------

<p> Sup, internet? I'm Njeri Cooper, a 25 yo techie that is committing to unlearning, re-learning, and re-vamping my tech career as a bad a55. </p>

</br>

<p> The last 3 weeks have been 6 hours a day of web dev fundamentals including skills and terms like "the DOM", VS Code, shortcuts, setting up an efficient environment, HTML af, CSS ls, enough JavaScript to be dangerous, and how to be software engineer boring when you see the world and live life in technicolor.</p>

<p> Aside from exercising my brain and flexing my skills for the gram, I've devoted tons of time to physical, mental, and emotional re-training, too. We eating right, drinking water, reading books, listening to talks/podcasts, etc ova here. </P

<p> How was your journey when you decided to take coding and or tech seriously? Are you the dev rockstar you thought you would be? </p>

`var Coop === "Love and Light";`
On Glitch This Week
Tags: glitch, glitchthisweek, showdev
Published: 2019-05-17 11:06:30

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

Glitch This Week is a regular series in which we round-up just some of the amazing projects that fantastic creators have made on [Glitch](https://glitch.com/). Here are a few projects that caught our eye this week.

## [Learn about Sorting Algorithms](https://glitch.com/~quilted-koala)

Kicking us off this week, we have [Gaeel Bradshaw-Rodriguez](https://glitch.com/@Bradshaw)'s project "[quilted-koala](https://glitch.com/~quilted-koala)" - a cute project to learn about sorting algorithms. Gnome, Bubble, Slow, Oust, Swapping Oust, and Optimised Oust algorithms are compared. You can see each working, with stats listing the number of checks, moves, and operations each has performed so you get an idea of their efficiency. Then take a look at [the source code](https://glitch.com/edit/#!/quilted-koala?path=script.js:1:0) to understand how to implement each one.

{% glitch quilted-koala app %}


## [Take Care of Yourself](https://glitch.com/~three-good-things)

"[three-good-things](https://glitch.com/~three-good-things)" is an app that helps you to take care of your mental health.

Created by QA Analyst [Desi Rottman](https://glitch.com/@desilove), the app puts her own self-care ritual in to practice, helping you to remember to write down or share three good things in your life each day. "They can be things that happened the day before, things I'm looking forward to, good experiences I had, or even things as trivial as coffee", explains Desi. "Some days it's harder than others, and on those days, it feels like the most important thing to do."

{% user desi %}
{% glitch three-good-things app %}


## [Create Your Own Font](https://enfont-terrible.glitch.me/)

[Javier Arce](https://glitch.com/@javier) created "[enfont-terrible](https://enfont-terrible.glitch.me/)", a truly "terrible" font foundry. Upload a font and then use the app to create your own weird OpenType fonts based on it.

![](https://cdn.glitch.com/02863ac1-a499-4a41-ac9c-41792950000f%2Fenfant-terrible.png?1558090222586)

Other apps in [this week's round-up](https://glitch.com/@glitch/glitch-this-week-may-15-2019) include a musical aquarium, a pixel art to Excel converter, and a Phish setlist generator. [Check them out](https://glitch.com/@glitch/glitch-this-week-may-15-2019)!
How to choose the best structure for react applications?
Tags: react, redux, help, discuss
Published: 2019-05-17 11:04:12

---
title: How to choose the best structure for react applications?
published: true
description: 
tags: react, redux, help, discuss
---


Hello,

I am a new beginner to React JS, and for learn i made a project. 
I decided to write this post after transferring files from one directory to another many times.

For those who immediately want to watch the code [GitHub](https://github.com/minority/node-react-mongo-auth/tree/master/client)

What happened to me


<code>src/feature/

    Auth (folder module feature, exported all reducers/routes)
       Signup
       RestorePassword
       Signin
          components/SigninForm
               index.jsx
               index.module.scss
          actions.js
          reducer.js
          index.jsx (container with connect redux)
       index.js (exported all reducers/routes)
       reducers.js (include all reducers module)
       routes.js (routes for module)
    Cabinet
       Home
       Users
          index.jsx
       index.js
       routes.js
    Shared
       Layout
       PrivateRoute

</code>

What structure are you using?
Start before you are ready
Tags: career, motivation
Published: 2019-05-17 09:27:57

---
title: Start before you are ready
published: true
description: Just fucking begin!
tags: career, motivation
---
# Introduction

This post will be a little different from what I'm used to write. I tend to keep my articles in the technical realm of programming. This time, I'll have to talk about a subject that transformed my mindset lately. It will appear a little like a rant, and it very well may be :D

# START BEFORE YOU ARE READY

I was reading for the second time _Do the work_ by Steven Pressfield. The author describes an enemy, an enemy we all have, an enemy we have to face everyday, every time we try to do something ambitious. He calls that enemy _Resistance_.

### What is resistance?

Resistance can't be seen or touched, it can only be felt. You feel it every time you have a big idea, or think about a big project, or consider a bold action. You may call it _imposter syndrome_. Resistance is felt every time you decide to reject immediate gratification in favour of long term improvement, or improving your health. Resistance is a bitch and will always be there, lurking around, ready to stab you at any sign of weakness. Fear, it never goes away. You will always be afraid before doing something bold, something important for your life, and resistance will use this to kill all your hope and dreams.

The good news is, you can use resistance as a compass. Resistance doesn't play by the book and is constantly full of shit. If you feel the resistance approach with his bullshit rhetoric, his 100000 reasons why _this_ is not a good idea. Then, you know, you might be on to something.

# So start, now...

Resistance will always give you good excuses. And you might even believe them, I know I still do sometimes...

> But I'm not prepared yet...

> It's too difficult of a project...

> I'm not rich enough...

> The state of the market is just not right...

Fuck that, fuck resistance.

I faced resistance when I decided to launch <a href="https://invoicemaker.xyz">InvoiceMaker</a>. I could have spent months preparing, studying different plans, UI, ways to do things. And delay... and delay...

So... I didn't prepare. I just started to code. And I made a very simple thing, and I launch. Is it awful? Yeah. Is it popular? Fuck no. Is it live? **FUCK YES, AND THAT'S THE POINT!!**

Your ideas and projects are nothing, until you start acting on it. Then, I started to write articles about the state of my application. I just did things, one at a time, slowly. And I got some **AMAZING** feedback. People just told me what they thought, and now I can tweak my thing, and improve, and keep going...

I'll just end up with this Johann Wolfgang von Goethe's quote:

>  Whatever you can do or dream you can, begin it; Boldness has genius, power, and magic in it.

No more excuses, write that blog post, start that application, apply to that job, talk to your crush, go for a run...

Good luck,:muscle: and fuck resistance! :fu:

*Sorry for cursing, but it felt more dramatic :grimacing:*
Match making kundli

Tags: matchmakingkundli
Published: 2019-05-17 10:52:00

Kundali specialist - Janam kundali matching online - Astrologer Subhash Shastri ji is no1 Match making Kundali specialist in India, marriage kundali maching, birth kundali making and kundali prediction. https://solvemyloveproblem.com/Match-making-kundli.html
Getting Started with Leaflet
Tags: javascript, beginners, leaflet, map
Published: 2019-05-17 10:22:13

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

Start a basic HTML template
```html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <title>Getting Started with Leaflet JS</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
  </head>
  <body>
  </body>
</html>
```

Include Leaflet CSS file in the head section of your document:
```html
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.5.1/leaflet.css">
```

Include Leaflet JavaScript file after Leaflet’s CSS (before the closing `</body>` tag):
```html
<script src='https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.5.1/leaflet.js'></script>
```

Put a div element with the id `map` where you want your map to be:
```html
<div id="map"></div>
```

Make sure the map container has a defined height, for example by setting it in CSS:
```css
body {
  padding: 0;
  margin: 0;
}
html,
body,
#map {
  height: 100%;
}
```

Now you’re ready to initialize the map and do some stuff with it.

Lets start by setting up the BaseMap services. See ([Docs](https://leafletjs.com/reference-1.5.0.html#map)) for more info:
```javascript
//Init Overlays
var overlays = {};

//Init BaseMaps
var basemaps = {
  "OpenStreetMaps": L.tileLayer(
    "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
    {
      minZoom: 2,
      maxZoom: 19,
      id: "osm.streets"
    }
  ),
  "Google-Map": L.tileLayer(
    "https://mt1.google.com/vt/lyrs=r&x={x}&y={y}&z={z}",
    {
      minZoom: 2,
      maxZoom: 19,
      id: "google.street"
    }
  ),
  "Google-Satellite": L.tileLayer(
    "https://mt1.google.com/vt/lyrs=s&x={x}&y={y}&z={z}",
    {
      minZoom: 2,
      maxZoom: 19,
      id: "google.satellite"
    }
  ),
  "Google-Hybrid": L.tileLayer(
    "https://mt1.google.com/vt/lyrs=y&x={x}&y={y}&z={z}",
    {
      minZoom: 2,
      maxZoom: 19,
      id: "google.hybrid"
    }
  )
};
```

Next we setup the map options such as center and zoom.
```javascript
//Map Options
var mapOptions = {
  zoomControl: false,
  attributionControl: false,
  center: [-29.0529434318608, 152.01910972595218],
  zoom: 10,
  layers: [basemaps.OpenStreetMaps]
};
```

Finally we can initialise the map
```javascript
//Render Main Map
var map = L.map("map", mapOptions);
```

Besides tile layers, you can easily add other things to your map, including markers, polylines, polygons, circles, and popups. Let’s add a marker:
```javascript
var marker = L.marker([-29.0529434318608, 152.01910972595218]).addTo(map);
```

Popups are usually used when you want to attach some information to a particular object on a map. Leaflet has a very handy shortcut for this:
```javascript
marker.bindPopup("<b>Hello world!</b><br>I am a popup.").openPopup();
```

For more information please see the [Leaflet Quick Start Guide](https://leafletjs.com/examples/quick-start/)

See it in action on CodePen {% codepen https://codepen.io/ItsMeStevieG/pen/YbQKMQ %}

Join me on [HashNode](https://hashnode.com/@ItsMeStevieG/joinme)
Top Web App Development Frameworks for 2019
Tags: angular, react, php, webdev
Published: 2019-05-17 10:17:12

---
title: Top Web App Development Frameworks for 2019
published: true
description: Top Web application development frameworks are created to help the developers for developing high-quality web applications utilizing a single programming language. Scope of frameworks is presented in the market with differed system engineering. Developers can figure out the component of rich web applications by learning web application Frameworks.
tags: angular, reactjs, php, #webdev
---

<img src="https://thepracticaldev.s3.amazonaws.com/i/puss0t22zfslexhc2amz.png" alt="top frameworks for web app development">

Top Web application development frameworks are created to help the developers for developing high-quality web applications utilizing a single programming language. Scope of frameworks is presented in the market with differed system engineering. Developers can figure out the component of rich web applications by learning web application Frameworks.

As this interest for web applications flood, the interest for having dynamic high – level frameworks. Luckily, there is a huge range of web application development frameworks for you to browse.

**Top 15 Web Application Development Frameworks in 2019**

**Ruby on Rails**
Ruby on rails is a broadly favoured web application framework that watches a push-based MVC engineering. The system is open source, allowed to utilize and keeps running on Linux.

**Angular**
Angular is one of the best JavaScript frameworks released by Google. It is a sort of front-end system that is particularly well known among the developers as it permits broadening the HTML vocabulary for web app development.

**Django**
Django pursues the MVT model. For the most part, complex and information-driven sites are manufactured utilizing this structure. The framework gives better safety efforts when it comes than overseeing passwords and client accounts.

**Ember.js**
This is the best stage characterized by structuring the ambitious web applications. Engineers attempt their hands with Ember.js for creating versatile single-page web applications.

**Express**
Express is a Node.js web application server system. This stage is sufficiently adaptable to fabricate single page, multi-page and even the flourishing half breed web applications.

**MeteorJS**
Meteor is a full-stack JavaScript framework to develop single page applications. This open-source system is isomorphic in nature, which means JavaScript can run both on the server-side just as the customer side.

Read the full article here: https://www.decipherzone.com/blog-detail/Top-Web-Application-Development-Frameworks-in-2019
Passing a parameter to a zsh keyboard-shortcut
Tags: zsh, linux, terminal, shortcuts
Published: 2019-05-17 09:25:02

---
title: Passing a parameter to a zsh keyboard-shortcut
published: true
description: Describes how to pass an input to a zsh keyboard-shortcut widget
tags: zsh,linux,terminal,shortcuts
series: zsh-keyboard-shortcuts
---

## Intro

This post follows up on my previous post [Using keyboard-shortcuts with zsh](https://dev.to/ecologic/using-keyboard-shortcuts-with-zsh-16b). As promised I will show how we can pass an argument / string to a zsh keyboard-shortcut. 

We could for example use this option to create git feature branches by doing:

`[typing the name of the branch] --> [keyboard-shortcut] --> [done]`

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

## Show me the code!
```bash
# create a feature branch with <name> and then ctrl-g+f
function featbranch() {
    branch_name=$BUFFER
    zle backward-kill-line
    echo "git checkout -b feat/$branch_name"
    git checkout -b "feat/${branch_name}"
    zle reset-prompt
    zle redisplay
}
zle -N featbranch
bindkey '^gf' featbranch
```
A bit longer than our previous widget. Let's break it down line by line:

1. Another awesome comment
2. The function which will be executed by our keystroke:
3. Save the current terminal-line into a variable
4. Clear the current line
5. Display the full command we like to execute
6. Execute the command
7. Reset the prompt. (Useful if we display branch-information in our promt)
8. Redisplay our prompt.
9. Again we define a widget that points to the function
10. And bind our key-combination to the widget

So there we have it. Let me know if it works for you!

 
## ❤️ Let's connect!
I would love to grow my network with other tech enthusiasts. Let's connect here or over on twitter! [👋 @langhard](https://twitter.com/langhard) 

## Resources

[A User's Guide to the Z-Shell](http://zsh.sourceforge.net/Guide/zshguide04.html)
How I ensure that my Open Source projects have a license?
Tags: development, python
Published: 2019-05-27 09:25:45

---
title: How I ensure that my Open Source projects have a license?
published: true
tags: Development,Python
canonical_url: https://daniele.tech/2019/05/how-i-ensure-that-my-open-source-projects-have-a-license/
---

Every developer should know that release the code doesn’t mean that is open source. Probably you are asking why, after all the code is public. Also, the bus are public but this doesn’t mean that you can use it without a ticket. Basically if it is not explained it is proprietary software. For this reason [...]

[Read More...](https://daniele.tech/2019/05/how-i-ensure-that-my-open-source-projects-have-a-license/)

The post [How I ensure that my Open Source projects have a license?](https://daniele.tech/2019/05/how-i-ensure-that-my-open-source-projects-have-a-license/) appeared first on [Daniele Mte90 Scasciafratte](https://daniele.tech/eng).