teleren/devto huggingface dataset:
Programmable Edge
Published: 2019-03-08 04:25:13

---
title: Programmable Edge
published: true
description: About programmable edge and introduction of fly
tags: 
---

10 years ago, we said "database access is too slow." We used cache layer, memcached.

5 years ago, we said "access to web server is too slow." We used CDN, application cache.

2 years ago, we said "appCache is not flexible." We used ServiceWorker.

Now, we said "Edge (CDN included) is not flexible."

## Introduction of fly

This is from [fly readme](https://github.com/superfly/fly/blob/f524f833cf83f87d6f5926cf247ee93b2241a1c2/README.md), 

![Edge](https://thepracticaldev.s3.amazonaws.com/i/g5uxx50pbebps4nt9lfo.png), this is edge, I want to create this by more programmable, and get more flexible.

## Example 1

https://vanilla-terrier-972.edgeapp.net/

This is just proxy to https://www.moneyforward.vn .

This is getting-started from https://github.com/superfly/cdn#try-the-starter-app

```ts
import { backends, proxy, middleware, pipeline } from "@fly/cdn";

const mw = pipeline(
  middleware.httpsUpgrader,
  middleware.httpCache
)

const app = mw(
  proxy("https://www.moneyforward.vn")
);

fly.http.respondWith(app);
```

I wrote this, and deployed to fly. I can create edge by easy way!

## Example 2

Provided example

```js
fly.http.respondWith(function(request){
   return new Response("Hello! We support whirled peas.", { status: 200})
 })
 // if you'd prefer to be service worker compatibility, this is also supported:
 // around addEventListener('fetch', function(event){})
```

## Example 3

Provided example

```js
addEventListener('fetch', function (event) {
   event.respondWith(new Response('Redirecting',
     {
       headers: {
         'Location': 'https://fly.io/docs/apps/'
       },
       status: 302
     }
   ))
 })
```

## References

- https://fly.io/docs/
- https://github.com/superfly/cdn#clone-and-run-tests
- https://github.com/superfly/fly/tree/master/examples
- https://github.com/superfly/fly/blob/master/README.md
Nevertheless, Sarah Louise Taylor Coded
Tags: wecoded
Published: 2019-03-08 10:42:39

---
title: Nevertheless, Sarah Louise Taylor Coded 
published: true
tags: shecoded
---

## I started to code in 2019 so I can better understand the challenges faced by my colleagues 

## I deserve credit for being part of an amazing R&D team 

## I hope to see my workplace run ongoing coding classes for women
I'm Willem Wijnans, and I support women devs.
Tags: wecoded
Published: 2019-03-08 10:42:21

## I will advocate for gender equality by 

keeping my hiring pipeline diverse and inclusive. One thing I do is put on a bias filter when I am sourcing for our next hires @ Aula. Try it out yourself: https://unbias.io/

## Shoutout to

Jennifer Kim, https://www.jennifer.kim/, for all her hard work on diversity and inclusion
Nevertheless, Edith Coded
Tags: wecoded, womeninstem
Published: 2019-03-08 10:02:10

---
title: Nevertheless, Edith Coded 
published: true
tags: shecoded, womeninstem
---

##The beginning...

*(This is my first post here so I'll use the prompt as an intro.😊)*

México, late 80s, my father brought an Atari XE "home computer" to our home. While I was playing Moon Patrol and Super Mario clones, my dad bought a BASIC book, started coding in the XE, and that was my first exposure to a programming language. 

Years later I discovered the internet, and it was love at first sight: I wanted to make THAT stuff. I didn't know how at the time, so I went to Uni to study Computer Science. I was bad in physics and my math level was (and is) kind of average, but I made it!, in the meantime, I learned HTML and very basic CSS on my own. I had a couple of unpaid internships, I got jobs as a .NET developer, I've dealt with a boss who said to my face that "women are detail-oriented, that's why we don't hire them", HR guys asking me in interviews if I want to get married/have children in the future because then I won't be a good option in their hiring process ... and now, after years of personal matters, depression, work gaps and self-taught, I'm still coding.

#I continued to code in 2019 because...

I know it's a bit silly, but I love the excitement I feel when something I built works on the right way in the browser or people/clients like the websites I created. In the last year I've been doing online courses (Freecodecamp, CodeAcademy, Udemy, and of course, lots of googling) to polish my skills and learn new ones, and now finally I'm starting to feel confident about Javascript or responsive design concepts. 🙈

## My advice for other women and non-binary folks who code is...

Don't give up and never stop learning. We're in a time when you can learn everything online for free or a very low cost. Read the experiences of other women in tech or follow them on Twitter (or DEV.to!), try to get involved in initiatives that support women on STEM (if you're an introvert like me, this could be difficult, but you can share it on social media). If you're already working in the field in a stable position: help or mentor other women/nb/girls, and ask for better salaries or benefits like child support/remote work in your company/startup. 

## My advice for the allies to support women and non-binary folks who code is...

Hire them: full time, remote work, as a freelancer, regardless of their age, studies or marital status. Give them equal pay and benefits. Support them in the workplace, events, conferences. Don't doubt about their knowledge or harass them in social media. Diversity and inclusion are needed in this industry.
Ubuntu 18.04 install Java and Eclipse IDE
Tags: java, tutorial
Published: 2019-03-08 09:58:28

---
title: Ubuntu 18.04 install Java and Eclipse IDE
published: true
description: 
tags: java, tutorial  
---

# Requirements
1. Download an `JDK` gz file.
https://www.oracle.com/technetwork/java/javase/downloads/index.html

2. Download `Eclipse IDE installer` gz file.
https://www.eclipse.org/downloads/download.php?file=/oomph/epp/2018-12/R/eclipse-inst-linux64.tar.gz
you can select an mirror site for downloading it.

# Config JDK
## Extract and Install Java

`tar -xvf ~/Downloads/jdk1.8.0_201.tar.gz`

## Create an folder to store it.
`sudo mkdir /usr/lib/jvm/jdk1.8.0_201`
## Move extracted package to the directory.
`sudo mv jdk1.8.0_201*/* /usr/lib/jvm/jdk1.8.0_201/`

## Run the commands below to configure java.
```bash
sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.8.0_201//bin/java" 1010 
sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.8.0_201//bin/javac" 1010 
sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jdk1.8.0_201//bin/javaws" 1010
```
## Create `Java Environment Variables`.
New an file.
`sudo vim /etc/profile.d/javajdk.sh`

Copy this lines to `javajdk.sh`
```bash
export J2SDKDIR=/usr/lib/jvm/jdk1.8.0_201
export J2REDIR=/usr/lib/jvm/jdk1.8.0_201/jre
export PATH=$PATH:/usr/lib/jvm/jdk1.8.0_201/bin:/usr/lib/jvm/jdk1.8.0_201/db/bin:/usr/lib/jvm/jdk1.8.0_201/jre/bin
export JAVA_HOME=/usr/lib/jvm/jdk1.8.0_201
export DERBY_HOME=/usr/lib/jvm/jdk1.8.0_201/db
```
Make it effective.
`source /etc/profile.d/javajdk.sh`

Test if successful.
Run the command`java -version`, it will show messages like this
```bash
java version "1.8.0_201"
Java(TM) SE Runtime Environment (build 1.8.0_201-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.201-b09, mixed mode)
```
if it, Congratulations!

# Install Eclipse
Extract `eclipse installer` gz file, then just run the `eclipse-inst` executable file.
or run the command on `eclipse installer` directiry
`./eclipse-inst`.

Next, it is some easy steps!

# Add an icon on application lancher

## Step1: change current directiry to `/usr/share/applicaitons`
`cd /usr/share/applicaitons`

## Step2: new a `Java.desktop` file.
Input the lines:
```
[Desktop Entry]
Encoding=UTF-8
Name=Java #name it
Comment=Eclipse-Java
Exec=/path/eclipse #your path
Icon=/path/icon.xpm #your path
Terminal=false
StartupNotify=true
Type=Application
Categories=Application;Development;
```
## Step3: Give it execution permission.
Run the command:
`sudo chmod +x Java.desktop`

# Reference
 
 https://websiteforstudents.com/install-oracle-java-jre-jdk-on-ubuntu-18-04-lts-beta/

**This is my first post, if there are any errors, please correct me:)**
I'm Benjamin Dowen, and I support women devs.
Tags: wecoded
Published: 2019-03-08 09:27:34

---
title: I'm Benjamin Dowen, and I support women devs.
published: true
tags: shecodedally
cover_image: https://thepracticaldev.s3.amazonaws.com/i/pyc0jq7n86rfn144si84.jpeg
---

## I will advocate for gender equality by...
Sharing posts on DevTo and Twitter. Adding comments, encouragement, support where I can. This doesn't feel like a lot, so I will also try and find inspiration for more ways I can help!

I will also share the "Call to All Devs" at work and see if anyone else will get involved or has any ideas.

## I hope to see my work
Figure out how to get more Women candidates (and employ more Women) Testers and Developers! If anyone has any details on how to make job-ads less off-putting to Women please let me know, because we really struggle to attract female candidates to apply.

## My advice for fellow allies is...
Don't be afraid if it's a small step - start somewhere!
Redis session store architecture
Tags: help
Published: 2019-03-08 08:13:04

---
title: Redis session store architecture
published: true
tags: help
---

Hey, I am building IOT platform , for that I need to use redis as session management


 - use api token to get user details
 - use user id to get all api tokens of the user

I am new redis,so need suggestion to build this session management
Friday Blast #63
Tags: fridayblast, links, post
Published: 2019-03-10 13:05:41

---
title: Friday Blast #63
published: true
tags: friday_blast,links,post
canonical_url: https://horia141.com/friday-blast-63.html
series: "Friday Blast"
---

[The observability pipeline (2018)](https://bravenewgeek.com/the-observability-pipeline/) - the case for treating metrics/logs/traces data as “another dataset” rather than something different. For example, sending them first to a central collection point (Kafka or equivalent) and then dispersing them to all the “targets” that need them - logging infra, metrics and alerting, even to a data lake so they’re available as business metrics. The main idea is to stop `NxM` problems with this data and introduce some decoupling so it’s easier to switch infra providers later down the road.

[Extended validation certificates are dead (2018)](https://www.troyhunt.com/extended-validation-certificates-are-dead/) - the message is important - don’t waste money on EVs and just use a regular certificate. The rest of this (really long) pieces seems like it’s taking the piss on Comodo cybersecurity.

[Whatever happened to the semantic web (2018)](https://www.troyhunt.com/extended-validation-certificates-are-dead/) - remember the “Semantic Web”? It used to be a _thing_. But it never really caught on. What’s interesting to me is how the _politics_ of this played out - there were a million standards before there was adoption or even a real killer usecase of the tech.

[TypeScript at Google (2018)](http://neugierig.org/software/blog/2018/09/typescript-at-google.html) - how JavaScript and the whole “frontend thing” evolved at Google vs the rest of the world. An interesting read about the history of this thing and how the author’s team is trying to _sync_ Google up with what everyone else uses these days. IMO Google has done this _numerous_ times before it learned the value of open source and building platforms (so before they got serious about cloud). They were doing something way advanced way earlier than anybody else. But they didn’t talk about it, or at most released a paper or three. The world picked up on the ideas, and caught up technically, but using their _own stuff_. Examples abound: Hadoop vs MapReduce, HBase/Cassandra vs BigTable etc. And now GCP offers HTable interfaces atop their own infra. Thankfully they’re doing good (for them) with Kubernetes and TensorFlow.

[Pixie - a system for recommending 3+ billion items to 200+ million users in real-time (2018)](https://blog.acolyer.org/2018/05/23/pixie-a-system-for-recommending-3-billion-items-to-200-million-users-in-real-time/) - an overview of a Pinterest paper about their recommendation engine. These sorts of things are the backbones of many companies - Netflix, Pinterest, Facebook etc. But they’re usually glossed over in ML courses. But they’re interesting in their own right and very tricky to get right. So this is an interesting discussion of how the Pinterest teams does it.
Show/Hide Layout Bounds in Android
Tags: tools, android
Published: 2019-10-14 06:21:52

---
title: Show/Hide Layout Bounds in Android
published: true
tags: tools, android
canonical_url: https://varunbarad.com/tools/android/2019/03/08/show-hide-android-layout-bounds.html
---

Sometimes while working in Android we need to display the layout-bounds on device. Recent Android versions do provide an action-tile to do so. But on previous versions, we had to go too deep into the Settings application. I wanted to be able to perform the switch from my computer.

ADB does provide methods to do so, but the commands are not easy to remember and also get tiresome after some time.

```bash
# We need to execute both lines to
# make the layout-bounds show
adb shell setprop debug.layout true
adb shell service call activity 1599295570
```

So I made 2 files named `show-lb.sh` and `hide-lb.sh`, which respectively show and hide the layout-bounds on our testing device.

The files are as below:

`show-lb.sh`

```bash
adb shell setprop debug.layout true > /dev/null 2>&1
adb shell service call activity 1599295570 > /dev/null 2>&1
```

`hide-lb.sh`

```bash
adb shell setprop debug.layout false > /dev/null 2>&1
adb shell service call activity 1599295570 > /dev/null 2>&1
```

That `> /dev/null 2>&1` part at the end of each line is just so that the output of that particular command does not get displayed in our terminal as we don’t need it.

`Note for Windows users:` You friends need to omit the `> /dev/null 2>&1` and save these files as `show-lb.bat` and `hide-lb.bat`

You can save these files (make sure to give them `executable` permission if you are on a unix-based machine) and then add their location to system’s `PATH` variable. That way you can execute these from anywhere.

I do think that I would indeed make a version of this in the future where it check the current state and automatically toggle it.

## That’s all folks

This was my solution to improve my daily work experience by 1%. If you have more such ideas/examples or any other suggestions under the sky, [contact me](https://varunbarad.com/contact) or tweet to me [@varun\_barad](https://twitter.com/varun_barad).
Call super method in Vue Component
Tags: javascript, vue, component, es6
Published: 2019-03-08 05:48:23

---
title: Call super method in Vue Component
published: true
description: Calling super method from Vue Component to Parent Component's method or mixin's method. It really doesn't matter
tags: javascript, vuejs, component, es6
---

### Pep Talk
So far (VueJS v2) we don't have class based component like react. `*.vue` has it's own syntax rather than traditional javascript. In that case have you ever feel about calling a method from mixin or another component? Okay!! Let me explain more.

### What's already have?
In ES6 or more we have ability to write class even we have super method to call parent class method. Example is following...

```javascript
// Defining Parent class in Javascript (ES6)
class Parent {
  getAge() {
    return 52
  }
}

// Defining Child class in Javascript (ES6)
class Child extends Parent {
  getAge() {
    const parentAge = super.getAge()
    // We will get parent ager here. And do further process
  }
}
```

**Have you felt that Vue Component is not allowing this?**

### Solution for Vue Component
There is a library for making this possible. [Source **Vue Super Call**](https://github.com/iashraful/vue-super-call)
#### How to use in your project?
* Install it by `npm install vue-super-call`
* Add your main.js/index.js (entry file of your project) like following,
```javascript
import VueSuperMethod from 'vue-super-call'

Vue.prototype.$super = VueSuperMethod
```

#### How to call super from method?
* The basic syntax is `this.$super(Mixin).yourMethod()`
* Proper example is following...
```javascript
// This is mixin
export default {
    name: 'MyMixin',
    methods: {
        sayHello() {
            return "Hello"
        }
    }
}


// Your Component
export default {
    name: 'MyComponent',
    mixins: [MyMixin],
    methods: {
        sayHello() {
            let parentMethodData = this.$super(MyMixin).sayHello()
            console.log(parentMethodData)
            console.log('I am from component after super call')
        }
    }
}

// Console Output
$ Hello
$ I am from component after super call
```

*Have Fun with VueJS :)*
Nevertheless, Amanda Collins Coded
Tags: wecoded
Published: 2019-03-08 05:08:04

---
title: Nevertheless, Amanda Collins Coded 
published: true
tags: shecoded
---

## I continued to code in 2019 because...

I am simply not satisfied with what I have learned up to this point or what I have built - I continue to push myself to grow as an individual. For most of 2018, I led a high profile project that involved over a dozen engineers, and I have started 2019 by paving the way for others to follow in my footsteps with a program that could change how we learn from one another in the different groups and styles of engineering we are accustomed to.

These are experiences I could not have had or continue to have if I did not continue to do what I enjoy.

## I deserve credit for...

I work very, _very_ hard to try and keep the projects I lead running as smoothly as possible: in the face of constant change and unexpected roadblocks, I strive to find ways to persevere and deliver the product, all while keeping the team highly functional and motivated to enjoy the experience (even if the project's fate seems dire). It is often an aspect of one's job that can get very little praise and can be highly criticized.

## I hope to see my tech community...

Looking towards the future, I hope the community can make the idea of technical residency programs - where an individual can reside on different technical teams around the company for periods of time across a rotation - an extremely commonplace opportunity no matter what company you work for. I feel that it's beneficial for both the individual resident and the technical team to have that different perspective on how we approach solving problems (like asking someone to look over your code with a fresh set of eyes to see what you're missing), as well as introduce a challenge that could really enable the individual resident to grow.

For my experience of it, I am constantly pushing myself outside of my comfort zone: I'm forcing myself to learn more aspects of how our systems run and our infrastructure is built, I am pairing with individuals I have never worked with before, and trying to bring my perspective as an application developer to teams who don't build applications.

What I have found so far is that, to make a type of program like this successful, each technical team needs to be a safe space to learn and make mistakes. Residents may or may not fit well with a technical team for any number of reasons, but lack of opportunities to learn or collaborate effectively with others can lead to an overall ineffective experience.

I hope that, by the time I complete my rotation, I will have gained even more insight as to what might make this successful and sustainable for the company.
How to use fast-drf and API faster
Tags: python, django, api, rest
Published: 2019-03-08 04:52:03

---
title: How to use fast-drf and API faster
published: true
description: A lightweight library for making API development faster
cover_image: https://thepracticaldev.s3.amazonaws.com/i/jy5d2kwbx8906afuyyct.png
tags: python, django, api, rest
---

### Fast DRF(Django REST Framework) [Change Log](https://github.com/iashraful/fast-drf/blob/master/CHANGELOG.md)
> [Source in Github](https://github.com/iashraful/fast-drf) 
> [Full Documentation](https://ashraful.dev/docs/fast-drf/)
> Fast DRF is a small library for making API development faster with Django and Django REST Framework.
It's easy and configurable.


### Quick Start
* Install the library inside your  virtualenv by using pip `pip install fast-drf`
* Add your apps to `FAST_API_ENABLED_APPS` on settings for best performance. Like, `FAST_API_ENABLED_APPS=['app_name', 'my_app']`
* Update your every model or if you use base abstract model then it's good and less time you need. Update model like following,
```python
from fast_drf.mixins.expose_api_model_mixin import ExposeApiModelMixin
from django.db import models


class MyModel(ExposeApiModelMixin, models.Model):
    #... All yor fields
    pass
    
    # The following methods are available from model mixin
    @classmethod
    def exposed_api(cls, *args, **kwargs):
        """
        This method holds a bunch of API configs and return like following...
        {
            "api_url": "",  # (REQUIRED)

            # You must use from HTTPVerbsEnum. Like HTTPVerbsEnum.GET.value, HTTPVerbsEnum.POST.value
            "allowed_methods": ['get', 'post', 'put', 'patch', 'delete'], # (NOT REQUIRED)

            # slug_field is application 'put', 'patch', 'delete' these methods
            "slug_field": "pk", # (NOT REQUIRED) DEFAULT [PK] (Must be model field, unique or primary key)

            "queryset": "",  # (NOT REQUIRED) default all
            "viewset_class": "",  # (NOT REQUIRED) BaseViewset class
            "serializer_class": "",  # (NOT REQUIRED) default BaseEntitySerializer
            "permission_classes": "",  # (NOT REQUIRED) default set from settings
        }
        :param args:
        :param kwargs:
        :return: An empty Dictionary/False OR Full config dictionary.
        """
        api_configs = {
            "api_url": 'my-model-api',
        }
        return api_configs

```

**That's it.** You can also override serializer class and viewset class
I'm dAVE Inden, and I support women devs.
Tags: wecoded
Published: 2019-03-08 03:58:00

---
title: I'm dAVE Inden, and I support women devs.
published: true
tags: shecodedally
---

## I will advocate for gender equality by...
* Calling out terrible behavior when I see it, online or in person.
* I will also call out when someone does something that isn't overtly or blatantly sexist, but still perpetuates the problems of gender inequality.
* I am following more women, especially women of color online to hear their perspective on technology and use my privilege to spread their words to those that listen to me.
* Working within my own tech community in Seattle to meet more women developers and help them get a job at my company if they are interested.
* Ask women how I can better serve them and gender equality.


## I hope to see my work & developer community...
Listen more and give more of a platform to women developers, especially women of color, so that their thoughts and opinions are heard along with everyone else.
I want to see my tech community have more women involved in conferences and meetups and not just when it comes to discussing diversity and inclusion and what it is like to be a woman in tech, but about their opinions on technology and development work itself and anything else they want to talk about.

## My advice for fellow allies is...
* Listen to what women are saying about their experience of being a developer.
* Believe women and what they are saying about being a member of a male dominated industry.
* Speak up in situations where you see women getting treated differently than their male counterparts.
* Do what you can to mentor women and help them succeed in tech so that they get paid more.
* Ask women if you are being a good ally and how you can improve as one.
* When you speak up about something on a woman's behalf make sure it is about them and you don't become the subject of the discussion.