teleren/devto huggingface dataset:
When Empty, Display Special Content in Xamarin.Forms
Tags: xamarinforms, mobile
Published: 2021-01-12 01:14:19

With [Xamarin.Essentials](https://docs.microsoft.com/xamarin/essentials/) it's very easy to check for internet connectivity, and with `CollectionView` (same goes for `BindableLayout`) you can choose to display alternate content so your user knows what's going on. This video shows you how to do just that.

{% youtube h-8EGgKV6qE %}

Of course, you won't want to show this when loading content, so use your `IsRefreshing` to display something slightly different in the EmptyView during that phase.

Forgive my poor layout, I polished that up a little after recording. :)

### Resources:
* [Docs: Connectivity](https://docs.microsoft.com/en-us/xamarin/essentials/connectivity?tabs=android)
* [Docs: CollectionView EmptyView](https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/collectionview/emptyview)

{% github davidortinau/Xappy no-readme %}
A trick to change the autocomplete background-color
Tags: design, css, webkit
Published: 2021-01-12 00:44:56

# Story
When I worked on a project as a front end developper I found myself stuck with a little issue, the website was black on the background and when a user would use the input,the autocomplete would turn the box to white background, So I decided to look up on google to find an explanation, it seems that the chrome agent won't let you change your background, so I had to find a new way, here's the solution

## The solution
``` css
input:-webkit-autofill,
textarea:-webkit-autofill,
select:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px #1b1b1b inset !important;
  -webkit-text-fill-color: white !important;
}
```
What we've done here is simply select the pseudo element Autofill and then apply a huge box shadow inside of it, so the background would be covered by the **Box shadow inset**

And then I changed the **text-fill-color** to white

And the result is:
![example](https://dev-to-uploads.s3.amazonaws.com/i/hh2kzz7d787we0cacbwi.png)
 
👍 I hope this post helps you with this CSS property
Hiring a Director of Developer Advocacy!
Tags: hiring
Published: 2021-01-12 00:41:11

## About Us
Nacelle is a leading headless commerce platform that turns traditional eCommerce stores into lightning-fast, mobile-first progressive web apps (PWAs). After going headless with Nacelle, eCommerce retailers have seen 25%+ increases in conversion rates, higher average cart sizes, and the support to handle spikes in traffic. We partner with top retailers including Something Navy, Enso Rings and Barefoot Dreams.

Nacelle is an early stage, venture-backed, fully remote company. In 2020, we have seen rapid growth and closed impressive funding rounds with our institutional investors including Index Ventures, Inovia and more. We also have raised from notable industry angels including leaders from Shopify Plus, Attentive, and Klaviyo.

## About The Opportunity
We are looking for a community-centric Director of Developer Advocacy to best reach and build relationships with our developer, CTO and technical audiences. This role will be responsible for supporting, engaging with and further building out the community as a technical resource and personality.

To be successful as a Director of Developer Advocacy, you should have a software development background, as well as public speaking skills and an approachable personality. A Director of Developer Advocacy is a past developer who is extroverted and enjoys creating content that educates and taking part in discussions in developer communities.

This role will report directly to the VP of Marketing and will work closely with the Sales and Customer Success teams.

## Skill & Qualifications
4+ years experience in a Developer role and 2+ years in a Developer Evangelism role
A Bachelor's degree in Computer Science or Engineering
Experience with GraphQL APIs, event-driven architecture and big data
Experience with Vue and React and frameworks Next, Gatsby and Nuxt
Experience in technical support and sales
Excellent written and verbal communication with a strong affinity for technical writing
Keen attention to detail
Comfortable engaging or leading sessions
Customer-driven mentality, with a drive to go above and beyond to make sure our customers are successful
Love of learning, friendliness, and empathy

## How To Apply
https://grnh.se/a48864753us


_Please feel free to leave questions in the comments section._
Now Hiring- Director of Developer Advocacy
Published: 2021-01-12 00:37:45

Hi! My name is Madelyn and I lead Talent Acquisition at Nacelle. We are looking to hire a community-centric Director of Developer Advocacy to best reach and build relationships with our developer, CTO and technical audiences. This role will be responsible for supporting, engaging with and further building out the community as a technical resource and personality.

Skills & Qualifications:

4+ years experience in a Developer role and 2+ years in a Developer Evangelism role
A Bachelor's degree in Computer Science or Engineering
Experience with GraphQL APIs, event-driven architecture and big data
Experience with Vue and React and frameworks Next, Gatsby and Nuxt
Experience in technical support and sales
Excellent written and verbal communication with a strong affinity for technical writing
Keen attention to detail
Comfortable engaging or leading sessions
Customer-driven mentality, with a drive to go above and beyond to make sure our customers are successful
Love of learning, friendliness, and empathy

More details can be found here - https://grnh.se/a48864753us

Feel free to reach out with any questions!
ใช้ MYSQL สร้าง running number
Tags: mysql, programming
Published: 2021-01-12 00:36:14

เอกสารหลายอย่างในระบบต้องการให้มีเลขนับต่อไปเรื่อยๆ เช่น INV0001-INV9999 ถ้าเราใช้ MYSQL อยู่แล้วมาดูกันว่าจะเอามันมาช่วยสร้าง running number แบบนี้ได้ยังไงบ้าง

สมมติเราทำระบบบัญชี ซึ่งลูกค้าแต่ละคนก็จะมี Invoice Number ที่มี running number เป็นของตัวเองเช่น User A ล่าสุดออก INV0100 อันต่อไปก็ต้องเป็น INV0101 ส่วน User B ล่าสุดออก INV0222 ต่อไปก็ต้องเป็น INV0223

เรามีข้อมูลตาราง User คร่าวๆแบบนี้

```sql
CREATE TABLE users (
  id INTEGER AUTO_INCREMENT PRIMARY KEY,
  name VARCHAR(256)
);
```

เราให้ MYSQL ช่วยเก็บ running number ของแต่ละ user ได้โดยสร้างอีกตารางแบบนี้

```sql
CREATE TABLE inv_numbers (
  id INTEGER AUTO_INCREMENT PRIMARY KEY,
  user_id INTEGER NOT NULL UNIQUE,
  number INTEGER NOT NULL,
  FOREIGN KEY (user_id) REFERENCES users(id)
);
```

เรากำหนดให้ `user_id` เป็น foreign key และ unique key เพื่อลิ้งกลับไปว่า record เป็น running number ของ user คนไหน แบบนี้คือแต่ละ user มี running number ได้แค่ record เดียวแน่นอน

ด้วยตารางแบบนี้ เราสามารถใช้ [`INSERT ... ON DUPLICATE KEY UPDATE Statement`](https://dev.mysql.com/doc/refman/8.0/en/insert-on-duplicate.html) ช่วยเพิ่มค่าของ `number` ไปทีละ 1 และถ้ายังไม่เคยมี running number record มาก่อนก็ให้เริ่มที่ 1 ได้แบบนี้ โดยสมมติเป็น running number ของ user id เท่ากับ 1

```sql
INSERT INTO users (name) VALUES ("Weerasak");
```

```
mysql> SELECT * FROM users;
+----+----------+
| id | name     |
+----+----------+
|  1 | Weerasak |
+----+----------+
```

```sql
INSERT INTO inv_numbers (user_id, number) VALUES (1, 1)
  ON DUPLICATE KEY UPDATE number=number+1;
```

```
mysql> SELECT * FROM inv_numbers;
+----+---------+--------+
| id | user_id | number |
+----+---------+--------+
|  1 |       1 |      1 |
+----+---------+--------+
1 row in set (0.00 sec)

mysql> INSERT INTO inv_numbers (user_id, number) VALUES (1, 1)   ON DUPLICATE KEY UPDATE number=number+1;
Query OK, 2 rows affected (0.01 sec)

mysql> SELECT * FROM inv_numbers;
+----+---------+--------+
| id | user_id | number |
+----+---------+--------+
|  1 |       1 |      2 |
+----+---------+--------+
1 row in set (0.00 sec)
```

จะเห็นว่าถ้าเรา insert แบบเดิมอีกครับ MYSQL จะเช็ค unique key ว่ามีแล้วหรือยัง ถ้ามีแล้วจะเลือกทำส่วน update คือ number=number+1 ให้เราเอง

วิธีนี้ทำให้เราไม่ต้องจัดการเรื่อง race condition ในการเพิ่มค่าของ running number เองถ้า user คนเดียวกันสั่งสร้าง invoice number พร้อมๆกัน เพราะ MYSQL จัดการเรื่อง consistency ของข้อมูลให้เราเองอยู่แล้ว

<a href="https://www.buymeacoffee.com/weerasak" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" style="height: 60px !important;width: 217px !important;" ></a>
5 Reasons to use SVG's in your next project
Tags: svg, ux, logo, webdev
Published: 2021-01-12 00:25:01

## What is SVG ?
Let’s get technical for a second. SVG stands for “Scalable Vector Graphics” and is an XML based, vector image format.

SVGs are predominantly found on the web, and while they have similar uses to JPEG, PNG and WebP image types, their DNA is extremely different.

#### __So why are they different?__

Well, traditional image types like JPEG, PNG and GIF are bitmap-based, meaning they consist of a set amount of pixels. Typically, this means that as soon as you start to increase or decrease an image of this type, you are presented with jagged lines, blurry artifacts and a pixelated mess.

## WHY ?

---

> ### 1. Resolution
> ### 2. Animation
> ### 3. Accessibility and SEO
> ### 4. Speed
> ### 5. Practicality

---

## Resolution

An SVG will scale indefinitely and will remain super sharp at any resolution.
It doesn’t matter about your screen size, zoom level, resolution or whether or not you have a ‘retina’ display. SVG is vector based, paths, shapes and fills. This allows for infinite resolution, much like when creating artwork for print and using shapes, the same principles apply!

---

## Animation
SVGs can be animated and styled with CSS. Animations (transformation/transition) that you use on HTML elements can also be used on an SVG element. There are instances where you can’t use CSS to animate SVGs but these instances can usually be covered with JavaScript

This opens up a whole world of creativity when it comes to the web

----

## Accessibility and SEO
Google index’s SVGs, which is good news. SVG content whether it is in a standalone file or embedded directly in HTML is indexed.


---

## SPEED

 Due to the nature of vector graphics, the data that determines the file size are the layers, effects, masks, colors, and gradients used.

In comparison, bitmap-based images record each and every pixel in the image as well as the number of colors used. Admittedly, it’s a little more complicated than that, but the thing to take away from this is that for the most part, a bitmap-based image will be more expensive than an SVG counterpart.

On top of this, you can make your SVG files even smaller by compressing them with gzip. This means that fewer bytes need to be sent from the server or CDN if gzip compression is enabled.

---

## Practicality

__Graphs__: Yes, graphs… SVGs are great at vector shapes, lending itself to things like infographics and graphs very well indeed.
__Logos__: Logos are usually vector based, and rightly so, The beauty here is, you could define an SVG document as your logo and then use it wherever you like without worrying about size, resolution or load times. The same factors apply for icons too.
How to create your spinner using loading.io
Tags: javascript, design
Published: 2021-01-12 00:21:48

Hi
Today I've been in the need of making an AJAX call and so I needed a loader or spinner, I've been wondering if I could make one or download one, and then I land on this result: https://loading.io/

It's a really good tool for making Spinner though it's limited due to the free plan but still fitting my needs

I recommend you to check it out
Day 1 @ Local Hack Day: Build
Tags: majorleaguehacking, localhackday, beginners
Published: 2021-01-12 00:18:19

Yesterday was my first time at Major League Hacking's Local Hack Day: Build!
This event is normally done with a group of other people, so you form guilds and finish challenges to get points.
My guild (ESTechies) managed to come into the top 10 for the first day.

As someone who is new to hackathons (this being my 5th), the guild has been a place of support and encouragement. The MLH live streams and workshops have also helped tremendously in creating projects to submit.

Here are my 5 tips for having fun at LHD: Build and ideally ranking within the top 100:

1. Do the mini-challenges!
You get a lot of points for just posting about LHD on socials and following MLH! Find these little challenges and participate in them.

2. Partner up with your guildmates!
A lot of guilds are open to beginners and will give you advice or resources to help you get started. Find a partner who would want to work on a project with you and start hacking!

3. Google tutorials
All of us are beginners with something! I had google how to write hello world in Ruby to complete one of the challenges. So have those google tabs open and follow along with a tutorial.

4. MLH Live streams/Workshops!
These are some of the easiest ways to start a project. Join the stream and code alongside an MLH host. You can ask questions and learn from people all over the world. 
P.S these are recorded, so if you're in a different timezone, just look for the recordings!

5. Sleep!
It's really hard to create projects and think without getting enough sleep. So make sure you're prioritizing resting.

Happy Hacking!
Reproducible R code with PACMAN
Tags: rprogramming, datascience, pacman, sharecode
Published: 2021-01-12 00:13:45

Maybe you ever found yourself in the situation of having to share an R script and having to give too many explanations :joy: :joy:! 
In R, the use of libraries is very frequent and these are installed locally on each computer, so a good way to make our codes reproducible is to use *Pacman*.


This library that is available in CRAN has a very useful function **p_load()**. This function loads the package to the work area and, if it is not installed, installs it. 

Well ... yes, but in this case I should warn you to install pacman to run my code

### NO !

With this simple sentence, we can do that in the case that the person does not have pacman installed, install it. *And for the other libraries use p_load()*

### An example :

```r
if (!require("pacman")) {
  install.packages("pacman")
  library(pacman)
}
p_load(here,pracma,tidyverse,magrittr)
```


In this case, we call the library pracma, tidyverse and here.

Another library that focuses on reproducibility is "here", this library uses the workspace we are working on and concatenates its arguments separated by commas.

```r
here("ExampleHere","Folder1","Script1.R")
```

And the result :

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

### Share your code!
How to add approx read time on posts in Jigsaw?
Published: 2021-05-17 09:52:48

---
title: How to add approx read time on posts in Jigsaw?
published: true
date: 2021-01-12 00:00:00 UTC
tags: 
canonical_url: 
---

My current blog is developed using [Jigsaw](https://jigsaw.tighten.co/) and their [awesome template](https://github.com/tighten/jigsaw-blog-template).

Jigsaw is a framework for rapidly building static sites using the same modern tooling that powers your web applications.

I absolutely love the design and made little to no changes on it. One thing I very much needed is to show read time on each article. This is how I accomplished it.

- Add a new helper in `config.php`.

```
'getReadTime' => function ($page, $wpm = 150) {
        $content = strip_tags($page->getContent());
        $word_count = str_word_count($content);
        return ceil($word_count / $wpm);
    }

```

- Use the helper in `post-preview-inline.blade.php`. In blog template this file is used to give an inline preview of posts.

```
 <a
    href="{{ $post->getUrl() }}"
    title="Read more - {{ $post->title }}"
    class="uppercase font-semibold tracking-wide mb-2"
    >
    {{ $post->getReadTime() }} Minutes Read 
</a>

```
Assertions of Truth in Ruby Tests
Tags: ruby, testing, programming
Published: 2021-01-17 09:27:19

---
title: Assertions of Truth in Ruby Tests
published: true
date: 2021-01-12 00:00:00 UTC
tags: ruby,testing,programming
canonical_url: https://jsrn.net/programming/2021/01/12/ruby-testing-should-we-assert-truth.html
---

I used to write my assertions like this:

```ruby
assert user.active?
refute user.inactive?
```

Then I joined a team where I was encouraged to write this:

```Ruby
assert_equal true, user.active?
assert_equal false, user.inactive?
```

_What?_ That doesn’t look very nice. That’s doesn’t feel very _Ruby_. It’s less elegant!

Here’s the thing, though: your unit tests aren’t about being elegant. They’re about guaranteeing correctness. You open the door to some insidious bugs when you test truthiness instead of truth.

- You might perform an assignment rather than comparing equality.

```Ruby
def active?
  # Should be status == :active
  status = :active
end
```

- You might check the presence of an array, rather than its length.

```Ruby
def has_users?
  # Should be user_list.any?
  user_list
end

def user_list
  []
end
```

Over time, I’ve gotten used to it. This style still chafes, but not as badly as bugs caused by returning the wrong value from a predicate method.
How to continue a git rebase process?
Tags: git
Published: 2021-01-12 00:00:00

---
  title: How to continue a git rebase process?
  published: true
  tags: Git
  date: Tue Jan 12 2021 05:30:00 GMT+0530 (India Standard Time)
  canonical_url: https://melvingeorge.me/blog/continue-rebase-process-in-git
  cover_image: https://melvingeorge.me/_next/static/images/main-b3d96b5afa899ac0c79833b1483c8b4a.jpg
  ---
  [Originally posted here!](https://melvingeorge.me/blog/continue-rebase-process-in-git)
  
Sometimes during a Git rebase process, you may encounter some merge conflicts and Git asks you to resolve the conflicts to move forward with the rebasing.

After resolving the conflicts and to move forward with the rebase process, you need to use the `--continue` flag on the `git rebase` command.

It can be done like this,

```bash
git rebase --continue
```

That's it.

### Feel free to share if you found this useful 😃.

---
WHAT IS AWS? | And Why it Enables the American Dream
Published: 2021-01-11 23:57:21



Today we explain AWS and how it blows a door open for the poor to achieve the American dream.

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

AWS is three things, 

1. AWS is an army of computers at your fingertips.
2. AWS makes code at scale permission-less.
3. AWS is an enabler of upward mobility.

AWS has changed the way I see the path upward for my career. It feels like an obligation that I put to words what AWS is and its implications on society. 

My views on leverage are inspired by Naval Ravikant's. He sees the world in a beautiful way, definitely check out the sources for his work.

I explain the three parts of AWS in detail in this short 🎥 YouTube video. Check it out if you want to learn more!

{% youtube Dpra_v4u9Ww %}
When would you decide to use RPA?
Tags: bestpractice, rpa
Published: 2021-01-11 23:34:38


RPA must be considered with other technical options and the process has different abilities. Use RPA when an organization wants to start or build a structure with some repetitive process. The best way to select this process is to define a rule count, the following are recommended:

1. Organizations need to use RPA, you need to check this because sometime exist a diferente tools for especificr business.

2. In the business case your need to chege the paramter more fexible.

3. Consider RPA is the same manner you consider to another employee in the organization because is no the same to commont software is more than someone to work with external system.

4. Bots must be configured on zero trust principles and treated as an IT asset.

5. Your should the complex of the business for implement RPA.

6.  If you want to automate a process you must have a standardized process with documentation.

7. Find a unique and new vision of intelligent automation, foster internal automation skills

8. Build your model with the potential human error mindset, make employee well-being a priority, as automation will require a new approach to evaluating the employee experience (EX).

9. Foster the right automation mindset, refocus on the customer, develop leadership, discuss proactively and transparently.

Implementing RPA is not an easy task, it is a mindset with your employees, with the people with their work with everyone. You must know your business and verify the area that really needs an RPA and implement with peripherals.
Day 3, 4 - 100daysofcode
Tags: 100daysofcode, react, javascript, webdev
Published: 2021-01-11 23:13:33

Got introduced to React file structuring and "create-react-app" an amazing way to get a skeleton for react apps, which makes our lives much easier 😁
And, using the knowledge gained so far build a simple Pokemon game which from a total of 8 Pokemons divided them into a set of two and with base experience decided which team would win in a battle.

Next up will be looking into React states and will try to read the official documentation of React also 🧾.
How to consume an external API with Laravel and Guzzle
Published: 2021-01-11 23:08:04

Check out this post on the [devdojo.com](https://devdojo.com/) website!

It is a post on [How to consume an external API with Laravel and Guzzle](https://devdojo.com/bobbyiliev/how-to-consume-an-external-api-with-laravel-and-guzzle) 🔥!

To make things even better you can use this referral link to get a free $100 credit that you could use to deploy your virtual machines and test the guide yourself on a few DigitalOcean servers:

[Digital Ocean $100 Free Credit](https://m.do.co/c/2a9bba940f39)

Link to the post:

https://devdojo.com/bobbyiliev/how-to-consume-an-external-api-with-laravel-and-guzzle

I strongly encourage everyone to go ahead and check out the [devdojo.com](https://devdojo.com/) website, there's a lot of valuable content there.
Day 285 : Go To Sleep
Tags: hiphop, code, coding, lifelongdev
Published: 2021-01-11 23:05:25

_liner notes_:
- Saturday : Did laundry, worked on my side project and did the radio show. The recording of this week's show is at https://kNOwBETTERHIPHOP.com

![Radio show episode image of a rioter in the Capitol smiling, waving and carrying Nancy Pelosi's lectern](https://dev-to-uploads.s3.amazonaws.com/i/ile1hjqf7l7qym9z0huc.jpg)

- Sunday : Went to check out a friends new office space. He's got some really good ideas with what he wants to do. Make it kind of like a community spot. Got to demo one of my projects and it worked. Got really good feedback. Ended the night working on my side project.

- Professional : Got to do the live stream show again. Always have fun doing it. Learned about a VS Code extension that lets you do HTTP requests and more right from the editor. Going to try it out because it may work well for me since I code on a Chromebook and can't really install programs like Postman. Had a couple of other meetings. Rest of the day worked on updating documentation.

- Personal : So I noticed that some of my side projects stopped working and I was going to take Sunday to figure them out. First, my website stopped updating. Traced it down to the cloud scheduler not working. Found out that Firebase can set the scheduler right on the functions. Before, I had to create a scheduler in the Google Cloud dashboard and link my update function. Tried to deploy my new function and got an error. Followed the link in error and found out that the credit card I used for the account had expired. I thought I got all the accounts switched over, but looks like I missed one. Fixed it and all the other things that were broken started working again. Lesson learned.

![View from the ocean looking at mountains in Norway with circular star tails above.](https://dev-to-uploads.s3.amazonaws.com/i/deu27rwil4sjrtsyl39e.jpg)

Going to work a little more on what I was doing at work. Just got a few things left on my list so I can start on something new tomorrow. After that, I'll be working on my side project and then go to sleep.

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube rItKbRLmDTk %}