teleren/devto huggingface dataset:
Getting involved in projects to add to my CV (resume) & portfolio
Tags: webdev, frontend, backend, networking
Published: 2018-12-18 11:21:43

---
title: Getting involved in projects to add to my CV (resume) & portfolio
published: true
description: 
tags: #webdev, #frontend, #backend, #networking
---

Hi guys, I'm new here and was wondering what the best way is to get some projects under my belt for discussing in interviews and to give me experience in working collaboratively with others?

I'm fairly knowledgeable about the fundamentals of web dev (HTML, CSS, js) but I'm wanting to put it into practice and work with others to learn some other tricks and workflow tips.

I have a background in working with networking so some backend advice/projects would also be interesting to me.

Thank you in advance!
Management GUI for Elasticsearch
Tags: elasticsearch, elasticsearchhq, cerebro
Published: 2018-12-18 09:58:06

---
title: Management GUI for Elasticsearch
published: true
description: Management GUI for Elasticsearch
tags: elasticsearch, elasticsearch-HQ, Cerebro
---

## Preface

Elasticsearch is a developer-friendly, with minimal configuration & manual management. But sometimes we still want to know more about our cluster.

You can fetch these information from elasticsearch APIs, so if you're a elasticsearch API ninja you can skip this article.

Here are some tools that I prefer, to help me to quickly get the overview of the cluster.

## Prerequisite

Usually our cluster is located in private VPC, so we have to port-forward to our local machine.

What I usually do is to forward the kubernetes API to my local machine, and use `kubectl port-forward` to handle the rest.

```shell
    # I modified the kubeconfig to use port 16443 for remote environments
    $ ssh -L 16443:127.0.0.1:6443 ssh-jumper
    
    # port-foward elasticsearch to localhost
    $ kubectl -n logging port-forward elasticsearch-data-0 9200:9200
    
    # check if it's ready
    $ curl localhost:9200
```

## ElasticHQ

[http://www.elastichq.org/](http://www.elastichq.org/)

ElasticHQ is an open source application that offers a simplified interface for managing and monitoring Elasticsearch clusters.

```shell
    $ git clone https://github.com/ElasticHQ/elasticsearch-HQ.git
    $ cd elasticsearch-HQ
    
    # Python 3 is required.
    $ sudo pip3 install -r requirements.txt
    $ python3 application.py
    
    # Access HQ with: http://localhost:5000
    # If you're using docker version, access ES via host.docker.internal:9200
```

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

In this page we can check the cluster load, free space & heap usage. Also check the size of each indices, document count and total storage size.

Another goodie is the `Diagnostics` tab. HQ will highlight those metrics with potential risk and give you some advices. This can be a reference when you're troubleshooting or doing performance tuning on your elasticsearch cluster.

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

## Cerebro

[https://github.com/lmenezes/cerebro](https://github.com/lmenezes/cerebro)

```shell
    # Java 1.8 or newer is required. brew cask install java
    # Download the latest tarball from https://github.com/lmenezes/cerebro/releases/latest
    $ wget https://github.com/lmenezes/cerebro/releases/download/v0.8.1/cerebro-0.8.1.tgz
    $ tar zxvf cerebro-0.8.1.tgz
    $ cd cerebro-0.8.1
    $ ./bin/cerebro
    # Open cerebro with http://localhost:9000
    # If you're using docker version, access ES via host.docker.internal:9200
```

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

I usually use Cerebro to observe the index shards allocation. It's clear and intuitive.

And the `cluster settings`, `aliases` and `index templates` under more menu come handy when you need them.

![](https://thepracticaldev.s3.amazonaws.com/i/0eli3j6ls7qrvte3yqsk.png)
I dis-agree to all Google's Terms and Policy
Tags: google, security, data, discuss
Published: 2018-12-18 07:49:00

---
title: I dis-agree to all Google's Terms and Policy
published: true
description: Google CEO Sundar Pichai testifies before the House Judiciary Committee
tags: google, security, data, discuss
cover_image: https://thepracticaldev.s3.amazonaws.com/i/z2gry2jy42amimjfhe0u.png
---

Google is tracking you everywhere...

{% youtube zIniYSkAWo0 %}

What do you think about Google now?

It is collecting so much of data from different sources that you don't even know about it.

Before watching this video, I have already transitioned from Google Search to DuckDuckGo, but the journey doesn't end here, there are lot more Google products I am currently using, some of them can be stopped or I can move to other service.

Not all products are worth leaving, for example: Youtube is Awesome.

What do you think about their alternatives. Any suggestions?

1. Search -> DuckDuckGo
2. YouTube -> ?
3. G-Mail -> ?
4. Mobile _(Android)_ -> ?
5. Calendar -> ?
6. Photos -> ?
7. Notes -> ?
8. Drive -> ?
9. Maps -> ?
10. Google Pay -> ?
11. Google Duo -> Discord
12. Google Plus -> Twitter
13. Youtube live stream -> Twitch
14. Chrome browser -> Firefox
AoC Day 18: Settlers of The North Pole
Tags: adventofcode, discuss
Published: 2018-12-18 07:18:16

---
title: "AoC Day 18: Settlers of The North Pole"
published: true
description: "Day 18: Conway returns, but with lumber!"
cover_image: https://thepracticaldev.s3.amazonaws.com/i/530l98sdhc68aj869y5y.png
tags: adventofcode, discuss
series: Advent of Code 
---

That darn Conway is persistent, isn't he?!  That's right, [Day 18](https://adventofcode.com/2018/day/18) is looking like the return of Conway, but in  2 dimensions, and with 3 possible states (Open Ground, Wooded Acre, and Lumberyard) as opposed to the less complicated Alive or Dead we saw a few days ago.

It'll be interesting to see if the [repeating semi-stable shapes](https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life#Examples_of_patterns) that we see in a normal 2D Conway's Game of Life are present here or how having 3 possible states affects them.

Good luck!  I *wood* love to see your solutions!  🎄
SASS Ampersands
Tags: sassampersands
Published: 2020-04-07 14:25:13

---
title: SASS Ampersands
published: true
date: 2018-12-18 06:00:00 UTC
tags: SASS Ampersands
canonical_url: https://jibrankalia.com/blog/sass-ampersands/
---

One of the many reasons I love working at Scalefactor is that I get to work extensively both in the front-end and the back-end. That being said at the moment, the back-end is my stronger suit. That is why you might see a lot more front-end related posts here as I try to level up in that area. Going back to SASS. Here is something small I learned today. Borrowing the explanation below from [CSS-Tricks](https://css-tricks.com/the-sass-ampersand/).

Here is a simple nesting example that works in SASS:

```
.parent {
  .child {}
}
```

Which is compiled to in css:

```
.parent .child {}
```

What about when we use an `&`

```
.first-parent {
  &.second-parent {}
}
```

Which is compiled to in css:

```
.first-parent.second-parent {}
```

The difference between the two is that in the second example we are selecting an element that has **both** classes: `first-parent` and `second parent`.

I like to think of `&` as copying the parent selector and pasting it next to the child selector. This gets interesting when used along with [BEM CSS Methodology— Block Element Modifier](http://getbem.com/introduction/). More on that later.

There are a lot more uses of `&` in sass. This article in [CSS-Tricks](https://css-tricks.com/the-sass-ampersand/) does an amazing job explaining everything.

Thank you for reading!
Very new old programmer
Published: 2018-12-18 05:15:44

---
title: Very new old programmer
published: true
description: Ex-Academic neo-programmer
tags: 
---
Python
Java
Visual.net
Ruby

Hello I am Mohammed , And I am an old programmer.
(Sound of the crowd :hello Mohammed) , (spokeman of the Programmer anonymous : now tell me your story).

Ok ok , its not like that but the truth is I used to be a researcher and suddenly when I went freelance Im all over the place.

With theory principles , procedural programming , object orientism , SDLC (old school baby).
All the same but when I sit beside an IDE I freeze , why ? Simple . they dont tell you the truth .
Programming is an idea , building blocks , script written oit of experience accumulated andaggregated.

But they montage all this .

The truth I had several mini encounters with Ruby , Python , Raspberry pi etc however in my mind it was all null since I couldn't complete them .

ADHD might be a part of the problem , but its self Imagery .
A programmer is not a developer .
A developer has an approach that translates theoritical to code.
Any way thats part of my story .
Now Im on the saddle again going wheee hah on my Platform Github.
Wish me luck guys in my 1 man voyage to the unknown .
[Video] Visualizing data at scale with Google Data Studio
Tags: dataviz, bigdata
Published: 2018-12-18 04:14:46

---
title: [Video] Visualizing data at scale with Google Data Studio
published: true
description: Developer Advocate Minhaz Kazi explains how to connect, visualize, and share big datasets using Data Studio.
tags: dataviz, bigdata
---

Developer Advocate Minhaz Kazi explains how to connect, visualize, and share big datasets using Data Studio.

{% youtube Sv8d0gKn63U %}
Using 'null' in SASS/SCSS Mixins to Mute Arguments
Tags: css, sass, frontend, webdev
Published: 2018-12-18 03:58:08

---
title: Using 'null' in SASS/SCSS Mixins to Mute Arguments
published: true
description: Create DRY, and optimized mixins with arguments and the 'null' keyword.
tags: #css #sass #frontend #webdev
---
#The Discovery
I'm working on styling some boxes, something front-end web developers are (_should_) be familiar with. I use SASS to write my CSS. I needed some rounded corners so I wrote a mixin that looks like this:

{% gist https://gist.github.com/NickersF/94c292276c039e8be3a83562daa69c7f %}

#The Issue & Dirty Solution
I included the mixin in a CSS class to see my result.

{% gist https://gist.github.com/NickersF/3ef54360ef3ef4a43dcb2880f9e2c378 %}

In the browser the result was what I expected. Eight pixel rounded borders on my box. However, for one of the boxes I was working on I only needed the `top-left` and `top-right` corners rounded so I set the `bottom-left` and `bottom-right` arguments to `0px` and again, the result was correct in the browser; sharp bottom corners and nice eight pixel rounded top borders. Oh yeah, the CSS compiled without errors too.

{% gist https://gist.github.com/NickersF/0ed44e8b5f6efd0a49e7b8b9160ece8d %}

#The Optimization
I do my best to work in a _mobile first mindset_, I value optimization and performance. With my rudimentary understanding of the compilation process from SASS to CSS I suspected that setting the arguments of the mixin to a `0px` value would keep the two unneeded CSS rules in the compiled CSS.

{% gist https://gist.github.com/NickersF/bea1812cfe4fd60ef7f2a5da4cd07756 %}

I was right.

This could add up quickly and generated many extra line of CSS that are not needed. I decided to test something, something I have picked up during my CS education: **Try `null` and see what happens** in a situation like this. `null` appears in many programming and scripting languages and can be powerful in the right situations.

I changed my include to this:

{% gist https://gist.github.com/NickersF/6fcf3b0a3dcc380df83335c4f0c35d06 %}

and compiled the code. No error! Being somewhat proud of myself and excited I looked into the compiled .css file and found the following (_and desired_) result:

{% gist https://gist.github.com/NickersF/dc4f6045179ff81e33b1aaca1c011304 %}

#Conclusion
For this example we ended up with two less lines of CSS. However, at scale this could save thousands of lines of unneeded CSS. This also makes minifying more rewarding.

I hope this was useful for some people who like squeezing more optimization out of their front-end code.

_**If you enjoyed this content and want to support a poor freelancing student so I can eat and produce more content in the future, I accept donations via [PayPal](https://paypal.me/btsourcepdx)**_
Rustic OLED on the Nucleo
Tags: rust, embedded, solokeys
Published: 2018-12-18 01:52:04

---
title: Rustic OLED on the Nucleo
published: true
description: 
tags: Rust, embedded, SoloKeys
---

`Actual date: 2018-12-17 and 2018-12-18`

Since my [USB device efforts](https://github.com/nickray/stm32l432-usb/commit/46bb0e30d2cf07f332b815ffca8f4f72d182cdb3) have not led anywhere so far, I diverted my efforts to get an OLED up and running, still on the STM32L4 platform. Eventually, it will be nice to have a [Solo key](https://solokeys.com/preorder/) with an integrated display!

Scott Mabin recently added [I2C support](https://github.com/stm32-rs/stm32l4xx-hal/commit/2d65137a242ddc8c52948d1d6994c7465eaa776b) to his HAL, so I got everything ready quickly. It DID NOT WORK!!!!

Well. First, I bought a very cheap soldering iron and did a horrible job (first solder experience in over two decades) of attaching the pins to my 0.91" 128x32 OLED (with an [SSD1306](https://github.com/jamwaffles/ssd1306) chip). Still, did not work!

Then, I discovered the 0.96" 128x64 OLED with the same chip was already pre-soldered... again, DID NOT WORK!

(...)

The next day, I finally followed both [Conor's](https://conorpp.com/) and [Scott's](https://github.com/stm32-rs/stm32l4xx-hal/issues/24) advice in trying different I2C addresses. A quick search suggested using `0x78` (which is 2*`0x3c`, which all the data sheets mention) for cheap Chinese clones such as mine, and ta-daa! Success!

![SoloKeys logo on OLED, courtesy of Rust](https://thepracticaldev.s3.amazonaws.com/i/ii3804sqawlqo0cb2xfz.jpeg)

## Further outcome of non-immediate success
- I want [this soldering iron](http://www.miniware.com.cn/product/ts80-soldering-iron-more/)
- I nearly want [this oscilloscope](https://www.reichelt.com/de/en/digital-storage-oscilloscope-50-mhz-4-channels-1gs-s-rigol-ds1054z-p239301.html?ARTICLE=239301&&r=1)
- I watched way too much [eevblog episodes](http://www.eevblog.com/)
- I ordered more (cheap) stuff...
- My girlfriend is calling me nutty professor again :D
2018: Year In Review
Tags: discuss, webdev, yearinreview
Published: 2018-12-18 01:30:08

---
title: 2018: Year In Review
published: true
description: A review post of how your career progressed in 2018
tags: #discuss #webdev #yearinreview
---

We are 12 days away from the end of another phenomenal year. I am going to write a **Year In Review** post in a week and tag it with `#yearinreview` hashtag. I encourage everyone else to do so as well. It will give you an opportunity to look back at what this year has brought for you and set some realistic goals for next year.

I will keep my post limited to this context but it can be anything you want to write about.

- career progress
- goals set
- goals smashed
- goals overdue
- new things learnt
- new achievements unlocked
- old things taken care of
- anything that made you happy

It's all about growing together.
Flattening an Array, a Performance Test
Tags: javascript, arrays, performance
Published: 2018-12-17 21:47:46

---
title: Flattening an Array, a Performance Test
published: true
description: What's the most efficient way to flatten an array?
tags: javascript, arrays, performance
---

## The Question

What is the most efficient way to flatten an array in Javascript? This questions comes up often in interviews and also has some practical use cases, which is rare for interview questions.

By "flattening" an array, we mean taking a multidimensional array and turning it into a regular "single" dimensional array. I'm not sure if that is the right phrasing but I'm going with it. See an example below.

```javascript
let initialArray = [[0, 1], [2, 3], [4, 5]];

let flattenedArray = [0, 1, 2, 3, 4, 5]
```

## Possible Solutions

So what is the most efficient way to go about this? Well I sketched out four possible solutions.

Solution 1: Concat + Apply

```javascript
let flattenedArray = Array.prototype.concat.apply([], initialArray);
```

This is a fairly simple one line solution. We create a new array and concat each element onto it. 

Solution 2: Use a Reduce

```javascript
let flattenedArray = initialArray.reduce((a, b) => {
  return a.concat(b);
});
```

We execute a concat function on each first level element in the array. Then concat it onto the previous element. Giving us a new flattened array.

Solution 3: The Faithful Loop

```javascript
let flattenedArray = [];
for (let i = 0; i < initialArray.length; i++) {
  let current = initialArray[i];
  for (let j = 0; j < initialArray.length - 1; j++)
    flattenedArray.push(current[j]);
}
```

The most basic solution. We loop through the first level arrays, loop through the internal arrays and push them up to an empty array. I should note, this is a lot more written code than our other solutions.

Solution 4: A ForEach Loop

```javascript
let flattenedArray = [];
initialArray.forEach(entry => {
  flattenedArray = flattenedArray.concat(entry);
});
```

A little more modern approach. We loop through each first level array, concat it with the other and reassign the flattenedArray.

## Testing the Results

So which is the fastest?

Full test results [here](https://jsperf.com/flatten-array-tests-by-rgd) . Wow! The old fashioned "for" loop was by far the fastest. 

![Test results](https://thepracticaldev.s3.amazonaws.com/i/t5lloz0gcaw6irck7rqb.png)

Going be a straight operations per second metric the classical for loop performs best! This was actually fairly shocking to me. Does anyone have a better flattening method?
When a relative asks you, 'What you do for work?' What do you say?
Tags: discuss
Published: 2018-12-17 22:44:31

---
title: When a relative asks you, 'What you do for work?' What do you say?
published: true
description: And dear, what is your job about?
tags: discuss
---

__"Something with Computers"__, is that what you say? 

I always try to explain what I do, but sometimes realise that I lost them not even half way through.

Since we get closer to Christmas, it is the time where we have these conversations with a lot of relatives who may have not seen you for a while.

How do you explain your job?

Or to make it simpler: Explain me your job, like I'm from a different generation. 😉
A simple linked list by 9 lines of code
Tags: ruby, enumerable, datastructure, linkedlist
Published: 2018-12-17 21:36:05

---
title: A simple linked list by 9 lines of code
published: true
description: 
tags: ruby, enumerable, data-structure, linked-list
---

Today I read [Ruby's magical Enumerable module](https://blog.appsignal.com/2018/05/29/ruby-magic-enumerable-and-enumerator.html) from AppSignal. It clearly explains the subject. And It gives a short code for linked list, I like it.

```ruby
class LinkedList
  def initialize(head, tail = nil)
    @head, @tail = head, tail
  end

  def <<(item)
    LinkedList.new(item, self)
  end

  def inspect
    [@head, @tail].inspect
  end
end
```

```ruby
irb> LinkedList.new(73) << 12 << 42
=> [42, [12, [73, nil]]]
```

And then with a each method and a include, You can make it Enumerable.

```ruby
class LinkedList
  include Enumerable

  def initialize(head, tail = nil)
    @head, @tail = head, tail
  end

  def <<(item)
    LinkedList.new(item, self)
  end

  def inspect
    [@head, @tail].inspect
  end

  def each(&block)
    block.call(@head)
    @tail.each(&block) if @tail
  end
end
```

```ruby
irb> list = LinkedList.new(73) << 12 << 42
=> [42, [12, [73, nil]]]
irb> list.count
=> 3
irb> list.max
=> 73
irb> list.map { |item| item * item }
=> [1764, 144, 5329]
irb> list.select(&:even?)
=> [42, 12]
```

I like the gradually way of explaining code. And you?
Swift Development Tips — Speculid & Try!Swift NYC 2018
Tags: swift, xcode, devops, ios
Published: 2018-12-17 21:15:23

---
title: Swift Development Tips — Speculid & Try!Swift NYC 2018
published: true
description: I gave a talk on swift development tips and specifically developing Speculid and Try!Swift New York.
tags: swift, xcode, devops, ios 
cover_image: https://cdn-images-1.medium.com/max/1600/0*DTn5RmDpK2op801S
canonical_url: https://learningswift.brightdigit.com/swift-development-tips-speculid-tryswift/
series: Building Icons and Images
---

[On October 11,](https://learningswift.brightdigit.com/speaking-a2-speculid-tryswiftnyc/) I spoke at [Ann Arbor Cocoaheads](https://www.meetup.com/A2-CocoaHeads/events/254589885/) at ArborMoon and gave some swift development tips. Specifically based my experience developing [Speculid](https://speculid.com/?utm_source=learning-swift&utm_medium=post) for macOS as well as [Try!Swift New York.](https://learningswift.brightdigit.com/swift-thoughts-tryswift-nyc-2018/)

{% youtube _FDZBfeeJuU %}

> *Leo will share some thoughts on the challenges in building Speculid, such as using C++ libraries in a Swift app, continuous integration (Travis-Ci) and more. He’ll also be freshly back from TrySwift in NYC and will share some of his observations on the Swift community.*

If you are interested in the videos from Try!SwiftNYC 2018, they [are posted on youtube](https://www.youtube.com/playlist?list=PLCl5NM4qD3u8NyOjK0deNu4AQk2hgyhjS). You can also access [my slides](https://www.dropbox.com/s/214oa7zo42aul0b/Swift Development Tips with Speculid and Try!Swift NYC - Slides.zip?dl=0) as well.

Be sure to check our other posts on [managing graphics for Xcode](https://learningswift.brightdigit.com/category/building-icons-and-image-sets/) as well as the [development of Speculid](https://learningswift.brightdigit.com/category/building-speculid/) for more swift development tips.

*****

*Originally published at [learningswift.brightdigit.com](https://learningswift.brightdigit.com/swift-development-tips-speculid-tryswift/)
on November 19, 2018.*
How to enable OpenShift service catalog components in Minishift
Tags: openshift, tutorial, minishift
Published: 2018-12-17 21:03:07

---
title: "How to enable OpenShift service catalog components in Minishift"
published: true
description: "Learn how to enable OpenShift service catalog components in Minishift."
tags: openshift, tutorial, minishift
---

Original post: https://endaphelan.me/guides/openshift/how-to-enable-openshift-components-in-minishift

**Note: This only works with OpenShift version >= 3.10.x**

There are two ways to enable OpenShift service catalog components in Minishift.

The recommended method is to run the `minishift openshift component add` command when your cluster is already running:

```bash
$ minishift openshift component add service-catalog
$ minishift openshift component add automation-service-broker
$ minishift openshift component add template-service-broker
```

You can also enable components during `minishift start`. This is still one of Minishift's [experimental features](https://github.com/minishift/minishift/blob/master/docs/source/using/experimental-features.adoc), so you will need to set the environment variable `MINISHIFT_ENABLE_EXPERIMENTAL` in order for it to work:

```bash
$ export MINISHIFT_ENABLE_EXPERIMENTAL=y
```

Then run `minishift start` with extra flags to enable catalog components:   
```bash
$ minishift start --extra-clusterup-flags "--enable=*,service-catalog,automation-service-broker,template-service-broker"
```
Clojure 1.10 released
Tags: news, clojure
Published: 2018-12-17 20:55:34

---
title: Clojure 1.10 released
published: true
description: Clojure 1.10 release – major updates to error reporting and Java compatibility.
cover_image: 
tags: #news #clojure
---

### Clojure 1.10 has [officially released](https://clojure.org/news/2018/12/17/clojure110).

###**Major Updates**
- improved error reporting (Clojure errors at the REPL are [categorized](https://clojure.org/reference/repl_and_main#_error_printing), errors carry additional info, etc.)
- updated Java compatibility (focused on Java 8 & 11)

Thoughts on this release and the direction of Clojure?