teleren/devto huggingface dataset:
Checkout a branch by its id
Tags: git, bash
Published: 2018-07-25 16:44:15

---
title: Checkout a branch by its id
published: true 
tags: [git, bash]
---

When you're working on or peer reviewing or testing, etc more than 2 branches, it's difficult to remember the exact name of every branch and copy/paste is an inefficient option. So, since it's relatively easy to remember the number (id) of the story, we could come up with an alias or better a function to add to our `.bashrc`, `.zshrc` or wherever we keep our favourite aliases.

For that, we need to know the id of the branch we want to checkout.
E.g. if the branch is: `prefix/PPRJ-123/name-of-the-task`, then the *id* is *123*.
Also, we assume the id is unique for the repository.

Gist:
{% gist https://gist.github.com/mariamichou/8e5c153eb58a64f3e309f85fc3da9a13 %}
Clean up unused CSS with PurgeCSS on Laravel and WordPress
Tags: laravel, vue, wordpress, purgecss
Published: 2018-07-25 16:15:40

---
title: Clean up unused CSS with PurgeCSS on Laravel and WordPress
canonical_url: http://cristiannebunu.com/clean-up-unused-css-with-purgecss-on-laravel-and-wordpress/
published: true
description: 
tags: laravel, vuejs, wordpress, purgecss
---

I read recently the article [How I dropped 250KB of dead CSS weight with PurgeCSS](https://medium.freecodecamp.org/how-i-dropped-250kb-of-dead-css-weight-with-purgecss-28821049fb) and thought I should put out my setup for this situation. I use Laravel Mix for both Laravel development and also for my WordPress work. My main stack includes Vue.js and TailwindCSS, so these snippets will do just fine when working with these frameworks. Beyond that, I can’t make any promises.

But as an endorsement to PurgeCSS, I will tell you, that for the past few projects I have done in WordPress, I managed to get my CSS file down to around 50 kB minified.

My Laravel config file looks like this

![laravel config](https://thepracticaldev.s3.amazonaws.com/i/k2owuc8th6x969lbe79p.png)



My WordPress config file looks like this

![wordpress config](https://thepracticaldev.s3.amazonaws.com/i/53i67a8oi9q05y6rv0iy.png)


_Originally published at [cristiannebunu.com](http://cristiannebunu.com/clean-up-unused-css-with-purgecss-on-laravel-and-wordpress) on July 25, 2018_
Docker Tutorial: Play with Containers
Tags: docker, linux, beginners, discuss
Published: 2018-07-25 16:08:12

---
title: Docker Tutorial: Play with Containers
published: true
description: 
tags: #docker #linux #beginners #discuss
---

Docker has had a huge impact on software development life cycle, making the deployment of software at scale easy and secure. This Docker tutorial will cover the basics of running, starting, stopping, and removing Docker containers.
Docker makes it so easy to work with different programming languages with different versions on different operating systems all this on the same host.

Deploying your software becomes a lot easier after Docker where you don’t have to worry about missing a system configuration or a prerequisite.

1 Docker VS Virtual machine
2 Run your container
3 Run a process inside a container
4 Running a random quotes container
5 Listing containers
6 Stopping and starting containers
6.1 How do you get the container ID?
7 Removing containers

https://likegeeks.com/docker-tutorial/

Hope you like it.
Regards,
Using Chrome as a Local Web Server
Tags: devtips, html, css, webdev
Published: 2018-07-25 14:58:37

---
title: Using Chrome as a Local Web Server
published: true
description: Chrome version 65+ can double as a local static web server
tags: devtips, html5, css, webdev
---
![](https://cdn-images-1.medium.com/max/1600/0*erRMD6BIN-e9knR4.)
Many web developers like me utilize **Chrome Developer Tools** as a versatile tool for web development. It comes in quite handy for making live **CSS** or **HTML** changes or analyzing web pages. Chrome release 65 gave us a long awaited and nifty tool for overriding resources used by web pages and replacing them with our own local resources. For example you can override a **CSS** file used by a web page and make local changes to the **CSS** file. Any change you make to **CSS** properties is reflected live in the web browser.

A little known fact is that this local override feature can be used to create a web server to serve static web pages...

[Read my article on Medium](https://medium.com/@jmatix/using-chrome-as-a-local-web-server-af04baffd581)
Explain the difference between PATCH and PUT Like I'm Five
Tags: explainlikeimfive
Published: 2018-07-25 12:57:27

---
title: Explain the difference between PATCH and PUT Like I'm Five
published: true
tags: explainlikeimfive
---

Secondary question: is the difference (if any) still relevant? (Asking because Ruby on Rails seems to treat both the exact same way)
iOS Continuous Integration Setup with Git, GitHub, Travis CI, TDD, Xcode [S01 Extras]
Tags: ci, git, swift, tdd
Published: 2018-09-28 04:39:10

---
title: iOS Continuous Integration Setup with Git, GitHub, Travis CI, TDD, Xcode [S01 Extras]
published: true
tags: ci, git, swift, tdd
canonical_url: https://www.essentialdeveloper.com/articles/ios-continuous-integration-setup-with-git-github-travis-ci-tdd-xcode-s01-extras
cover_image: http://static1.squarespace.com/static/5891c5b8d1758ec68ef5dbc2/58921b5a6b8f5bd75e20b0f4/5b58672103ce643e105d2a94/1532521068571/thumbnail_4.png?format=1000w
---

{% youtube XMPOns7VIXI %} [Watch on YouTube](https://www.youtube.com/watch?v=XMPOns7VIXI&list=PLyjgjmI1UzlSUlaQD0RvLwwW-LSlJn-F6)

In this episode, we set up a Continuous Integration (CI) pipeline for our Quiz project.

The goal for this initial setup and integration with GitHub is to guarantee we only merge changes that don’t break the build and are passing all tests. There is a lot more we can do with CI servers, for example, automate the build, upload and deploy of the app to TestFlight or even the AppStore.

_Continuous Integration_ is just the beginning, as _Continuous Build_ and _Continuous Deployment_ (and rollback!) are higher goals we want to achieve. Such automated checks can save us precious time and can be **vital to a harmonious collaboration** when developing apps in a team. It can also significantly improve **trust** and **transparency** with the business side, where we can, during development, **deploy versions of the app several times a day** to the broader team.

• GitHub Marketplace: [https://github.com/marketplace](https://github.com/marketplace)  
• Travis CI: [https://travis-ci.com](https://travis-ci.com)

[Subscribe now to our Youtube channel](https://www.youtube.com/essentialdeveloper?sub_confirmation=1)and catch **free new episodes every week**.


* * *

Originally published at [www.essentialdeveloper.com](https://www.essentialdeveloper.com/articles/ios-continuous-integration-setup-with-git-github-travis-ci-tdd-xcode-s01-extras).

We’ve been helping dedicated developers to get from low paying jobs to **high tier roles – sometimes in a matter of weeks!** To do so, we continuously run and share free market researches on how to improve your skills with **Empathy, Integrity, and Economics** in mind. If you want to step up in your career, [access now our latest research for free](https://www.essentialdeveloper.com/courses/career-and-market-strategy-for-professional-ios-developers).


## Let’s connect
If you enjoyed this article, visit us at [https://essentialdeveloper.com](https://essentialdeveloper.com) and get more in-depth tailored content like this.

Follow us on: [YouTube](https://youtube.com/essentialdeveloper) • [Twitter](https://twitter.com/essentialdevcom) • [Facebook](https://facebook.com/essentialdeveloper) • [GitHub](https://github.com/essentialdevelopercom)
Chatbot Training Data Set
Tags: chatbottraining
Published: 2018-07-25 11:44:19

---
title: Chatbot Training Data Set
published: true
description: Cogito is providing Chatbot training data sets for developing virtual chatbot applications for various industries like Ecommerce, Healthcare and Machine Learning.
tags: Chatbot Training
---

Cogito is providing Chatbot training data sets for developing virtual chatbot applications for various industries like Ecommerce, Healthcare and Machine Learning. Cogito is experienced in in gathering, classifying and processing the different types and quality of [chatbot training data set](http://www.cogitotech.com/services/chatbot-training-data/) with high-quality data to make sure the Chatbot works properly with best response. 

Cogito has work force of highly skilled data scientist to collect and classify such data for training of machine learning and other AI-based software system to work autonomously without human intervention to assist users in solving their queries instantly with most relevant answers. Cogito use best quality of datsets as per the customize needs of the different customers.
The rule of three - minus one
Tags: design, unittesting, embedded, cpp
Published: 2018-07-25 11:11:52

---
title: The rule of three - minus one
published: true
description: APIs design
tags: design, unit testing, embedded, cpp
---

Many know Jeff Atwood, some know his rule of three. Yes! Yet another golden rule, you need to memorize in your coding adventure.

Ladies and gentlemen here it is [The Rule Of Three](https://blog.codinghorror.com/rule-of-three/)

#Unit tests
Now, that we have laid the basis let's consider who could be the first audience.
How about being an audience to ourselves by unit testing our API? 

I hear you saying that this not by the book unit testing and I agree. According to the definition unit tests should exercise individual units of source code. These are commonly understood as a functions or class methods. However, nothing stands in the way of crafting a larger snippets of code, which would use our API in a real-life flow and integrate it into our build acceptance test suite.

#Case study
Recently, I have had a chance to write an event manager for the framework I am working on. This task required me to develop multiple interfaces: producer, consumer, event manager, event messages. 
##Design
I have designed everything "on paper", wrote a code, compiled and was satisfied with the work being partially done.
The project I am working on has a requirement to push code only with unit tests. So I started to write my test suite. That's where I got hit by my "design decisions" or lack of them.
##Issues
Unit tests I was developing were testing some basic real-life flows: add producers to event manager, add consumers, add messages, raise events etc. Since the design was mainly focused on interfaces and the implementation was done in abstract classes, I needed to implement classes that derive from producer, consumer, and messages class. That is how my dummy classes (DummyProducer, DummyConsumer, etc.) were created.
It turned out that I did not include a object lifetime and ownership into consideration, which is not a trivial issue in the C++. I was using references to pass a producer into event manager, but it turned out to be a complete failure. Some refactoring and I switched to shared pointers - which I consider a good solution (for now) - since it is safer in asynchronous event handling.
Next, the message. Sure, I can pass the message, but what about its payload? Who should control the payload lifetime? It turned out I needed to create a proxy class, that stored the payload (which can differ from event to event) and pass it to the event carrying class.
The above examples were some of the more significant issues I have found in my design, there were even more minor details I needed to polish.

#Conclusion
I was working on an embedded system for the framework project and it took a while to setup unit test environment. In addition to that, my test suites seem more like an example application than standard unit test. Was it worth it to over-complicate testing like this? I would said yes! It let me gain the perspective to and put myself in API users shoes. Definitely I would do that again!
What kind of content do you want to see more of on Dev.to?
Tags: content, discuss
Published: 2018-07-25 10:34:55

---
title: What kind of content do you want to see more of on Dev.to?
published: true
description: Giving you a voice, and content creators a pool of ideas
tags: content, discuss
---

I've got a few ideas floating around I'll never get to, and some things I want to see, so I wanted to hear from you folks as well. Figured this could be a useful resource for new people here that don't have any topic ideas :)

I'll leave my suggestions in the comments, and you do the same.

As a bonus, the replies to comments should be links to articles scratching that particular itch, in case the original commenter didn't see the article before!
How to use Docker on windows using VMware Workstation (without hyper-v)
Tags: docker, dockermachine
Published: 2018-07-25 10:26:35

---
title: How to use Docker on windows using VMware Workstation (without hyper-v)
published: true
description: 
tags: docker,docker-machine
---

I was using docker for windows for a while but it's network adapters doesn't work well for me. causes DNS problems and ....
So I tried to use Docker without hyper-v and came up with this idea of using docker with vmware workstation.

This is how to setup a simple environment:

1. Install VMware Workstation
2. Download Docker binaries from https://download.docker.com/win/
3. Download Docker machine binaries from https://github.com/docker/machine/releases
4. Download Docker Machine Vmware Workstation driver form https://github.com/pecigonzalo/docker-machine-vmwareworkstation/releases
5. Extract & Move downloaded files to a directory in your path
6. Execute `docker-machine create --driver=vmwareworkstation dev` in cmd to create a machine
7. Execute `docker-machine env dev > dockerdev.bat` in cmd to create a batch file called dockerdev.bat and copy/move it to your path
8. Execute the batch file created in step 7 (dockerdev)
9. Use `docker` as usual
How to write a good Technical Document for Project ou Handover?
Tags: technicaldocuments, highleveldocument, lowleveldocument, discuss
Published: 2018-07-25 09:42:03

---
title: How to write a good Technical Document for Project ou Handover?
published: true
description: Technical Documents are long and boring and many times do not have the data which we are actually looking for
tags: technical documents, high level document, low level document, discuss
---

I have been wondering what is the best way to write a technical document. I have gone through several of them on Google and even asked for some samples from friends but when I read them as a programmer I do not feel them to be as useful as I want them to be. They are just the documents which are long and boring. I have tried to get a new format created. I need feedback on the same. 

This document is simple, it has the major flow of the application and along with that it has the major database table and field names which are being affected. Since it has been developed by me, I might be biased towards it, so I was wondering if you can have a look into the same and provide your feedback. 

![Technical Document Flow] (https://thepracticaldev.s3.amazonaws.com/i/3rcg2ym842wfsy65zpcf.png)
Adding Spring Boot Rest locale Query Param
Tags: spring, java, rest, locale
Published: 2018-07-25 07:20:27

---
title: Adding Spring Boot Rest locale Query Param
published: true
description: Spring Boot Locale
tags: spring,java, rest, locale
---
As part of a recent project I’ve been working on we had the requirement to be able to change the locale of the response from our endpoints without the need to actually change the underlying browser locale.

Thanks to some Spring magic, to achieve this I extended the [HandlerInterceptorAdapter](https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/web/servlet/handler/HandlerInterceptorAdapter.html) abstract class to allow me to handle any incoming requests.

```java
@Override
public boolean preHandle(HttpServletRequest request, 
                         HttpServletResponse response, Object handler)
{
    // set request locale here
    return true;
}
```

From within the preHandle override I took the locale query parameter and set the set the locale on [LocaleResolver](https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/web/servlet/LocaleResolver.html) to that taken from the query param.

The code looks a bit like this:

```java
Locale localeFromRequest = RequestContextUtils.getLocale(request);

String queryParameterLocale = request.getParameter("locale");

if (queryParameterLocale != null) {
   localeFromRequest = StringUtils.parseLocaleString(queryParameterLocale);
}

// set the new locale
LocaleResolver localeResolver = RequestContextUtils.getLocaleResolver(request);
localeResolver.setLocale(request, response, localeFromRequest);

```

Finally, in order to activate the newly added Interceptor adapter you need to add it to your [WebMvc](https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/servlet/config/annotation/WebMvcConfigurerAdapter.html) configuration. See the example below, in my case I’ve named my interceptor RequestLocaleInterceptor.

```java
@Configuration
public class WebMvcConfiguration extends WebMvcConfigurerAdapter
{
    @Autowired
    private RequestLocaleInterceptor requestLocaleInterceptor;

    /**
     * {@inheritDoc}
     */
    @Override
    public void addInterceptors(InterceptorRegistry registry)
    {
        registry.addInterceptor(requestLocaleInterceptor).addPathPatterns("/**");
    }
}
```

From then on any REST calls automagically inherit the locale query parameter that sets the locale context.

For example: GET /rest/orderDetails?locale=fr_FR
Reverse a Word.
Tags: string, array, twopointers, algorithm
Published: 2018-07-25 02:02:03

---
title: Reverse a Word.
published: true
description: 
tags: String, Array, Two Pointers, Algorithm
---

I wrote couple of posts previously [here](https://dev.to/s_awdesh/finding-duplicates-in-a-given-range-of-elements-d60) and [here](https://dev.to/s_awdesh/check-if-duplicate-exists-inside-a-sorted-array-3aa5) on how to find duplicates in an array and we saw different variety of that problem. I want to switch gear now to string related problems. Previous posts on arrays built a good foundation for us to solve string related problem because string is an essentially an array of characters.

We are given a word which contains only alphabetical characters. Considering string is an array of characters and one of the biggest advantage and vital key to solve certain array problems is to iterate an array from forwards and backwards at the same time. 

We can use two pointers where one pointer start from beginning and other pointer move inwards from end of the array.


![palindrome](https://thepracticaldev.s3.amazonaws.com/i/j5sns0ihrcrrrxwz2lvl.jpeg)



This information is vital to solve this problem. Let’s use that algorithm and write down code.

{% replit @AwdeshSharma1/SickJumpyMinimalsystem %}

Could we use the same algorithm to reverse words inside a sentence? e.g. "This is a word" should change into "word a is This" by the algorithm.
If we split the string by a whitespace we'll get an array of strings and then we can use above algorithm to reverse a sentence.


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

Another problem where we could utilize same algorithm is to solve string palindrome problem. A word is a palindrome when it reads same from backwards as forward e.g. kayak, noon etc.

Now we know that we can traverse a string from forwards and backwards, we can use that knowledge to solve palindrome problem. 

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



This is it for this post. I plan to write more on string related problems in my next posts. 

Stay tuned. :)
I love coding history books. Here are some I'd recommend.
Tags: history, books
Published: 2018-07-25 01:34:13

---
title: I love coding history books. Here are some I'd recommend.
published: true
description: These are books that focus a bit more on technical characters, as opposed to business leaders, and they're all good reads.
tags: history, books
cover_image: https://thepracticaldev.s3.amazonaws.com/i/z9ua6pd5qr15fnsy68w5.png
---

This is not an exhaustive list, but these are a few code history books I really like. These are books that focus a bit more on technical characters, as opposed to business leaders, and they're all good reads. Some are better than others, but I really liked all of these for different reasons.

Some are more distant history, and a couple are more contemporary accounts.

[The Innovators: How a Group of Hackers, Geniuses, and Geeks Created the Digital Revolution](https://www.amazon.com/Innovators-Hackers-Geniuses-Created-Revolution/dp/1476708703)

[Where Wizards Stay Up Late: The Origins of the Internet](https://www.amazon.com/Where-Wizards-Stay-Up-Late/dp/0684832674)

[Hackers: Heroes of the Computer Revolution](https://www.amazon.com/Hackers-Computer-Revolution-Steven-Levy/dp/1449388396)

[Masters of Doom: How Two Guys Created an Empire and Transformed Pop Culture](https://www.amazon.com/Masters-Doom-Created-Transformed-Culture/dp/0812972155)

[Weaving the Web: The Original Design and Ultimate Destiny of the World Wide Web](https://www.amazon.com/Weaving-Web-Original-Ultimate-Destiny/dp/006251587X)

[Ghost in the Wires: My Adventures as the World’s Most Wanted Hacker](https://www.amazon.com/Ghost-Wires-Adventures-Worlds-Wanted/dp/0316037729)

[The Victorian Internet: The Remarkable Story of the Telegraph and the Nineteenth Century's On-line Pioneers](https://www.amazon.com/Victorian-Internet-Remarkable-Nineteenth-line/dp/162040592X)

[Flash Boys: A Wall Street Revolt](https://www.amazon.com/Flash-Boys-Wall-Street-Revolt/dp/0393351599)

If I had to pick, I would recommend _The Innovators_ as the first to read from the list because it covers a lot of ground, and Isaacson is a great writer. However, I'd say these can be read in any order. I'll edit this list if I think of any I missed. Feel free to add any more goodies to the comments.
Hi, I'm Santosh Desani
Tags: introductions
Published: 2018-07-25 00:16:28

---
title: Hi, I'm Santosh Desani
published: true
description: 
tags: #introductions
---

I have been coding for little over 6 years.

You can find me on Twitter as @SantoshDesani

I live in Kansas City, USA.

I mostly program in these languages: Java/Groovy/Ruby.

I am currently learning more about Public APIs, more on OpenDev, SRE and Machine Learning.

Nice to meet you.