teleren/devto huggingface dataset:
Git 101 — STEP 4: merging branches, merge conflicts & cherry-pick
Tags: bitbucket, gitlab, github, git
Published: 2017-12-20 20:11:20

---
title: "Git 101 — STEP 4: merging branches, merge conflicts & cherry-pick"
published: true
tags: bitbucket,gitlab,github,git
canonical_url: 
---

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

Today I want to show you how easy it is to merging branches, fix a merge conflict and how to use cherry-pick to get any commit your local&nbsp;branch!

Let’s get fired up and hit the terminal&nbsp;🔥

_In the video, I show you everything that I know. Below the video, you can check the notes with all the commands you&nbsp;need._

{% youtube BTIyMEOOPEQ %}

#### 1 Git pull a different branch into current&nbsp;branch!

Make sure your both branches are up to date on the&nbsp;remote!

```
git merge tryout
```

Now you can test if your code still works! If it works it push it to the&nbsp;remote!

#### 2 After successfully merged, delete another&nbsp;branch

Use the following command like we talked about in the previous video, to delete the&nbsp;branch.

```
git branch -d tryout
```

#### 3 What if you get a merge conflict?

Sometimes it happens that someone else changed the same row as you did. When you pull the remote you will get a merge conflict.

The easiest way to fix this is just manually by checking your code. After you fixed it, commit this change and push it to the&nbsp;remote!

#### 4 What if you want to have a specific commit change from another&nbsp;branch?

This is what we called cherrypicking. With cherry-pick you can pick the commit you want, to pull it into your local branch where your working&nbsp;on.

Just find the commit id and just this&nbsp;command.

```
git cherry-pick commitId
```

#### Do you need some&nbsp;help?

If your working with Git, but getting stuck? Please let me know in the comments or hit me on twitter [@frontendmr](https://twitter.com/frontendmr) and I would ❤️ to help you&nbsp;out!

Did you liked this post? Please share it around&nbsp;🙏

_Originally published at_ [_Mr Frontend&nbsp;Blog_](https://blog.mrfrontend.org/2017/12/git-101-step-4-merging-branches-merge-conflicts-cherry-pick/)_._

* * *
Programming and the fight against climate change
Tags: discuss, future
Published: 2017-12-20 07:29:33

---
title: Programming and the fight against climate change
published: true
description: 
tags: discuss, future
---

I've been programming for 5 years and I've never worked directly in a project with a clear goal like to lower our carbon footprint even if this is a question I'm asking myself everyday to improve the situation. The only thing that comes close is that I'm currently developing a web app for a French company to limit paper documents on their parts repair.

In the meantime, [our domain has a footprint exceeding air travel](https://climatecare.org/infographic-the-carbon-footprint-of-the-internet/).

So, in my case, this is obviously not enough in a larger scale. I need to do a lot more. So I was wondering what do you do in your workday to improve the climate situation? Do you work in the climate field? Is the Earth a concern in your every day business?

Finally, in general, do you think, as a developer, we can have a positive impact on this global warming?
Data Science Course in Chennai
Tags: datasciencecourse, datasciencetraining
Published: 2017-12-20 07:02:44

---
title: "Data Science Course in Chennai"
published: True
description: Are you willing to take Data Science Training in Chennai with R programming concepts? FITA offers the complete Data Analytics Course in Chennai with help of experienced and talented professionals to make you as an expert in Data Science world. FITA always keep training you with practical classes on latest concepts which help you to get a job in today market. Syllabuses are structured by the experienced tutors who have more than 8 years in Data Science industry. If you want to begin learning Data Science Course in Chennai makes a call @9841746595. https://www.trainingintnagar.in/data-science-course/

tags: Data Science Course, Data Science Training 
---
Is developer productivity part of business value?
Tags: discuss
Published: 2017-12-20 01:53:53

---
title: Is developer productivity part of business value?
published: true
description: 
tags: discuss
---

... when the core business is some digital product? 

Investing time in tooling, tests, refactoring and so on, adds more value for the business? 

Thinking on the long term, if I spent some time updating code, refactoring, writing more tests, this contribute to raise more confidence in the code/product delivered, avoid bugs and other problems, and it seems to reduce later efforts. 

What do you think?
First web page online
Tags: webdev, beginners, showdev
Published: 2017-12-20 00:15:18

---
title: First web page online
published: true
description: I released
tags: #webdev #beginners #showdev
---

My first web page is live, my portfolio, and I want you to see it.
Feedback please. :)
[See it here](https://eduardoedi.com)
Just published: jquery.docout
Tags: showdev, javascript, webdev, jquery
Published: 2017-12-19 23:02:33

---
title: "Just published: jquery.docout"
published: true
description: jquery.docout - a jQuery plugin for producing document outline
tags: showdev, javascript, webdev, jquery
---

I use GitHub pages to host my [personal blog](http://iridakos.com) and since some of my posts are long tutorials, I created a customizable jQuery plugin that renders a document outline.

[jquery.docout GitHub repository](https://github.com/iridakos/jquery.docout)

![jquery.docout demo image](https://raw.githubusercontent.com/iridakos/jquery.docout/master/doc/resources/images/document-outline.gif)

Any feedback is welcome!
How to make a real copy of a JavaScript Array with Objects (without a reference)
Tags: javascript, webdev
Published: 2017-12-19 22:06:25

---
title: "How to make a real copy of a JavaScript Array with Objects (without a reference)"
published: true
tags: javascript,web-development
canonical_url: 
---

It happens a lot that you want to copy a variable, with an Object or Array, to manipulate the data and use it afterward. But when we create an array of users and make a copy in a new variable, like&nbsp;this:

```
var originalObject = [
  {"first":"Gretchen","last":"Kuphal","email":"greenwolf54@gmail.com","address":"416 Lesch Road","created":"March 1, 2012","balance":"$9,782.26"},
{"first":"Morton","last":"Mayer","email":"salmonsquirrel25@gmail.com","address":"1602 Bernhard Parkway","created":"April 29, 2017","balance":"$6,596.11"},
{"first":"Catalina","last":"Daugherty","email":"Catalina.Daugherty@filomena.name","address":"11893 Kali Vista","created":"October 16, 2008","balance":"$6,372.86"},
{"first":"Orpha","last":"Heaney","email":"turquoisewolf22@gmail.com","address":"8090 Chris Stream","created":"November 21, 2015","balance":"$9,596.26"},
{"first":"Reva","last":"Mohr","email":"Reva.Mohr@oda.net","address":"0291 Kailyn Stravenue","created":"November 6, 2014","balance":"$4,768.37"},
{"first":"Loma","last":"Keeling","email":"turquoisegiraffe09@gmail.com","address":"84460 Samson Knoll","created":"June 13, 2017","balance":"$9,361.16"}
];

var duplicateObject = originalObject;
```

It will keep a reference from “ **duplicateObject** ” to “ **originalObject** ”. This is also called a shallow&nbsp;copy.

To show you that it will keep its reference, we gonna change the first name of the first user in the “ **originalObject** ”.

```
originalObject[0].first = "Ray";
```

Then log the “ **originalObject** ” and “ **duplicateObject** ” and the result will show you that both are changed! In a lot of cases, you don’t want this to&nbsp;happen!!

#### So how do we fix&nbsp;this?

We can do the trick with JSON.stringify and JSON.parse method.

```
var duplicateObject = JSON.parse(JSON.stringify( originalObject ));
```

And if we now change the first name of the first user in the originalObject, the duplicate will not&nbsp;change!

```
originalObject[0].first = "Ray";
```

Check it via the console to log the “ **originalObject** ” and “ **duplicateObject** ”;

_Originally published at_ [_Raymon Schouwenaar_](https://www.raymonschouwenaar.nl/make-real-copy-javascript-array-objects-without-reference/)_._
Static HOC analysis for recompose and redux by flowtype
Tags: javascript, flowtype, redux
Published: 2017-12-19 20:23:15

---
title: Static HOC analysis for recompose and redux by flowtype
published: true
description: 
tags: javascript,flowtype,redux
---

flow@60.1

Need these definitons

- https://github.com/acdlite/recompose/blob/master/types/flow-typed/recompose_v0.24.x/flow_v0.55.x-/recompose_v0.24.x.js
- https://github.com/flowtype/flow-typed/blob/master/definitions/npm/redux_v3.x.x/flow_v0.55.x-/redux_v3.x.x.js

```js
/* @flow */
import React from 'react'
import { bindActionCreators, combineReducers } from 'redux'
import { compose, lifecycle, pure, type HOC } from 'recompose'
import { connect } from 'react-redux'

// reducer
const INC = 'inc'

const inc = () => ({ type: INC })

type Counter = {
  value: number
}

type Action = $Call<typeof inc>

const counter = (state: Counter = { value: 0 }, action: Action): Counter => {
  switch (action.type) {
    case INC: {
      return { value: state.value + 1 }
    }
    default: {
      return state
    }
  }
}

const rootReducer = combineReducers({ counter })

// Get RootState from result of rootReducer
type RootState = $Call<typeof rootReducer>

// compose HOCs

type OuterProps = {
  foo: string
}

type Props = {
  foo: string,
  bar: number,
  actions: {
    inc: Function
  }
}

const connector = connect(
  (state: RootState, props) => {
    return {
      foo: props.foo,
      bar: state.counter.value
    }
  },
  dispatch => bindActionCreators({ inc }, dispatch)
)

const enhancer: HOC<Props, OuterProps> = compose(
  connector,
  pure,
  lifecycle({
    componentDidMount() {
      console.log('mounted')
    }
  })
)

// props is resolved by hoc
const MyComponent = enhancer(props => {
  return (
    <div>
      {props.foo}
      {props.bar}
      {props.actions.inc}
    </div>
  )
})
```

## Check them on flowtype

You can check and complete codes on part of mapStateToProps and MyComponent's props.
Which backend stack will be good to learn now and will be futuristic also? 
Tags: discuss, webdev, python, node
Published: 2017-12-19 20:04:54

---
title: Which backend stack will be good to learn now and will be futuristic also? 
published: true
tags: discuss, webdev, Python, Node
---

I am new to back-end web development and I am really confused between learning **Django** (due to *Python*) and **NodeJs** (due to lot of good things heard about *MEAN* stack).
Please Guide...
How do you manage Code of Conduct violations in community websites?
Tags: discuss, moderation, codeofconduct
Published: 2017-12-19 19:57:50

---
title: How do you manage Code of Conduct violations in community websites?
published: true
description: Questions about content moderation in community websites.
tags: #discuss #moderation #code_of_conduct
---

 ![Community](https://thepracticaldev.s3.amazonaws.com/i/9490egaviqot4pi0xt0p.jpg) 


I am developing a web platform which involves public communication. To keep the positive vibe I am including the Code of Conduct there. What gotchas should I know about content moderation? How much time per month does it take to deal with such issues in your case? Are there useful tools or methods to speed up the moderation process? What are the common practices or your own practices about dealing with moderatable content?
WDS14 - Webpage Inside Webpage
Tags: html, wds, webdev
Published: 2017-12-19 18:23:09

---
title: "WDS14 - Webpage Inside Webpage"
published: true
tags: HTML,WDS, webdev
canonical_url: http://thecodingexpress.blogspot.com/2017/12/wds14-webpage-inside-webpage.html
---

In the [last article](https://thecodingexpress.blogspot.in/2017/12/wds13-block-level-and-inline-elements.html) we learned about:  

- Block level and Inline HTML elements
- Important **div** and **span** elements
In the today's article, we will study to display one webpage inside of other. So let's get started...  
Sometimes it is not sufficient just to provide the link to other website or put a screenshot of that website to give information. It is better to provide a&nbsp; small box on the webpage where the other webpage is already opened and the user can simultaneously interact on both areas. Let's see how we can achieve this with help of HTML.  

#### <u><span style='font-family: "helvetica neue" , "arial" , "helvetica" , sans-serif;'>HTML iframe element</span></u>

- An iframe is used to display a web page within a web page.
- Syntax:&nbsp; **\<iframe src="URL"\> \</iframe\>**
- Optional Attributes:

  - **height** : Set height of iframe
  - **width** :&nbsp; Set width of iframe

{% gist https://gist.github.com/Omkar-Ajnadkar/6cd99e743cb04c00e74b6404a1ffe879 %}
Attribute values are by default (without any specified units) are in pixels but we can also use percentage based values.  

- By default, an iframe has a border around it. To remove it, we can use style attribute. Syntax: **style="border:none;"**
- An iframe can be used as the target frame for a link.The **target attribute of the link** must be same as the **name attribute of the iframe**.

{% gist https://gist.github.com/Omkar-Ajnadkar/132d074b7223112f12a1949b77be27e0 %}
That's all for today. I actually want to start next part today, but it will be better if we complete that in one part tomorrow. In next part, we are going to see some important elements inside **\<head\>** tag, which we will not see on the webpage but will help a lot to search engines and browsers to understand your HTML. Till then _ **#keepcoding.** _
Kotlin's scope functions in C#
Tags: kotlin, csharp
Published: 2017-12-19 17:49:33

---
title: Kotlin's scope functions in C#
published: true
description: Port .let, .also to C#
tags: Kotlin, csharp
---

Kotlin's scope functions(`.let`, `.also`, `.apply`, etc) are super useful.

* [let - Kotlin Programming Language](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/let.html)
* [also - Kotlin Programming Language](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/also.html)
* [apply - Kotlin Programming Language](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/apply.html)

I want to these methods in C#.
So I just define it!

```csharp
static class ObjectExtensions 
{
    // Kotlin: fun <T, R> T.let(block: (T) -> R): R
    public static R Let<T, R>(this T self, Func<T, R> block) 
    {
        return block(self);
    }

    // Kotlin: fun <T> T.also(block: (T) -> Unit): T
    public static T Also<T>(this T self, Action<T> block)
    {
        block(self);
        return self;
    }   
}
```

## Usage

```csharp
var text = resultCode.Let(x => {
    switch (x) {
        case 0:
            return "success";
        default:
            return $"error({x})";
    }
});

var model = new MyModel().Also(m => {
    m.Initialize();
    m.Load(path);
});
```

I hope .NET Framework provide these methods.
Curve Splitting: de Casteljau and Bezier
Tags: video, algorithms, coding, ui
Published: 2017-12-19 10:46:17

---
title: "Curve Splitting: de Casteljau and Bezier"
published: true
description: How to use de Casteljau's algorithm to split bezier curves
tags: video, algorithm, coding, ui
cover_image: https://i.imgur.com/EBPM8Sz.jpg
---

{% youtube QaOeThzSi88 %}

I've created a small visual tool to explore de Casteljau's algorithm, which I use to show how bezier curves are drawn and split.

[Source Code](https://github.com/mortoray/fuse-demos/tree/master/de-casteljau)

Watch my streams live on [Twitch - Mortoray](https://www.twitch.tv/mortoray)
Javascript functional programming basic examples
Tags: javascript, functional
Published: 2017-12-19 10:29:24

---
title: Javascript functional programming basic examples
published: true
description: 
tags: Javascript, fp
---


##Functional programming:

Is a programming paradigm.

The output value of a function depends only on the arguments that are passed to the function, so calling a function f twice with the same value for an argument x produces the same result f(x) each time.

This is in contrast to procedures depending on a local or global state, which may produce different results at different times when called with the same arguments but a different program state. 

Eliminating side effects, i.e., changes in state that do not depend on the function inputs, can make it much easier to understand and predict the behavior of a program, which is one of the key motivations for the development of functional programming.


##High-order-functions:
Functions that operate on other functions, either by taking them as arguments or by returning them.


##Examples:


**filter():**
```javascript
var animals = [
    { name: 'John', species: 'dog' },
    { name: 'Jane', species: 'cat' },
    { name: 'James', species: 'frog' },
    { name: 'Joe', species: 'horse' },
];

// With a for loop:
var dogs = [];
for (var i=0; i<= animals.length; i++) {
    if( animals[i].species === 'dog') 
        dogs.push(animals[i]);
}

// Functional:
var dogs = animals.filter(function(animal) {
    return animal.species === 'dog';
};

// Another way, decoupling:
var isDog = function(animal) {
    return animal.species ==='dog';
}
var dogs = animals.filter(isDog);

```


**map():**
```javascript
var animals = [
    { name: 'John', species: 'dog' },
    { name: 'Jane', species: 'cat' },
    { name: 'James', species: 'frog' },
    { name: 'Joe', species: 'horse' },
];

// With for loop:
var names = [];
for (var i=0; i<= animals.length; i++) {
    if ( animals[i]-species === 'dog') 
        names.push(animals[i].name);
}

// Functional:
var names = animals.map(function(animal) {
    return animal.name + ' is a ' + animal.species;
});

// Which using ES6 arrow functions can be:
var names = animals.map((animal) =>  { animal.name });
```

**reduce():**
```javascript
var orders = [
    { amount: 250 },
    { amount: 400 },
    { amount: 100 },
    { amount: 350 },
];

// For loop:
var  totalAmount = 0;
for (var i=0; i < orders.length; i++) {
    totalAmount += orders[i].amount;
}

// Functional:
var totalAmount = orders.reduce(function(sum, order) {
    return sum + order.amount;
}, 0);

// Which using ES6 arrow functions can be:
var totalAmount = orders.reduce(sum, order) => sum + order.amount, 0);

console.log(totalAmount);
```


Source: https://www.youtube.com/watch?v=Wl98eZpkp-c
Use hyphenation on Dev.to?
Tags: suggestion, cuttingedge, discuss
Published: 2017-12-19 09:46:08

---
title: Use hyphenation on Dev.to?
published: true
description: 
tags: suggestion, cutting-edge, discuss
---

I think it would be cool to have articles use hyphenation, so their lines are more similar in length.

```css
p {
  hyphens: auto;
}
```

This can be done with CSS today and has basic support from all major browsers. And hey, if a browser does not support it, it's fine, sentences will be displayed just fine. I guess that is the definition of progressive enhancement :)
With a simple @-rule it could be used together with `text-align: justify`! <-- This looks totally awesome and professional. #cutting-edge :)
[Hyphenation documentation on MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/hyphens)

![Hyphenation example](https://thepracticaldev.s3.amazonaws.com/i/aqgkktjaq5yuvdk87xf2.png)

I recently read an article where it was used and I was surprised this is already possible, so I think it would give a really nice experience to most people even though it is only a small addition ❤

What does everybody else think on this?
Kill All Orphans! 
Tags: discuss
Published: 2017-12-19 08:56:18

---
title: Kill All Orphans! 
published: true
description: 
tags: discuss
---

Yes, it's going to be a cheerful x-mas! To be clear, I just meant the last word in the title that goes on a new line all by itself. Maybe I'm just way too bothered by it. 

![Orphans on dev.to](https://thepracticaldev.s3.amazonaws.com/i/si59ht55899vs7wnh3fk.png)
WooCommerce Abandoned Cart Plugin  
Tags: abandonedcart
Published: 2017-12-19 06:31:01

---
title: WooCommerce Abandoned Cart Plugin  
published: true
description: WooCommerce abandoned cart plugin helps you in sending auto emails to customers about incomplete carts.  
tags: Abandoned Cart 
---
<img src="https://thepracticaldev.s3.amazonaws.com/i/6vg4atd4npubfjz1spne.png"</img> 

WooCommerce abandoned cart plugin helps you in sending auto emails to customers about incomplete carts. You can customize the email template such as subject and content of the body to make it more effective. <b><a href="https://codecanyon.net/item/woocommerce-abandoned-cart-plugin/21032154">WooCommerce abandoned cart</a></b> extension also allows you to add discount coupons in emails which encourage customers to complete the abandoned carts. This useful plugin can increase your sales and you can evaluate the success rate through performance report. 
It cost you only $39 and you can get this addon with 100% money back guaranty. 

<b>ScreenShots</b>

<img src="https://thepracticaldev.s3.amazonaws.com/i/r92q8ovcm8t3l1s93vj8.png"</img> 

<img src="https://thepracticaldev.s3.amazonaws.com/i/pgyh3bfwslxdlcagd8ha.png"</img> 

<img src="https://thepracticaldev.s3.amazonaws.com/i/txsmjdcc1l07yayjlbeo.png"</img>


<img src="https://thepracticaldev.s3.amazonaws.com/i/t5gzcgzs4uznqdvcishp.png"</img>
Explain HTML's img srcset vs picture tag Like I'm Five
Tags: explainlikeimfive
Published: 2017-12-19 02:17:48

---
title: Explain HTML's img srcset vs picture tag Like I'm Five
published: true 
tags: explainlikeimfive
---

I'm trying to write a global helper template to automatically serve responsive images across a website. But first: what is the difference between implementing responsive images on a webpage using `<img srcset="..." sizes="...">` versus using a `<picture>` element with `<source>`s?

I found this [MDN article on responsive images](https://developer.mozilla.org/en-US/docs/Learn/HTML/Multimedia_and_embedding/Responsive_images), but it's way too long for me this late in the day. Thanks internet!
Guest Post: Capital One Developer Experience
Tags: crosspost, talkwriteup, api, capitalone
Published: 2017-12-19 00:21:09

---
title: "Guest Post: Capital One Developer Experience"
published: true
tags: Crosspost,Talk writeup,api,capital one
canonical_url: http://www.heidiwaterhouse.com/2017/12/18/guest-post-capital-one-developer-experience/
---

I recently got a chance to write a post about [API hospitality](https://developer.capitalone.com/blog-post/api-hospitality-welcoming-developers-with-documentation/) for the Capital One DevEx blog. It’s always nice to be able to rework a talk into an essay that’s easier for people to refer to.

[![Commit message with smiley face](https://ecm.capitalone.com/DevPortal/assets/images/community/blog/hospitality_header.png)](https://ecm.capitalone.com/DevPortal/assets/images/community/blog/hospitality_header.png)

Welcoming API documentation