teleren/devto huggingface dataset:
CachedWatch in Web Atoms
Tags: mvvm, typescript, javascript
Published: 2019-06-25 05:10:29

---
title: CachedWatch in Web Atoms
published: true
description: Avoiding multiple REST Api calls while reading property
tags: mvvm,typescript,javascript
---

In Web Atoms, we can simply write `@Watch` on a getter which returns `Promise<T>` and getter will be read by UI automatically when any of referenced properties will change.

## Old way

```typescript

export default class TaskListViewModel extends AtomViewModel {

   public search: string = "";

   @Inject
   private taskService: TaskService;
 
   @Watch
   public get tasks(): Promise<ITaskModel[]> {
      return this.taskService.list(this.search);
   }

}

```

There was a small problem, if we were to read `tasks` property again and again in different parts of UI, every time it would fire REST API to backend, and results would still be the same.

So we introduced, `@CachedWatch` which will cache results of last successful api call, unless any of input parameters were changed.

## New Way


```typescript

export default class TaskListViewModel extends AtomViewModel {

   public search: string = "";

   @Inject
   private taskService: TaskService;
 
   @CachedWatch
   public get tasks(): Promise<ITaskModel[]> {
      return this.taskService.list(
         this.search,
         this.newCancelToken("tasks"));
   }

}

```

We are introducing two concepts here, first `@CachedWatch` and `CancelToken`. Imagine user types on search text box, and on every keyboard event, this property will refresh. But once user has immediately typed next character, we want to cancel previous search.

We can do this by creating `newCancelToken` with a key that is same as property name, it will create and return a new token and it will cancel previous token for the same key.

This will abort previous REST API.

Web Atoms intelligently delays REST API calls by 100ms, so if previous token is cancelled immediately, it will not start previous request at all.

------------------------------------------------------------------

Web Atoms is powerful MVVM JavaScript framework completely written in TypeScript, which can be extended to any other platforms. Currently supported on Web and Xamarin.Forms

## Dive into samples
https://www.webatoms.in/samples.html#contextId=0

{% github neurospeech/web-atoms-core %}
What did you learn today - Lessons learned - TIL? And how do you manifest it?
Tags: discuss, live, development, webdev
Published: 2019-06-25 11:28:34

What was your todays lessons that you learned (TIL),
and what did you do to manifest it, implement it to your personal knowledgebase or in your mind?

What kind of fact did you get to know about in live?
What kind of function / pattern etc. did you learn today?
Why is it important for you?

Just write down, what comes to your mind...
Convert PHP Arrays, Integers, Objects & Variables to String
Tags: php, phparraystostring, phpobjecttostring, phpstringtoarrays
Published: 2020-02-07 09:25:40

---
title: Convert PHP Arrays, Integers, Objects & Variables to String
published: true
tags: PHP,php arrays to string,php object to string,php string to arrays
canonical_url: https://www.positronx.io/convert-php-arrays-integer-object-variables-to-string/
---

The post [Convert PHP Arrays, Integers, Objects & Variables to String](https://www.positronx.io/convert-php-arrays-integer-object-variables-to-string/) appeared first on [positronX.io](https://www.positronx.io).

Today we are going to learn how to convert arrays, integers, objects, and variables to string in PHP. We will learn to use various built-in php functions or methods to deal with string conversion.

#### Table of Contents

[click here to read more](https://www.positronx.io/convert-php-arrays-integer-object-variables-to-string/)
ProtonVPN native app or manual IKEv2 set up
Tags: vpn, protonvpn, protonvpnreview
Published: 2019-07-05 12:55:59

---
title: ProtonVPN native app or manual IKEv2 set up
published: true
tags: VPN,protonvpn,protonvpn review,vpn
canonical_url: https://kevinhq.com/protonvpn-native-app-or-manual-ikev2-set-up/
---

ProtonVPN native client app or use manually IKEv2 set up? Here are my stories on how I have experience with both of them. Native app Let’s start with the native app. That is, the app I can download, install and run on my Mac and Android phone.  Then, I can sign in with my ProtonVPN… 

[Read More »ProtonVPN native app or manual IKEv2 set up](https://kevinhq.com/protonvpn-native-app-or-manual-ikev2-set-up/)
Bootstrap Admin Panel Generator
Tags: php, crud, bootstrap, design
Published: 2019-06-25 10:35:08

Hi everybody,

##Here's a revolutionary web application to manage your CRUD operations##

**[PHP CRUD Generator](https://www.phpcrudgenerator.com)** is an easy-to-use **graphical web application** that consists of two main parts:
- **The CRUD Generator**, that analyzes your MySQL database and lets you build your administration panel with a very simple and convenient user panel.
- **The Admin Panel**, a fully featured administration system built with Bootstrap, jQuery, PHP and MySQL that lets you manage your content from your database.
 PHP CRUD Generator provides you with powerful administration tools for all types of projects: e-commerce websites, portfolios, products and data management, as well as presentation of all types of data.

The official site offers a [CRUD Tutorial page](https://www.phpcrudgenerator.com/tutorials), where you can find the guides to get started quickly

PHP CRUD Generator builds the Bootstrap control panel for your website from your MYSQL database using a simple and easy-to-use UI.

This CRUD/PHP system will allow you to save enormous amounts of time and build a fully featured and powerful Bootstrap / jQuery administration panel for you in a couple of clicks from your MySQL database.

PHP CRUD Generator is intended for any website owner or web administrator using a MySQL database.
It is not essential to know how to code, it is a graphical application that has a user interface.
Overlap Image Gallery View
Tags: galleryview, android, application
Published: 2019-06-25 10:57:19

OverlappingImageGalleryview is a flexible library which helps you to create overlapping images for Android application.

You can Integrate it with most popular image lib like Picasso & Fresco,or Glide. 

Want to know about the process? You can check code here: [Overlapping Image Gallery view](https://github.com/Mindinventory/overlap-image-gallery-view)
What is Google's 'Kubernetes' project all about?
Published: 2019-06-25 10:47:07

According to Google's website

Kubernetes is an open source container cluster manager. It schedules any number of container replicas across a group of node instances. A master instance exposes the Kubernetes API, through which tasks are defined. 

Kubernetes spawns containers on nodes to handle the defined tasks.
The number and type of containers can be dynamically modified according to need. An agent on each node instance monitors containers and restarts them if necessary.

<a href="https://mindmajix.com/kubernetes-training">Kubernetes</a> is optimized for Google Cloud Platform but can run on any physical or virtual machine.
It's high time to become part of an open source project
Published: 2019-06-25 09:02:52

---
title: It's high time to become part of an open source project
published: true
description:
tags: Nodejs, open source, angular, react.js, vue.js, GraphQL
---

JavaScript developers, I am working on an exciting opensource project pursuing two goals:
1. Learning best practices in JavaScript/NodeJS
2. Helping developers and myself to develop and launch MVPs to validate ideas quickly.

As developers, we have tons of ideas and would be awesome to have a simple tool to scaffold a secure project quickly, add a couple of forms, some project specific logic, and here you go - deploy and test your idea.

Current stack is JavaScript/Nodejs, MongoDB, Redis, Graphql. Plans to add React, Vue, Angular, TypeScript.

It's not a new idea, but It's fantastic to combine learning and building your projects with an opensource that you are actively developing. And it is beneficial for you as a developer to be active in the opensource world.

If anyone feels like working on an open source project, ping me and let's build an awesome project together.

I've done some of the work that is available here https://bit.ly/2ZIdPq4.
How to deal with weak in closure in Swift
Tags: swift, ios, closure, weak
Published: 2019-06-25 10:20:03

---
title: How to deal with weak in closure in Swift
published: true
description: 
tags: swift,ios,closure,weak
---


Traditionally we need to `if let` to `strongSelf`

```swift
addButton.didTouch = { [weak self] in
    guard
        let strongSelf = self,
        let product = strongSelf.purchasedProduct()
    else {
        return

    strongSelf.delegate?.productViewController(strongSelf, didAdd: product)
}
```

This is cumbersome, we can invent a higher order function to zip and unwrap the optionals

```swift
func with<A, B>(_ op1: A?, _ op2: B?, _ closure: (A, B) -> Void) {
    if let value1 = op1, let value2 = op2 {
        closure(value1, value2)
    }
}

addButton.didTouch = { [weak self] in
    with(self, self?.purchasedProduct()) {
        $0.delegate?.addProductController($0, didIncrease: $1)
    }
}
```

---

Original post https://github.com/onmyway133/blog/issues/326
What do you love the most in software development?
Tags: discuss
Published: 2019-06-25 10:16:07

Recently I wondered what about software development attracts me the most and keeps me going. For me, it is the ability to go from idea to a live product, it amazes every single time. Usually most people can't do it by themselves but developers (also some other engineers as well) are blessed with this unique ability.

Let me know what do you love the most in software development?
Rent a Hive 🐝 Test Your Website
Tags: showdev, discuss, javascript, testing
Published: 2019-06-25 09:50:41

Hi developers!

I'd like to share my newest project with you to hear what you think about it, and maybe you find it useful.

https://hive.userinject.com/#/

You can rent a hive of real users that come to your website and perform tasks that you defined. Since my last version of this product people requested that they'd like to specify who the testers are, so you can do this now and tell them to include e.g. their social media profile for a follow up.

And the test projects are public by default (can be changed) so people can first look at your site and then decide to join the test-hive on their own.

Bye, 
Jan
Solo developer & life project management
Tags: help, projectmanagement
Published: 2019-06-25 09:14:34

tl;dr 
What project management tool, or tools, would you recommend for a solo-developer?
By tools I mean both software, hardware and systems.

---

* I'm currently rebuilding my dev webpage and my more general webpage. 
* I'm (slowly) solo developing a game as well as experimenting with a couple of different game ideas/mechanics. 
* I'm developing a component library together with a friend. 
* I'm working on my dev ops skills by having everything on a local server, including a git repository and my own websites. 
* I'm also learning more about React, Web Component, ES6, C# and C development.
* I'm building a radio for my son with raspberry pi and a timetracking device. 
* I'm also slowly expanding my smart home, looking for a new job, working at a dev firm, building furniture, planning a vacation to Scotland, writing a book, becoming a healthier person and, as you can imagine, I'm not sure what I'm forgetting top put on this list. 

So, you know, I'm living.

I belive in single-tasking rather than multi-tasking but, especially when it comes to the development projects, it has become increasingly harder to keep track of all the single tasks I have in front of me. I constantly have to juggle many different ideas and when I focus on one project I often remember I was supposed to have done a task in another project that I forgot about and when I'm done with the current task I forget about it again.

**What project management tool, or tools, would you recommend for a solo-developer?**

By tools I mean both software, hardware and systems.
Building an React Native movies quiz app
Tags: ama, react, reactnative
Published: 2019-06-25 08:24:35

---
title: Building an React Native movies quiz app
published: true
tags: discuss, ama, react, reactnative
---

UPDATE 2019-06-27
The app is released! Check it out on https://ilovemoviez.com
Still, feel free to ask us anything regarding the development!



Today, at itiden (www.itiden.se) we are taking all (about 10) developers to together build app React Native app.

Hopefully we will be able to post it to the stores last thing today, but of course, the Apple process might take a while.

It's an online movies quiz app called I Love Moviez.

The back-end is being built with Node.js using Adonis.js.
For the React Native app we are using Typescript, React Navigation, Mobx and Styled Components. Deployed with Microsoft App Center.

Feel free to ask anything during the day!

We will also post updates to:
https://twitter.com/ilovemoviez
Git for Amateurs
Tags: beginners, git
Published: 2019-06-25 07:22:21

*Originally posted on https://highcenburg.herokuapp.com*

Make it a habit to  run `git status` before doing anything on a repository. I just learned this today and wanted to write it down to make it stick on my mind - or get familiar with it.

1.) To create a new branch :  `git branch <name_of_branch>`. A good practice is to name the branch with the focus of your edit.

Ex:

 `git branch markdown`
 
2.) Next, run `git checkout <name_of_branch>` to work on your branch. Make it a habit to do small changes so it's easy to go back if you mess up.

Once done with your changes, you want to add all changes, commit to your changes and push it to your dev repository.

1.) Now you run  `git status` to see the changes on your repository.

2.) Then run  `git add <filename>` or you can do  `git add -A` to add all the changes instead.

3.) Next, commit your changes by running  `git commit -m "Your message"`

4.) Finally, you push your commit by running  `git push`. Git will compain because GitHub doesn't know about your new branch. So run  ` git push --set-upstream origin <branch_name>` 

If you want to delete a branch. We would go to the main branch then delete our branch from there. 

1.) To go to the main branch, run  `git checkout <main_branch>`

2.) Once in the main branch, run  `git branch -d <name_of_branch>` 

This is what I learned in an hour, with an example of the main repository from a mentor.
Yes, It's More than a Shirt
Published: 2019-06-25 01:11:40

## A Quick Guide to *More* Inclusive Swag

*Problem*: Assigning binary gender information to a piece of clothing makes it challenging for our team members to find the best fit for themselves. This gendering also scopes the distribution of sizing for items. When members have a hard time finding their size in one gender, they are directed to “the other” gender, which can cause personal distress and feelings of being ‘othered’.

*Solution*: There is a straight-forward solution. Stop distributing items as “men’s” and “women’s” items.

1/ Describe the item of clothing by cut: “Straight Cut”, “Fitted Cut”, “Tapered Cut” with diagrams showing the difference between the items themselves, not with body styles or images underneath that might suggest gender. Geometric shapes are useful here.

![](https://thepracticaldev.s3.amazonaws.com/i/1dzfvv8fl81zbl911cs8.png)
**Geometric shapes help people find shirts that are cut to their proportions**

2/ Ask all team members who want team swag to submit their preferred clothing size via anonymous survey with more defined information. Use ranges of sizing or measurements, anonymizing the information and retaining the aggregate sizing information.

3/ All sizes matter. If we order for one, we order for all. Only work with companies who will provide small-number batches for certain sizes to ensure that *all* team members are able to have a cut + size that works for them. (This might mean ordering <5 items in one particular size. The cost of these items is less than the cost of exclusion for one team member.)

Note: I know it’s harder to do this with large third-party events. However, for first-party + team events, it should be within a team’s power + budget to make sure we’re buying + sizing appropriately. The cost of exclusion is higher than the cost of a single item of clothing.
VS Code with Python in Docker Quickstart
Tags: docker, vscode, python
Published: 2019-06-25 06:44:38

---
title: VS Code with Python in Docker Quickstart
published: true
description: How to launch a quick container-based development environment with VS Code!
tags: docker, vscode, python
cover_image: https://code.visualstudio.com/assets/docs/remote/containers/architecture-containers.png
---

You love VS Code? Get ready to love it even more!

Recently, a new extension pack has come out from the good folks at Microsoft that enables remote development! Not only SSH, but also using local containers with either single containers or multiple containers with docker-compose!

## Steps

1. Install [VS Code](https://code.visualstudio.com/) and the [Remote Development](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.vscode-remote-extensionpack) extension pack
2. Start a new project by opening a new directory with VS Code Insiders and create a *requirements.txt* file with the Python packages you wish to have, e.g.:

        django==2.2.2

3. <kbd>ctrl</kbd>+<kbd>shift</kbd>+<kbd>p</kbd> and start typing "remdev", select "Remote-Containers: Add Dev Container Configuration Files..."
4. Search for "pypo" and select "Python 3 & PostgreSQL" as your environmet. This will create a _.devcontainer_ folder with the files:
    - devcontainer.json
    - docker-compose.yml
    - Dockerfile
    - noop.txt

5. <kbd>ctrl</kbd>+<kbd>shift</kbd>+<kbd>p</kbd> and start typing "rerefo", select "Remote-Containers: Reopen Folder in Container"
6. Start coding ☕💻

### A note on opening ports

So how do you open a port to your container? Easy! VS Code already knows which ports are open in your container.

Say you started your server with `python manage.py runserver`, which would open a port on 127.0.0.1:8000 in your container. VS Code is aware of this and will give you the option to forward your system ports to that port.

Press <kbd>ctrl</kbd>+<kbd>shift</kbd>+<kbd>p</kbd>, search "port" and select "Remote-Containers: Forward Port from Container...". A list of open ports will come up, select port 8000.

## Source Code

https://github.com/siaarzh/python-vscode-starter

## References

- [Container Remote Development](https://code.visualstudio.com/docs/remote/containers) with VS Code
- [Django Tutorial part 1](https://docs.djangoproject.com/en/2.2/intro/tutorial01/)
How SEO can Increase your market value?
Tags: seo, marketing
Published: 2019-06-25 06:27:09

Everyone wants to reach the top of search engine ranking without putting much effort. During the beginning of the Internet, the website owners just used to add a few keywords for improving their ranking. This technique only worked for a shorter duration of time when the search engines were quite simple. With the evolution of technology, Google made use of advanced algorithms for improving the ranking. 

Most of the people are not aware of the latest techniques used by most of the owners of the website for improving their visibility. They all make use of SEO services. And these services are considered as the most important tool in digital marketing for appearing in search engine results. Moreover, they help in increasing traffic by turning visitors to clients.
 
Nowadays there are certain marketing problems prevailing in the market that can be fixed with the help of <a href="https://www.striversedge.com/seo-services-mohali-punjab/">SEO services</a>. 

Let’s have a look:

Insufficient Leads

Most of the websites are facing this problem. In this case, there are lots of visitors but those visitors are not converting into your customers. This indicates unqualified leads. Moreover, there can be chances that these visitors might be looking for something interesting but you don’t offer such products.
By making use of SEO services you can surely increase the amount of qualified lead for your website. 

Fewer sales

The main aim of marketing is to make more sales. Whether you are making use of the traditional method or online method your primary focus should be on increasing the revenue. This can be effectively done by attracting a large number of people.

More marketing cost

Most of the entrepreneur usually follows a cost-effective way of attracting more visitors. With the help of these SEO strategies, business owners are able to compete with larger marketing budgets and produce sufficient leads and sales to stay in the business.

What is the role of SEO for your business?

Most of the people think that SEO is just used for attracting more people who search for keywords related to your website. 

But are you aware of the other uses of SEO? 

Have a look at the following points to know more about the SEO:

Brand Building

It is usually a fact that established brands don’t face any difficulty in attracting more visitors to their site. But if you have a new brand and you are struggling to make your market value. Then SEO can boost your sale and traffic.

Geo-Targeting

The best way to increase your sale is to add your location with the brand name. This will help to attract more visitors to that area leading you to make more profit and market value. 

So if you are interested in increasing your market value then go through all these points. They will help you to achieve great success in your business.

About the Author: Mandeep Singh: I’m running <a href="https://www.striversedge.com/">seo company</a> in India that helps startups, small businesses to midsize businesses to grow their business online