teleren/devto huggingface dataset:
How to create reusable UIView with .XIB file for easy design
Published: 2020-03-22 16:48:06

Custom `UIView` subclasses are huge productivity win. You can program them once and then use the result across your project or projects. However by default Xcode does not allow to also create .XIB file for designing using Storyboard editor like it does for custom `UITableViewCell` for example.

In this short post, I will show you how to design custom `UIView` with `.XIB` file.

## Create Swift class

The first step is to create `.swift` file for you `UIView`. Something like this:

```swift
import UIKit

class CustomView: UIView {
    
}
```

### Create .XIB file

Then add new file to your project a under “User Interface” select the option "View":

![Selecting View option when adding new file](https://dev-to-uploads.s3.amazonaws.com/i/2jbha6mkntpw0073l19t.png)

Use the same name as for your subclass, in this case `CustomView`.

By default the preview is shown as entire device. But you can change this in the Size Inspector. Under "Simulated Metrics" choose the "Size" to be "Freeform" and also at the bottom select for example iPhone 8 to get rid of the safe areas of iPhones with a notch.

![Changing Simulated Metrics settings](https://dev-to-uploads.s3.amazonaws.com/i/5qfexr21augx17rarkuv.png)

Now you can resize the view freely and approximate how it is going to look like in use.

To connect the `CustomView.xib` with our class, select the "View" in Document Outline, switch to Identity Inspector and as a "Class" enter the "CustomView".

![Settings the Class in Identity Inspector](https://dev-to-uploads.s3.amazonaws.com/i/ygi8p256za04d1y1mnhe.png)

That is all! You can now design your view and connect `@IBOutlet`s to the class.

### Using `CustomView`

To create instance of the `CustomView` using `.xib` file add this method:

```swift
class func instanceFromNib() -> CustomView {
        let view = UINib(nibName: "CustomView", bundle: nil).instantiate(withOwner: nil, options: nil)[0] as! CustomView
        return view
}
```
You need custom initialization code, you can create `setupView` method and call it before returning the `view`:

```swift
fileprivate func setupView() {
        // do your setup here
}
    
class func instanceFromNib() -> CustomView {
        let view = UINib(nibName: "CustomView", bundle: nil).instantiate(withOwner: nil, options: nil)[0] as! CustomView
        view.setupView()
        return view
 }
```

Thanks for reading!

Do you have your own ways of creating reusable views? Let me know 🙂



[![Scan it - wide banner](https://nemecek.be/media/images/scanItWideBanner.png)](https://apps.apple.com/app/scan-it-scan-and-export-pdf/id1509634112)

-- 
Need to *focus on your iPhone*? Get free WebBlock app for scheduled website blocking from the [App Store](https://apps.apple.com/us/app/webblock/id1513121732)!
How to deploy a Blazor app to Azure Storage
Tags: azure, blazor, wecoded, womenintech
Published: 2020-03-22 16:46:55

I was playing around with [Blazor web assembly](https://dotnet.microsoft.com/apps/aspnet/web-apps/blazor) and found out that you can [deploy an app](https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/blazor/?view=aspnetcore-3.1&tabs=netcore-cli) to an Azure storage account

I did a quick tutorial on how to do this.

{% youtube AtEDr5YBs20 %}

I plan on creating more content around Azure; it's great to share what I've been learning.

If you have ANY feedback at all, please let me know in the comments below or reach out to me on socials.

Thanks for reading and possibly watching!
You only need 0.52 ETH to register
Tags: devops, npm, css, javascript
Published: 2020-03-22 16:46:38

Smart contracts operate automatically in complex programming languages, without anyone being able to change its principles including its creator.

 You only need 0.52 ETH to register (this time it's yours).
 It was never vandalized, hacked, or deactivated.
 It is a form of Defi, which stands for Decentralized Finance, and its operations are compatible with Trust and Metamask wallets.

 Open source and validated on Etherscan.

 The cost of creating it is almost zero, no website, server or fuel to run it, it is a lot of investment in the brain.

 You have 10 years to develop it before you need to renew it when you receive great benefits from it, and so on and it will work forever to serve you.

 Note:
 ETH and your team, the system you created does not send any 1 total wallet at all.
 The contract itself does not contain any ETH.
 It just forwards that 100% ETH to the wallets of other users.

 With only 0.52 ETH initially, but it helps you to make a huge income depending on the time and effort you share and help others manipulate like you.

How does it work ?

 1. You register 0.5 ETH and you become Vl 1.
 Get 0.5 ETH from 3 F1 registered with you or wait for the overflow is 3 x 0.5 = 1.5 ETH.

 2. You upgrade to Lv 2 potential of 13.5 ETH.
 Get 1.5 ETH from your 9 F2 as 9 x 1.5 = 13.5 ETH
 To achieve that, you need to help your 9 F2 have their 27 F1 and this 9 F2 then upgrade to Lv 2 like you.  Before this, your 3 F1 upgrade level 2 is 3 x 1.5 ETH, the transfer contract to your upline when your upline is Lv 2 or higher, otherwise to higher upline or admin.

 So on to level 4 and repeat 2nd. You get ETH in each of the 5, 6, 7, 8 corresponding to ETH from 3 F1, 9 F2, 27 F2, 81 F4.

 You recruit people effectively and quickly, this contract is spread very quickly.
 Sometimes, you will not be able to upgrade your account in time because the number of new IDs + the upgraded IDs increases exponentially, exponentially.
 At this point, you temporarily lose benefits higher than your current rank (level exceeded).

 Find out clearly and sign up right before it gets popular worldwide.

 Contact me if you do not understand enough to join.

 Website: https://nguyenphunho.github.io
.Net 5.0 Preview 1 with Kentico 13 Beta 2 - A Double Phoenix
Tags: dotnet, dotnetcore, kentico
Published: 2020-03-29 12:56:28

---
title: .Net 5.0 Preview 1 with Kentico 13 Beta 2 - A Double Phoenix
published: true
date: 2020-03-22 16:32:34 UTC
tags: dotnet, dotnetcore, kentico
canonical_url: https://www.mcbeev.com/Blog/March-2020/Net-5-with-Kentico-13-Beta-2
---

If you have been listening to some of my [recent podcast episodes](https://www.mcbeev.com/Blog/February-2020/Kentico-Rocks-Podcast-Episode-28), you have been hearing how I have been excited for a bit now about the **Kentico 13 Beta 2** release and how it sets up [Kentico EMS](https://www.kentico.com/product/kentico12) for the future. You may also have heard me talk about the future of .Net and why it matters to the .Net development community and why .Net Core is better than ASP.Net MVC 5 on the full .Net 4.x Framework.

Well I decided to put my money where my mouth is over the weekend. I was inspired to give the absolute latest bleeding edge scenario of .Net technology a try with the Kentico 13 Beta. I wanted to download Kentico Phoenix, install a clean version of it, and attempt to run [**.Net 5 Preview 1**](https://devblogs.microsoft.com/dotnet/announcing-net-5-0-preview-1/) as my front end MVC live site connected to Kentico. That's right, to hell with the 18-year-old full .Net Framework. Sorry young **.Net Core 3.1** , I am even skipping right past you too. I'll take the 6-day old version of .Net 5 (the successor to both).

![.Net 5.0 Download screen](https://dev-to-uploads.s3.amazonaws.com/i/mociwu0j670lphn988en.png)

Or, as I aptly have termed this scenario, let’s create a **Double Phoenix**. Get it? .Net 5 is .Net Core reborn just like Kentico 13... Yeah, I know it's cheesy, but it’s a catchy hashtag for sure [**#DoublePhoenix**](https://twitter.com/search?q=%23DoublePhoenix).

Keep reading to find out **[how Kentico 13 Beta 2 makes it possible to create a .Net 5.0 site today](https://www.mcbeev.com/Blog/March-2020/Net-5-with-Kentico-13-Beta-2)**.
The Live Coders Conference
Tags: livecoding, conference
Published: 2020-03-27 14:41:33

---
title: The Live Coders Conference
published: true
date: 2020-03-22 16:21:14 UTC
tags: livecoding,conference
canonical_url: https://www.geewiz.dev/2020/03/22/the-live-coders.html
---

There won’t be many conferences in the next few weeks, at least not the sort that you need to attend in person. However, with COVID-19 handing out lemons, people start to discover the lemonade of online conferences!

I’m happy to be part of an initiative by The Live Coders, a community of people broadcasting their software development on Twitch. On 9th April, we’re going to broadcast more than 12 hours of presentations on a wide range of topics. With my talk about burnout prevention, I’m probably going to have an afternoon (from my POV) slot.

For details, check out [The Live Coders Conference](https://conf.livecoders.dev/). Andy, one of the organisers, also did a write-up on [Setting up an online conference](https://dev.to/luckynos7evin/setting-up-an-online-conference-part-1-2o).
100daysofcode Flutter
Tags: 100daysofcode, flutter
Published: 2020-03-22 16:16:53

day 13/100 of #100daysofcode #Flutter
Belajar Flutter , dari kursus Udemy from
@maxedapps

New Project from Course, today learning about GirdView, SliverGrid, gradient, optimation with const
https://github.com/triyono777/100-days-of-code/blob/master/log.md
Công ty nông sản Vũ Lâm
Published: 2020-03-22 16:15:19

Công ty Nông sản Vũ Lâm - Chúng tôi tự hào là đơn vị cung cấp thực phẩm sạch hàng đầu tại Việt Nam. Với kinh nghiệm nhiều năm phục vụ các khách hàng khó tính nhất, chúng tôi đã có những chính sách riêng biệt giúp hai bên đi đến tiếng nói chung trong vấn đề cung cấp hàng hóa
https://cheesewerks.com/
Mac, Linux 에서 vscode 하스켈 개발환경 세팅하기 업데이트(2020-10-10)
Tags: haskell, vscode
Published: 2020-03-22 16:08:31

---
title: Mac, Linux 에서 vscode 하스켈 개발환경 세팅하기 업데이트(2020-10-10)
published: true
description: 
tags: haskell,vscode
---

이 글은 과거에 [Haskell-Ide-Engine](https://github.com/haskell/haskell-ide-engine) (이하 hie) 이라는 language server 를 이용한 개발환경 구축에 대해서 설명했었어요. 이태껏 HIE 를 이용한 방법을 설명했던 이유는 당시 하스켈은 아직 공식 language server가 없었고, 그나마 있던 방법들중 HIE 가 가장 큰 커뮤니티와 완성도를 자랑했기 때문이에요.

하지만 며칠전 하스켈을 쓸 일이 생겨서 확인해보니 공식 language server 가 생긴걸 확인했어요. 바로 [Haskell-Language-Server](https://github.com/haskell/haskell-language-server) (이하 HLS) 에요.

2020년 1월 HIE 개발자들과 GHCIDE 개발자들이 하스켈 개발환경의 표준을 만들자는 취지로 합심해서 만든게 바로 HLS 에요.

써보니 다음과 같은 관점에서 너무나도 좋아졌다는걸 확인했어요.
* 전체적인 개발환경 설치에 걸리는 시간과 용량이 엄청나게 단축됐어요. 기존에 genesis 상태만 10GB 넘게 차지하면서 반나절씩 걸리던게 이젠 정말 200mb(정확하지 않음) 남짓 차지하면서 순식간에 되는것 같아요.
* 전반적인 개발환경 세팅이 매우 단순해졌어요. 기존에는 nix랑 cachix도 알아야 하고, ghc버전관리도 직접 해야 하는 등 매우 복잡했던 설치 과정이 rustup을 표방한 ghcup이 알아서 다 해주더라고요. 애초에 제가 이 글을 써야만 했던 이유가 사라진거죠.

따라서 이 글에선 기존 내용을 지우고, 그냥 링크만 걸어놓아도 될것같다는 생각을 했습니다.

여기서 ghcup을 설치하시고,
https://gitlab.haskell.org/haskell/ghcup-hs/-/blob/master/README.md

여기 README 를 읽으면서 language server 랑 vscode client 를 설치하시면 됩니다.

https://github.com/haskell/haskell-language-server#ghcup
Building an Asynchronous Weather Application with the core of Node.JS
Tags: node, darkskyapi, mapboxapi, commandlineinterface
Published: 2020-03-22 16:08:12

## What is Node.JS?
>Node.JS is a JavaScript runtime built on **Chrome's V8** JavaScript engine. It uses an event-driven, non-blocking I/O model that makes it lightweight and efficient to build fast, adaptive, and network applications. 

## Asynchronous 
>It is a simple workable technique to perform long network requests without blocking the main thread. This makes use of **callbacks**, **promises**, and **async/await** to achieve asynchronously. 

## Overview 
The program consists of only two functions (**forecast** and **geocode**) in the **utils** directory and an entry point to the application called *app.js*. The user is required to provide a location name that is converted behind the scene to coordinates pairs (**Longitude** and **Latitude**) that are then passed to the forecast function to display the current location weather with a report briefly. 

## Features 
* Forcast using the Darksky API
* Geocoding using the Mapbox API
* Inputs from Command Line Interface (CLI)

## Github Repository 
* [Weather App](https://github.com/akeren/weather-app)

## Result Screenshot 
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/zmmzq0owe06hjticia2c.png)

## Validation Error Message
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/kb6sywyc6jkqowie068m.png)

## Code snippets
>![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/vk006wcuqw177u72gaw2.png)
>![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/lojr03jp08ezu5bbgwx1.png)
>![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/pa8squ55vn4i2c1g5jhf.png)
City Builder in Unity3D | Part 3
Tags: youtube, game, city, builder
Published: 2020-03-22 16:03:18

Hey!
This is my 3rd part in my series, 
in this series I'm writing a City Builder Game,
In this episode I made the grid system for my game!

Come, Watch and leave a Like and Subscribe :)

{% youtube 81MBm3DSxmQ %}

> Like this post? 
> Support me via [Patreon](https://www.patreon.com/eranelbaz)
> Subscribe to my [YouTube Channel](https://www.youtube.com/channel/UCVUNeBGM5wZJKcOx0QwAaTA?sub_confirmation=1)
IRC : A good alternative to Saas collaborative tools
Tags: irc, collaborativetools, alternative, roots
Published: 2020-03-22 15:38:33

___________________________________________________

Hi every one.
This article is a shot gun article. So apologize (or thank) because of its size.

In that peculiar covid19 period, when all those ones, students and workers forced to stay home use and abuse of the network, the use of Saas tools to help continuing working from home has exploded.

Platforms like Slack, Teams or Discord are overwhelmed. But still work.
Reading some news saying that Teams, or the CNED educational platform in France were down for a time I decided to write a little help using the IRC in order to lighten some services or help continuing working if some were down.

Some may think that the **IRC** was dead... definitely not !

If you are stuck with some of your favorite service, here is a presentation that may help :

[A good alternative to web collaborative platforms](https://beta.deckdeckgo.io/Hacksterix/a-good-alternative-to-web-collaborative-tools/)

Hope this helps.
Sincerely
How to Minify Lua Code?
Tags: lua
Published: 2020-03-22 15:28:15

Are you using Lua Code? If yes then this tutorial is a must helpful for you because everyone likes minified code because it improves the loading of files.

So you are manually minifying Lua code, why not use automatic minifier.

So today in this tutorial I will introduce [Lua Minifier](https://goonlinetools.com/lua-minifier/).

![](https://res.cloudinary.com/practicaldev/image/fetch/s--XpWHhZsv--/c_imagga_scale,f_auto,fl_progressive,h_420,q_auto,w_1000/https://dev-to-uploads.s3.amazonaws.com/i/u8hpvc4dl9cld4rmpt26.png)

### Here is How to Minify Lua Code?

1. First Open this [Lua Minifier](https://goonlinetools.com/lua-minifier/)
2. Click on Clear Button to Clear Demo Code
3. Paste Lua Code
4. Click on Minify Button
5. Now Press Copy Button to Copy Minified Lua Code

Do you want to Beautify your Minified or Ugly written code? If yes then read [this guide](https://dev.to/goonlinetools/how-to-beautify-lua-code-5co4). 

Thanks for reading this article if you have any question regarding then please ask in the comment box.
TetraQuicky01: Transmission on Linux Server via Docker
Tags: docker, torrent, transmission
Published: 2020-03-22 15:01:33

How many time you wanted to have a quick torrent client running on an headless server instance, but you were put off by ... installing transmission... setting users, storage space... `initd` or `systemd` to start at boot... and then ending up with the usual terrible transmission web UI?
Well if you know how to install docker, look no further...

## TL;DR
```bash
docker run -d --name=transmission \
-v <important directory for the config>:/config \
-v <important directory for the downloads>:/downloads \
-v <I don't really remember that>:/watch \
-e PGID=1000 -e PUID=1000 \
-e TZ=London \
-e TRANSMISSION_WEB_HOME=/combustion-release/ \
-p 9091:9091 \
-p 10411:10411 \
-p 10411:10411/udp \
--restart=unless-stopped \
linuxserver/transmission:latest
```

## Looking more specifically at all the arguments...
- `--name=transmission` or whatever name you prefer for your
- all the `-v` are important pieces for mounting some directory into the container. Especially for the `downloads` location, make sure to have enough space.
- `-e PGID=1000 -e PUID=1000`: this is probably the most important and overlooked; it makes sure that newly downloaded files are having the user and group permission so that you can read and write them freely. 1000 is the default `uid` in most of the Linux installation but adjust accordingly if this is different (maybe you can check yours with `echo $UID $GROUPS`)
- `-e TZ=London` so your files are saved with the correct timestamps... if you care about that stuff.
- `-e TRANMISSION_WEB_HOME=/compustion-release/` this trick will give a _reasonably_ more modern UI (that works really well with mobiles)
- `-p 9091:9091` you need this to access the web UI at `http://localhost:9091` (you can redirect that port... I do usually)
- `-p 10411:10411 -p 10411:10411/udp` these are the port you need to open to have better download performance: 10411 is actually optional; you can choose which port you want. You remember to make sure this port is open also in your model, otherwise is pointless
- `--restart=unless-stopped` if you set the docker daemon to run at boot (like it does usually by default) this is making sure that your transmission headless client starts at boot as well... and in general... unless you don't specifically stop it.
- `linuxserver/transmission:latest` the most important part; the docker image to start a new container from.

---
NOTE:
Although I usually don't endeavour the use of `latest` version of the container, in this case, I think is not a bad idea... as this is probably running on your personal server, and if you keep the same directory volume mounted you can *upgrade* to the latest version of transmission simply by stopping the container and re-running a new container (with a different name) using the same command line.

---
TetraQuicky00: Get your IP location from the command line
Tags: bash, iplocation, powershell, vpn
Published: 2020-03-22 13:54:45

Well if you are reading this probably, you are looking at bash solution.
# Bash
```bash
curl https://ipinfo.io/json
```
are you interested in specific information? By now you should now the easier way to parse JSON in the command line is `jq`. I personally suggest you install it with `snap` if you can.
So then you can do fancy stuff like
```bash
$ curl -s https://ipinfo.io/json | jq -r '.region'
Latium
```bash
# Powershell
Oh my god, really? Kudos!! Well, the good news is that you can do basically the same (assuming you are on `pwsh` 6 or 7):
```powershell
curl -s https://ipinfo.io/json | jq -r '.region'
Latium
```
But if you don’t want to install an external tool like `jq` in windows, you can go native with something like:
```powershell
Invoke-RestMethod http://ipinfo.io/json
```
Which returns you one of these strange .NET objects you can also dissect easily and do something like:
```powershell
$(Invoke-RestMethod http://ipinfo.io/json).region
Latium
```
# Special Tools if you want to avoid to go online too often
Well, there are interesting tools out there. One I was looking at is `geoiplookup`.
You can get it via the package managers of the distro and also via `snap`
## Via SNAP
sudo snap install geoip-lookup
## Via APT
```bash
sudo apt install geoip-bin
```
and you can do fancy things with local DBs reducing the number of requests:
```bash
geoiplookup `curl ifconfig.me`
```
And if you want to go more precise, without having to go and forth with external APIs you can do stuff like:
```bash
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
gunzip GeoLiteCity.dat.gz
mv ./GeoLiteCity.dat /usr/share/GeoIP/
geoiplookup -f /usr/share/GeoIP/GeoLiteCity.dat `curl ifconfig.me`
```
So now you can quickly check if your encrypted delocalised VPN is working correctly by only doing:
```bash
curl https://ipinfo.io/json
```
after all, isn’t that is what is all about?
Stats regarding the use of maintainers in Helm repos
Tags: kubernetes, devops
Published: 2020-03-22 13:40:54

Here's some random stats about the popularity of the `maintainers` YAML property in the Helm charts in the [stable and incubator repos](https://github.com/helm/charts).

To learn more about the `maintainers` property, visit [the official docs](https://helm.sh/docs/topics/charts/).

*Stable charts*
Total charts: 285
Maintainers set in 214 charts (75%).

*Incubator charts*
Total charts: 63
Maintainers set in 42 charts (66%).

The vast majority, if not all, of the charts without maintainers are deprecated.

I'm not sure if the maintainers property is mandatory to get into this repository. Given the high adoption rate, it would make sense if it was.
How to check if a git branch exists in the local/remote repository?
Tags: git, bash
Published: 2020-03-22 13:11:04

### 1. To check the branch in the local repository

```
# Local:
# https://stackoverflow.com/questions/21151178/shell-script-to-check-if-specified-git-branch-exists
# test if the branch is in the local repository.
# return 1 if the branch exists in the local, or 0 if not.
function is_in_local() {
    local branch=${1}
    local existed_in_local=$(git branch --list ${branch})

    if [[ -z ${existed_in_local} ]]; then
        echo 0
    else
        echo 1
    fi
}
```

### 2. To check the branch in the remote repository
```
# Remote:
# Ref: https://stackoverflow.com/questions/8223906/how-to-check-if-remote-branch-exists-on-a-given-remote-repository
# test if the branch is in the remote repository.
# return 1 if its remote branch exists, or 0 if not.
function is_in_remote() {
    local branch=${1}
    local existed_in_remote=$(git ls-remote --heads origin ${branch})

    if [[ -z ${existed_in_remote} ]]; then
        echo 0
    else
        echo 1
    fi
}
```

gits URL: https://gist.github.com/iridiumcao/714d3d0a9137ce614c26e4e10d185291