teleren/devto huggingface dataset:
Adding Emoji ðŸ”¥ to your terminal  
Tags: emoji, beginners, bash
Published: 2017-10-24 18:35:14

---
title: Adding Emoji ðŸ”¥ to your terminal  
published: true
description: Adding Emoji to your terminal is fun fast and easy.
tags: emoji, beginners, bash
cover_image: https://thepracticaldev.s3.amazonaws.com/i/uoljrfdud3om76l4vn2a.png
---

If you are staring at a terminal all day coding, it is important to customize and personalize your work environment as much as possible. Besides [changing the color](https://apple.stackexchange.com/questions/92756/how-do-you-change-mac-terminal-theme-so-that-it-doesnt-go-back-to-basic-every) of your terminal mac, adding an Emoji (or two) to your terminal is a fun, fast and easy way to customize your setup. In a recent [Gist](https://gist.github.com/anthonydelgado/0d8997ea95c885b61c86d8dcfb60a11f) that I created for some members of my dev team I show you just how to do that! 

### Step 1. Open up your .bash_profile in your favorite text editor. 
```
sublime ~/.bash_profile
```
### Step 1.1 If the file doesn't yet exist you can create it) 
```
cd ~
touch .bash_profile
```

### Step 2 Add this line to the bottom of the file

The \W is the Working directory that you are currently inside of and you can add an unlimited amount of emoji to your terminal after that. 

```
PS1="\W ðŸ”¥ðŸ¦„ "
```
### Step 3 - Save and Exit / Restart Terminal & Enjoy!

![Alt text of image](https://thepracticaldev.s3.amazonaws.com/i/2kuvnvxzhp2pa0uf4m5n.png)

## The result is something like this. 

You can use [this generator](http://bashrcgenerator.com/) to fully customize the hell out of your command prompt. 

#### How else do you customize your dev setup? 

### ðŸ‘‡ Leave your setup hacks in the comment section below. ðŸ‘‡  

 Happy Hacking!
Having trouble with the YouTube API in IE 11
Tags: help, discuss, javascript, youtube
Published: 2017-10-24 14:54:05

---
title: Having trouble with the YouTube API in IE 11
layout: post
published: true
tags: help, discuss, javascript, youtube
---

I'm hoping one of you might have an idea why my script isn't working in IE 11. Everything works in both Chrome and Firefox and partly works in IE. The issue though is that IE doesn't seem to like some of the functions I'm calling. IE Console - ("Object doesn't support this property or method 'pauseVideo'"). I cant escape the feeling that its some syntax error I'm not seeing.

Page displaying error - http://goforward.harpercollege.edu/dev-foundation/index-3.php

    <script type="text/javascript" src="https://www.youtube.com/iframe_api"></script>
	
    <script type="text/javascript">
    window.onYouTubeIframeAPIReady = function() {
    for (item in players_list) {
    players[players_list[item]] = new YT.Player(players_list[item], {});
    }
    }
    var tag = document.createElement('script');
    tag.src = "https://www.youtube.com/iframe_api";
    var firstScriptTag = document.getElementsByTagName('script')[0];
    firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
    var players = new Array();
    var players_list = [
    "popup-youtube-player-1",
    "popup-youtube-player-2",
    "popup-youtube-player-3",
    "popup-youtube-player-4",
    "popup-youtube-player-5",
    "popup-youtube-player-6"
    ];

    function pauseVideo() {
    for (item in players_list) {
    players[players_list[item]].pauseVideo();
    }
    }

    function swapvid(id) {
    pauseVideo();
    $('.video-slider').css('display', 'none');
    $('#' + id).closest('.video-slider').css('display', 'inline');	
    }
    </script>
Hashtag MakeContent 2 GetContent
Tags: makecontent, togetcontent
Published: 2017-10-24 14:42:52

---
title: Hashtag MakeContent 2 GetContent
published: true
description: Turning online media use emotions into gold.
tags: #MakeContent, #ToGetContent 
---

I love the work of turning programs into joy. Turning content into positive emotions. Playing with the joy and excitement of the user as well as the smooth user experience, are the end goals of development. 
These are the obvious desires of the user - to be happy, part of a hero's journey
This comes from my recent revolution in thinking that culminated in a major change from the negative emotions of rebellion against the depressing use of social media to the positive use of giving away poetry on my feed. I do get positive feedback but it is also a way to avoid the click'n'scroll lock-in syndrome that drowns me in negative emotions without much control that I could exert over my emotional well-being. 

The switch from got-to-get to giving-to-get also makes a massive shift towards positive emotions. A maxim of alchemy states something along the lines of needing gold to make gold. In fact you give away gold to get more gold. 
In a modern meme it is crystallized in 'jab, jab, jab, hook'. It works. At least this is the result of a month of experimenting with giving. Although the real payday is in 11 months I do get a boost every time I post. In short it is nothing short of a miracle. 

It is my hypothesis that dopamine without serotonin sucks -  that is exactly what causes a spiral into depression exhibited by social media abuse.
Dopamine can take one into an enjoyable habit of a virtuous circle if accompanied with serotonin and oxytocin. Even take one into flow perhaps and this is wonderland and pixiedust on a yellow brick road territory. Flow is where pandas vomit rainbows. Sometimes its too magical so you need to get time off flow too and go on a walk for 20 minutes or just meditate or talk to others. Otherwise you stand to lose the flow, coherence and the physical well-being too.

 

Poetry makes me content. One day we will all write poems and dance hours every day to keep our bodies moving- healthy and happy. The dances will be interfaced to computers as a complex language - like a programming language.
Back to Heroku
Tags: node, backend
Published: 2019-10-14 12:15:27

---
title: Back to Heroku
published: true
tags: node.js,backend
canonical_url: 
---

A year and a half ago I moved my backend service from Heroku to Openshift. The reasons were that it didn’t put services to sleep state in free tier. At that time it just looked it offers more for the same price. A month ago Openshift upgraded their service from version 2 to 3, or something like that. They wanted me to do the migration of my service. This is what happened next :) …

### Migrate!

I had little to no will to do any work for this service again. Especially the maintenance work which adds no features and was basically doing someone else’s work. As it wasn’t that important and hadn’t that many users I was considering leaving the service to die. After a few days and email notifications from Openshift that I need to migrate, I decided to give it a try.

Their tutorial was very short and at first I liked that, but only when I started working realized it’s just a bad tutorial, short and inaccurate. So I digged deeper trying to understand what needs to be done. As the last step I needed to create a new database, which wouldn’t be a problem if I didn’t need to learn all their nomenclature and architecture. I remembered the same service I had been running on Heroku before might still be alive.

### To Heroku

Indeed, as I logged in to Heroku I saw my service was switched to maintenance mode. A simple button click put it to being active. An issue I had before with service being put to idle state after some time of inactivity I solved by using cron jobs as Heroku imagined it. After that I updated my client applications pointing to the new (old) endpoint and voila!

The reason for this post is to remember myself that I like Heroku better. To say that I want the software to live longer without needing for “migrations”. This is something I don’t like from the backend service providers, even though I’m using a free plan, would you please leave my service working as it was. And that was my main reason to do actual work, I felt sad seeing it die.
On programming!
Tags: programming, humility
Published: 2017-10-24 10:04:27

---
title: On programming!
published: true
description: 
tags: programming, humility
---

Being a software developer is not an end in itself. It is a means to an end. Our knowledge of different programming languages is not what makes us any different. It is our ability to solve problems with the skills that we have developed. It is our ability to think out and implement novel ways of solving problems that makes this job of ours unique and of high value.

All this while, I've always thought that because I know three programming languages, that's what makes me a programming 'guru'. Lies! Knowing different programming languages does not make you any better than the guy who knows one very well and is able to solve diverse problems with the language he has decided to stick with. I'm not saying that learning different programming languages is bad. No! It actually increases your chances of employment and it broadens your scope on the different possible technologies that can be utilized in solving a problem. 

However, where the problem lies is when we start thinking that our knowledge of different programming languages is a silver bullet to the 5-star programmer status we all aspire to.Programming is cool and it widens your angle of thought and method of approach to problems. 

In all, programming is not about claiming status based on the knowledge that we possess. Programming is about solving problems. It is about enriching the lives of others with the skills we possess. It is about humility in status and faithfulness to the end game.
DataDigger on SonarQube
Tags: openedge, datadigger
Published: 2018-01-22 20:06:04

---
title: "DataDigger on SonarQube"
published: true
tags: OpenEdge, DataDigger
canonical_url: https://datadigger.wordpress.com/2017/10/24/datadigger-on-sonarqube/
---

Yesterday, Gilles Querret of Riverside Software analyzed the DataDigger code from GitHub with [SonarQube](http://sonar.riverside-software.fr/about). And while I always thought that my code was pretty clean, it turned out that there was still a lot left to be improved

[![1wirkmu](https://datadigger.files.wordpress.com/2017/10/1wirkmu.png?w=840)](http://sonar.riverside-software.fr/projects?search=DataDigger)

A lot of the issues SonarQube reported will be fixed in the upcoming DataDigger 24, but I invite you to check on the tooling yourself for your own projects.

My guess is that it will be an eye opener ![🙂](https://s0.wp.com/wp-content/mu-plugins/wpcom-smileys/twemoji/2/72x72/1f642.png)
Game Of Life
Tags: ruby, rails, webdev, showdev
Published: 2017-10-24 09:30:33

---
title: Game Of Life
published: true
description: Rails implementation of “Conway's Game of Life. 
tags: ruby, rails, webdev, showdev
---

Hi i just implemented (for funny) a little ruby implementation of "Conway's Game of Life" (https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life)

github: https://github.com/davidesantangelo/gameoflife
heroku: https://golife.herokuapp.com

take a look!
Protected Properties and Methods in Swift - An Alternative
Tags: swift, ios, pairprogramming, discuss
Published: 2017-10-24 08:59:45

---
title: Protected Properties and Methods in Swift - An Alternative
published: true
description: An alternative to protected access control in Swift
tags: swift, iOS, pairprogramming, discuss
---

*Originally posted on [my blog site](https://d4ttatraya.me/Protected-Access-Swift/).*

It's always been a quite demand from swift developers to add `protected` access in [Swift's access control](https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/AccessControl.html). Lot of times it's been asked on stack-overflow that how to write protected methods in swift. But still swift hasn't provided any direct way to do it. Can we really achieve protected access in Swift? Yes, we can!

Apple has already published a blog [Access Control and protected](https://developer.apple.com/swift/blog/?id=11) in 2014 regarding this demand and how unnecessary it is. But still I believe there are lot of situations in projects where we need to hide some properties and methods from outside classes but only accessible to children. So here's what I have come up with:

```swift
//Animal.swift file
class Animal {
    fileprivate var protectedVar: Int = 0
    fileprivate func protectedFunc() {//do stuff}
}

class Dog: Animal {
    func doSomething() {
        protectedVar = 1
        protectedFunc()
    }
}
```

If we try to access `protectedVar` or `protectedFunc()` from outside of *Animal.swift* file then compiler will throw an error.
To achieve protected access like this only thing we need to keep in mind that **children must be declared in same file as parent declared in**. Also this approach can not be used while developing libraries, packages or frameworks.

Have you any time stuck searching for protected access in Swift? Then tell me how you got through it in comments below.
Also if you have any other solutions, please post those here or on [Twitter @d4ttatraya](https://twitter.com/D4ttatraya).

*References: [Apple's Developer Guide](https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/AccessControl.html)*
微服务的反模式和陷阱
Tags: antipatterns
Published: 2017-10-24 08:15:39

---
title: å¾®æœåŠ¡çš„åæ¨¡å¼å’Œé™·é˜±
published: true
description: åŽŸä¹¦ï¼šMicroservices AntiPatterns and Pitfalls
tags: antipatterns
---

###[ç¬¬ä¸€éƒ¨åˆ†](http://www.jianshu.com/p/3986239138fe)
####1ã€æ•°æ®é©±åŠ¨çš„è¿ç§»åæ¨¡å¼
- å¤ªå¤šçš„æ•°æ®è¿ç§»
- åŠŸèƒ½åˆ†å‰²ä¼˜å…ˆï¼Œæ•°æ®è¿ç§»æœ€åŽ

####2ã€è¶…æ—¶åæ¨¡å¼
- ä½¿ç”¨è¶…æ—¶
- ä½¿ç”¨æ–­è·¯å™¨æ¨¡å¼

####3ã€å…±äº«åæ¨¡å¼
- è¿‡å¤šä¾èµ–
- å…±äº«ä»£ç çš„æŠ€æœ¯

####4. åˆ°è¾¾æŠ¥å‘Šåæ¨¡å¼
- å¾®æœåŠ¡æŠ¥å‘Šçš„é—®é¢˜
- Asynchronous Event Pushing

####5ã€æ²™ç²’é™·é˜±
- åˆ†æžæœåŠ¡çš„èŒƒå›´å’ŒåŠŸèƒ½
- åˆ†æžæ•°æ®åº“äº‹åŠ¡
- åˆ†æžæœåŠ¡ç¼–æŽ’

###[ç¬¬äºŒéƒ¨åˆ†](http://www.jianshu.com/p/c76f7f234a31)
####6ã€æ— å› çš„å¼€å‘è€…é™·é˜±
- åšå‡ºé”™è¯¯çš„å†³å®š
- äº†è§£ä¸šåŠ¡é©±åŠ¨

####7ã€éšå¤§æµé™·é˜±
- å¾®æœåŠ¡çš„ä¼˜ç‚¹å’Œç¼ºç‚¹
- å…¶ä»–æž¶æž„æ¨¡åž‹

####8ã€å…¶å®ƒæž¶æž„æ¨¡å¼
- header ç‰ˆæœ¬æŽ§åˆ¶
- Schema ç‰ˆæœ¬æŽ§åˆ¶

###[ç¬¬ä¸‰éƒ¨åˆ†](http://www.jianshu.com/p/46a81ce30e9c)
####9ã€é™æ€å¥‘çº¦é™·é˜±
- å»¶è¿Ÿæµ‹é‡
- é€šä¿¡åè®®æ¯”è¾ƒ

####10ã€é€šä¿¡åè®®ä½¿ç”¨çš„é™·é˜±
- å¼‚æ­¥è¯·æ±‚
- å¹¿æ’­èƒ½åŠ›
- äº‹åŠ¡è¯·æ±‚

####11ã€REST é™·é˜±
sudo apt-get install akregator 
Tags: install, ubuntu, akregator
Published: 2017-10-23 17:37:14

---
title: sudo apt-get install akregator 
published: published
description: Install "Akregator" on Linux Mint 18.2 Sonaya
tags: Install, Ubuntu, Akregator
---

```shell
psnc@psnc ~ $ sudo apt-get install akregator 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  libkf5kiogui5 libkf5syndication5
The following NEW packages will be installed:
  akregator libkf5kiogui5 libkf5syndication5
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 846 kB of archives.
After this operation, 3.421 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://ppa.launchpad.net/kubuntu-ppa/backports/ubuntu xenial/main amd64 libkf5kiogui5 amd64 5.36.0-0ubuntu1.1~ubuntu16.04~ppa1 [25,0 kB]
Get:2 http://ppa.launchpad.net/kubuntu-ppa/backports/ubuntu xenial/main amd64 libkf5syndication5 amd64 16.04.3-0ubuntu1~ubuntu16.04~ppa61 [167 kB]
Get:3 http://ppa.launchpad.net/kubuntu-ppa/backports/ubuntu xenial/main amd64 akregator amd64 4:16.04.3-0ubuntu2~ubuntu16.04~ppa63 [654 kB]
Fetched 846 kB in 0s (1.998 kB/s)  
Selecting previously unselected package libkf5kiogui5:amd64.
(Reading database ... 244930 files and directories currently installed.)
Preparing to unpack .../libkf5kiogui5_5.36.0-0ubuntu1.1~ubuntu16.04~ppa1_amd64.deb ...
Unpacking libkf5kiogui5:amd64 (5.36.0-0ubuntu1.1~ubuntu16.04~ppa1) ...
Selecting previously unselected package libkf5syndication5:amd64.
Preparing to unpack .../libkf5syndication5_16.04.3-0ubuntu1~ubuntu16.04~ppa61_amd64.deb ...
Unpacking libkf5syndication5:amd64 (16.04.3-0ubuntu1~ubuntu16.04~ppa61) ...
Selecting previously unselected package akregator.
Preparing to unpack .../akregator_4%3a16.04.3-0ubuntu2~ubuntu16.04~ppa63_amd64.deb ...
Unpacking akregator (4:16.04.3-0ubuntu2~ubuntu16.04~ppa63) ...
Processing triggers for libc-bin (2.23-0ubuntu9) ...
Processing triggers for desktop-file-utils (0.22+linuxmint1) ...
Processing triggers for mime-support (3.59ubuntu1) ...
Processing triggers for hicolor-icon-theme (0.15-0ubuntu1) ...
Setting up libkf5kiogui5:amd64 (5.36.0-0ubuntu1.1~ubuntu16.04~ppa1) ...
Setting up libkf5syndication5:amd64 (16.04.3-0ubuntu1~ubuntu16.04~ppa61) ...
Setting up akregator (4:16.04.3-0ubuntu2~ubuntu16.04~ppa63) ...
Processing triggers for libc-bin (2.23-0ubuntu9) ...
psnc@psnc ~ $ 
```
Cross-compiling openSUSE build service projects
Tags: opensusebuildservice, crosscompilation
Published: 2018-10-06 01:43:42

---
title: Cross-compiling openSUSE build service projects
published: true
tags: opensuse build service,cross compilation
canonical_url: http://www.hpcoders.com.au/blog/?p=105
---

I recently needed to debug one of my OBS projects that was failing on the ARM architecture. Unfortunately, my only ARM computer (a Raspberry Pi) was of a too-old architecture to run the OBS toolset directly – the Raspberry was armv6l, and I needed armv7l.

After poking around a lot to figure out how to run OBS as a cross compiler, I eventually had success. These are my notes, which refer to doing this on an OpenSUSE Tumbleweed system on a 64 bit Intel CPU.

1. Install the emulator  
`
zypper install qemu
zypper install build-initvm-x86-64
`

2. Enable binfmt support for ARM (allows the running of ARM executable on x86\_64 CPUs)

`
cat >/etc/binfmt.d/arm.conf <<EOF
:arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:
\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff
:/usr/bin/qemu-arm-binfmt:P
:armeb:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2
8:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\x
ff:/usr/bin/qemu-armeb-binfmt:P
EOF
`

3. restart the binfmt service

`systemctl restart systemd-binfmt`

4. run osc build using:

`
osc build --alternative-project=openSUSE:Factory:ARM standard armv7l ecolab.spec
`  
This will fail, because it can’t run the ARM executables.

5. copy the qemu-arm-binfmt executable into the build root

`
cp /usr/bin/qemu-arm-binfmt /var/tmp/build-root/standard-armv7l/usr/bin
`  
6. rerun the osc build command above. It will complain that the built root is corrupt. Do not clean the build root, but just type continue.
.NET Standard explained to developers: What if it was an interface?
Tags: netstandard, dotnet, netcore, net
Published: 2017-10-24 02:24:29

---
title: ".NET Standard explained to developers: What if it was an interface?"
published: true
description: A dumbed down, developer-friendly approach to understanding .NET Standard
tags: netstandard,dotnet,netcore,net
---

Quite recently, Microsoft shook the ground of the whole dotnet ecosystem with a new concept : [.NET Standard](https://docs.microsoft.com/en-us/dotnet/standard/net-standard). Lot's of folks like me, who already had a hard time keeping up with all things .NET lately, thought "What is it now?!".

Now, I spent a little while wrapping my head around this and I think I've come up with a developer-friendly explanation to what .NET Standard really is. In fact, I've somewhat materialized it into a little piece of (incomplete) code.

To dumb down things a bit, try to picture each version of .NET Standard as an interface, and each platform implementing them as classes. You'd get something like this :


```c#
interface INETStandard_1_0 { /* Lots of methods */ }
interface INETStandard_1_1 : INETStandard_1_0 { /* More methods */ }
interface INETStandard_1_2 : INETStandard_1_1 { /* More methods */ }
interface INETStandard_1_3 : INETStandard_1_2 { /* More methods */ }
interface INETStandard_1_4 : INETStandard_1_3 { /* More methods */ }
interface INETStandard_1_5 : INETStandard_1_4 { /* More methods */ }
interface INETStandard_1_6 : INETStandard_1_5 { /* More methods */ }
interface INETStandard_2_0 : INETStandard_1_6 { /* More methods */ }

// .NET Core Platform
class DotnetCore_1_0 : INETStandard_1_6 { /* Implements methods */ }
class DotnetCore_2_0 : DotnetCore_1_0, INETStandard_2_0 { /* Implements methods */ }

// .NET Framework Platform
class DotnetFramework_4_5 : INETStandard_1_1 { /* Implements methods */ }
class DotnetFramework_4_5_1 : DotnetFramework_4_5, INETStandard_1_2 { /* Implements methods */ }
class DotnetFramework_4_6 : DotnetFramework_4_5_1, INETStandard_1_3 { /* Implements methods */ }
class DotnetFramework_4_6_1 : DotnetFramework_4_6, INETStandard_2_0 { /* Implements methods */ }

// Mono Platform
class Mono_4_6 : INETStandard_1_6 { /* Implements methods */ }
class Mono_5_4 : Mono_4_6, INETStandard_2_0 { /* Implements methods */ }

// and so on...

```

Now, in the facts, things are a bit more complicated since the API surface defined by .NET Standard includes classes as well as their members, but in essence that's really all this is: An interface, with several implementations.

If you're interested in this, you can head to [the official repo](https://github.com/dotnet/standard) where all the work is being done.

EDIT : Someone in the team just told me about [David Fowler's take on the subject](https://gist.github.com/davidfowl/8939f305567e1755412d6dc0b8baf1b7) and of course it is awesome. I suggest you check this out too!
Dealing with praise
Tags: discuss, career
Published: 2017-10-23 22:01:29

---
title: Dealing with praise
published: true
description: Because it's not that easy...
tags: discuss, career
---

We all receive criticism from time to time, and part of growing up is learning how to deal with it. Countless articles have been written on that.

But, how do you react when you are receiving compliments? What's your reaction to : *You did such a great job!*, *You are a rockstar!*, *You might be the GOD of all developers!!* ?

We all want to be perceived as humble, but we also don't want to be rude to the people congratulating us. Do you have any experiences in this matter?
REST API Tester Tour Enhanced
Tags: ruby, testing, rest, api
Published: 2017-10-23 21:02:40

---
title: REST API Tester Tour Enhanced
published: true
description: Tour of RubyTest example that tests GitHub REST API
tags: #ruby #testing #rest #api 
---
I've added stops to the tester tour of the REST API test example.

It now includes endpoint testing for the  GitHub API `Labels` resource.

The tour shows how a tester would use project `RubyTest` to test the GitHub REST API.

Links:

- [Tour](https://github.com/BurdetteLamar/RubyTest/blob/master/examples/github_api/TesterTour.md#tester-tour)
- [Endpoint Tests](https://github.com/BurdetteLamar/RubyTest/blob/master/examples/github_api/tester_tour/md_files/EndpointTests.md/#endpoint-tests)