teleren/devto huggingface dataset:
Nested builders with Action<T>
Tags: csharp, designpatterns
Published: 2019-09-10 18:28:23

---
title: Nested builders with Action<T>
published: true
description: How to create a nested builders
tags: Csharp, design patterns
---

Once I started to use the Builder Pattern it didn't take long until I faced more complex objects on multi levels. 

My first solution to this was to add a method returning a new Builder and in that builder have a Complete method that would return my original Builder. 

Sounds complex doesn't it? It sure is! Once I got beyond 2 levels of nesting the builder implementation was a real hell every time.

Then I discovered I could use Action<T>, where T is another Builder. This made my builders easier to implement, and also easier to maintain.

Here's a code example on how it could look like:

```csharp
public class Person
{
    public string Firstname { get; set; }
    public string Lastname { get; set; }
    public List<Person> Children { get; set }
}

public class PersonBuilder 
{
    private readonly Person _person;

    public PersonBuilder()
    {
        _person = new Person();
    }

    public PersonBuilder Firstname(string firstname)
    {
        _person.Firstname = firstname;

        return this;
    }

    public PersonBuilder Lastname(string lastname)
    {
        _person.Lastname = lastname;

        return this;
    }

    public PersonBuilder AddChild(Action<PersonBuilder> builder)
    {
        var personBuilder = new PersonBuilder();
        builder(personBuilder);

        _person.Children.Add(personBuilder.Build())

        return this;
    }

    public Person Build()
    {
        return _person;
    }
}

var person = new PersonBuilder()
                        .Firstname("John")
                        .Lastname("Doe")
                        .AddChild(child => {
                               child.Firstname("Jane")
                                    .Lastname("Doe")
                        })
                        .Build();
```
Updating data models - Building SaaS #5
Tags: python, django, saas
Published: 2019-09-10 18:25:59

{% youtube tQQ9TyJoj4o %}

In this stream episode, we took some new data from a new Django database model, and I showed how to add that data to different templates.

Along the way, we wrote automated tests and generated a database migration.

Show notes for this stream are at [Episode 5 Show Notes](https://www.mattlayman.com/building-saas/updating-data-models/).

To learn more about the stream, please check out [Building SaaS with Python and Django](https://www.mattlayman.com/building-saas/).
The search for markdown tool chains for multiple end user documentation outputs 
Tags: markdown, documentation, android, rst
Published: 2019-09-10 18:20:07

---
title: The search for markdown tool chains for multiple end user documentation outputs 
published: true
description: 
tags: markdown, documentation, android, rst
---

Any recommendations for tools to generate & maintain the following documentation styles from a single code repository:

1. Android application help 
2. Internal employee web based documentation 
3. External web based public facing end-user documentation
Does their jargon make you feel dumb? Maybe they are confused themselves.
Tags: discuss, webdev, tech
Published: 2019-09-10 18:10:13

---
title: Does their jargon make you feel dumb? Maybe they are confused themselves.
published: true
description: When someone speaks high level jargon, it can make you feel a little dumb. But sometimes they are just as confused as you are.
tags: discuss, webdev, tech
---

I'm sure we've all met those people who when they start talking, their tech jargon makes our eyes glaze over, our brains melt...

**what?!** What does that even mean? Am I confused? Dumb? Did I not learn this? What are they saying? **DOES NOT COMPUTE!**

If you find yourself in a conversation and the person starts saying things that confuse you, do yourself a favor and DO NOT assume it's your lack of intelligence. 

I only recently learned this in the last few years, that a lot of people will sound technical but if you dig deeper they are just as confused as you about the topic and they are just rambling. 

There is no reason you can't ask them to clarify. Don't get embarrassed that you feel like they were speaking another language.

"Could you please clarify what you are talking about" or "can we break this down piece by piece?"

Ask for a code example, or white board visit. Have them slow down and try again. Get an understanding for each part before moving on to the next.

I used to just assume I wasn't as smart as the person telling me the information, but now I know 99% of the time they are just failing to communicate, typically because they are struggling themselves.

Since I've found this out, I now know that I'm just as smart as everyone else in the room. I'm able to get every single person, to communicate on a level that gets their message across.

I hope this helps!
Add dark mode to your site with this short CSS trick
Tags: css, javascript, webdev
Published: 2019-09-10 18:03:53

---
title: Add dark mode to your site with this short CSS trick
published: true
description: Add dark mode easier than before with one line of CSS
tags: css, javascript, webdev
series: Tips & Tricks
---

Most applications nowadays have dark mode: your command line, your IDE, your browser, etc. Why would your site be any different? Your website can also go dark when the visitor's browser has dark mode enabled. It's easier than you think. I'll show you how.

```css
@media (prefers-color-scheme: dark) {
  body {
    background-color: black;
    color: #ccc;
  }
}
```

Hello darkness, my old friend.

![Join the dark side](https://thepracticaldev.s3.amazonaws.com/i/1doxomndodgxphmnlytj.jpg)

This CSS snippet overrides styles for users' dark theme. The best thing is that this feature is already available in Chrome 76, Firefox 67, Safari 12.1, and Opera 62.

You can optionally check if the browser supports it using Javascript.

```javascript
if (window.matchMedia('(prefers-color-scheme)').media === 'not all') {
  console.log('Browser doesn\'t support dark mode');
}
```

I hope this short snippet helped to enhance your site's style.
Happy coding 🚀
Why are date and time so surprisingly difficult to work with?
Tags: datetime, development, general
Published: 2019-09-10 18:03:12

A lot of developers takes a naive approach towards working with DateTime, In this post I will try to warn you about potential pitfalls and things to keep in mind when working with datetime.

In your everyday life, when you think about the date or time, it’s very simple and intuitive – For instance – Today is September 9th 2019, and the time is now 11:57 A.M. 
So why is is so hard to write code that correctly use date and time?

Nowadays, a software designed only for a local group of users is rather scarce, so you probably already encountered or going to encounter at least a few of the issues I’m going to write about in this post.

There are several reasons for this difficulty, (almost) each one of them is enough to make it hard on it’s own, and combining all of them together makes it even harder. Here’s a (probably partial) list of them:

 * Culture-dependent calendars.
 * Culture-dependent string representations
 * Time zones
 * Daylight savings time
 * Historical calendar changes
 * Political issues

For a more detailed explanation, visit [the original post](https://zoharpeled.wordpress.com/2019/09/10/why-are-date-and-time-so-surprisingly-difficult-to-work-with/) over on my blog.
#Day2
Tags: beginners, javascript
Published: 2019-09-10 17:09:16

Skipped a day yesterday. 
<b>Today : </b>
I completed 1 challenge from my Java Script course. 
I'm currently making a Pig game using JS. 
In this challenge I had to change how the scores change when the use rolls two consecutive 6s. 
<b>edit : </b>
completed another challenge : 
Where I had to take input from a user and have it as the winning score for the Pig game.

If anyone is curious, the course I'm following is "The Complete JavaScript Course 2019: Build Real Projects!" on Udemy.

#Babystep
JSS Question
Tags: help, sitecore
Published: 2019-09-10 17:09:14

Quick Question
@Anastasiya With the new features concerning JSS with SXA we are having some discussions internally on which way to go.  The only thing for sure is we are not going the traditional Sitecore route of creating components.  So would you say JSS is as quick as SXA, slightly slower or the same as developing with traditional Sitecore.  The reason I ask is Marketing does not care about how, they simply want it done. 
Thanks Jeffrey
Automatically Logged in to webview using same react native app Credential
Tags: react, reactnative, discuss, javascript
Published: 2019-09-10 16:45:37

Hi Guys i am new to React Native.
i am trying to develop app for joomla website. Till Now i successfully implemented user Registration and login for Joomla. Now i would like To add sidebar menu that use webview to display the joomla webpage. But i need users automatically Logged in to webview of joomla page using same credential they use to login the main react native app without manually Type username and password again on webview of joomla page.
How i could implement this kinda Bridge. 
is any library already available for this ?
Any Hint or Tutorial Link Would be highly helpful for me 
Thanks :)
Run Javascript by Capybara feature test
Tags: capybara, rspec, rails
Published: 2019-09-10 16:40:49

---
title: Run Javascript by Capybara feature test
tags: capybara, rspec, rails
---

## 🔗 Parent Note
{% link https://dev.to/n350071/my-capybara-note-2gp3 %}


## 🤔 Situation
Let's say you have following iframe. And, you want to assert that a selector inside the iframe is not shown when the iframe height is too short.


```html
<div>
  <iframe src='https://n350071.com' id='n350071-frame'></iframe>
</div>
```


## 👍 Solution
Use **execute_script** method on Capybara. 

```ruby
# run a script
page.execute_script("$('#n350071-frame').height(10)")

# then, test it.
within('n350071-frame') do
  expect(find('div.body').not_to have_selector('div.target')
end
```

The syntax is this.
```ruby
execute_script(script, *args)
```

## 💚 one more tips: evaluate_script
If you need return value, please use evaluate_script. But, be careful, it might return complex jQuery object. So, you should use execute_script by default.

```ruby
evaluate_script(script, *args)
```

注意: jQueryの複雑な戻り値が帰ってくる場合には、戻り値のないexecute_scriptがよい。


## 📚 Reference
- [execute_script](https://rubydoc.info/search/github/jnicklas/capybara/master?q=execute_script)
- [evaluate_script](https://rubydoc.info/search/github/jnicklas/capybara/master?q=evaluate_script)
نکاتی برای سفر با هواپیما

Published: 2019-09-10 16:36:48


<a href="https://tarikhema.org/travel/41457/%d9%86%da%a9%d8%a7%d8%aa-%d8%b3%d9%81%d8%b1-%d8%a8%d8%a7-%d9%87%d9%88%d8%a7%d9%be%db%8c%d9%85%d8%a7/"> نکاتی برای سفر با هواپیما </a>
How to quickly check cookies for compliance with GDPR 🍪
Tags: webdev, beginners, tutorial, gdpr
Published: 2019-09-10 16:21:27

After setting up my small blog I already had a base solution to make cookies GDPR compliant, but it was a quite expensive for me.
I was not that happy, so I decided to explore GDPR requirements.

In general, if your website is visited by EU consumers, you must comply with the GDPR even when you don't collect any personal data.
Since site visitors can be tracked by third parties through cookies, you should always keep an eye on the cookies that are set when your site loads.

##GDPR compliant cookies 🥮##
You comply with the GDPR if you set cookies after obtaining prior consent. The consent banner should block cookies until the user clicks the allow button.

You also comply with the GDPR if you do not set any cookies at all or set strictly necessary cookies without prior consent obtaining.
The European Commission [gives](https://ec.europa.eu/ipg/basics/legal/cookies/index_en.htm) examples of such strictly necessary cookies:
- user input cookies, for the duration of a session
- authentication cookies, for the duration of a session
- user centric security cookies, used to detect authentication abuses and linked to the functionality explicitly requested by the user, for a limited persistent duration
- multimedia content player session cookies, for the duration of a session
- load balancing session cookies, for the duration of session
- user interface customisation cookies, for a browser session or a few hours

##What about Google Analytics##
Any statistical, advertising or similar cookies aren't strictly necessary and cannot be set without prior consent obtaining.
If you use Google Analytics, Google Adsense or DoubleClick you should to get user's consent. By the way, Google [warns](https://www.google.com/about/company/user-consent-policy/) about this.

##How to quickly check your cookies##
To check website cookies for GDPR compliance you can use [2GDPR](https://2gdpr.com)
It takes about a minute to scan.
If violations are found, it will take longer to analyze the results.
Are you satisfied with the accessibility on the web?
Tags: discuss, a11y, webdev
Published: 2019-09-10 16:21:07

---
title: Are you satisfied with the accessibility on the web?
published: true
description: Are you satisfied with the accessibility on the web? My question is primarily for people who rely heavily on accessibility features, but also to anyone else who wants to share any experience or advice on working on significant accessibility improvements.
tags: discuss, a11y, webdev
cover_image: https://thepracticaldev.s3.amazonaws.com/i/cb35re05eqwvriwzvnfs.png
---

During my career, I was rarely asked to implement accessibility improvements, and even when I did, it was just to add a missing `alt` or add aria labels. I never had a chance to work on an accessibility feature in order to really change and improve the UX for people with disabilities.

So my question is primarily for people who rely heavily on accessibility features, but also to anyone else who wants to share any experience or advice on working on significant accessibility improvements.

The full question is:

**Are you satisfied with the current state of accessibility on the web and what can we do to make your browsing experience easier?**

and

**How to approach the planning and implementation of accessibility features of a website or a web app?**
Help us make Frontity better!
Tags: help, wordpress, react
Published: 2019-09-10 15:49:47

---
title: Help us make Frontity better!
published: true
tags: help, wordpress, react,
---

Hi there!

At [Frontity](https://frontity.org/?utm_source=dev.to&utm_medium=feedback-post&utm_campaign=user-research) we're continuously running **feedback sessions** to improve our framework and would love to hear any input that you have!

Right now, we're looking for WordPress and/or React developers to interview so we can understand how they usually work and what challenges they find. All the feedback is really valuable and will help us design new features and documentation.

If you'd like to help us make Frontity better, [sign up here](https://calendly.com/mario-frontity/15min) for a short chat/feedback session.

If you don't find any suitable date, feel free to reach out to us. Thanks a lot for your help! 🙏

_Frontity is a free and open source framework for building headless WordPress sites using React. You can read our [introductory post](https://dev.to/frontity/frontity-a-react-framework-to-create-wordpress-themes-f9e) or find more about the project on [Github](https://github.com/frontity/frontity)._
what should i do now?
Tags: question, javascript, practicing
Published: 2019-09-10 16:18:17

hello to everyone I'm learning front-end development (then gonna move to back) and I've faced some problems too, I really don't know what should i do now, I've learned about css and html and now I'm working (practicing) with js but like i said i don't know what to do now how should i practice i mean what to build ...
can anyone give some practice ideas
stop/pause headless Selenium testing with Capybara
Tags: capybara, rspec, rails
Published: 2019-09-10 16:16:11

---
title: stop/pause headless Selenium testing with Capybara
tags: capybara, rspec, rails
---

## 🔗 Parent Note
{% link https://dev.to/n350071/my-capybara-note-2gp3 %}

## 🤔 Situation
When you want to debug with real display.  
The setting is like this.


```ruby
#spec/rails_helper.rb
Capybara.register_driver :headless_chrome do |app|
  Capybara::Selenium::Driver.new(
    app,
    browser: :chrome,
    options: browser_options,
    http_client: Selenium::WebDriver::Remote::Http::Default.new
  )
end
browser_options = ::Selenium::WebDriver::Chrome::Options.new.tap do |opts|
  opts.args << '--headless'
end
```

## 👍 Solution
Comment out `opts.args << '--headless'` line.

```ruby
#spec/rails_helper.rb
Capybara.register_driver :headless_chrome do |app|
  Capybara::Selenium::Driver.new(
    app,
    browser: :chrome,
    options: browser_options,
    http_client: Selenium::WebDriver::Remote::Http::Default.new
  )
end
browser_options = ::Selenium::WebDriver::Chrome::Options.new.tap do |opts|
#  opts.args << '--headless'
end
```

## 📚 Reference
- [RailsにCapybara + Seleniumを導入してChrome Headlessモードで実行する手順 - Qiita](https://qiita.com/zo3_0005/items/a5dcede868a3d1cca4a8)
Hi, I'm Khai Nguyen
Tags: introductions
Published: 2019-09-10 16:12:00

---
title: Hi, I'm Khai Nguyen
published: true
description: My introduction post
tags: introductions
---

I have been coding for 4+ years.

You can find me on GitHub as [khaister](https://github.com/khaister).

I live in the beautiful city of Irvine in sunny California.

I mostly program in these languages: C#, TypeScript, and JavaScript.

I am currently learning more about JavaScript.

Nice to meet you.
About Skip Drish
Tags: skipdrish, skipdrishtampa, skipdrishusmarshal
Published: 2019-09-10 14:19:07

Skip Drish has provided Law Enforcement Services in Government, State and Local arenas as well as Medical Services, Security, and Investigations ranging from VIP Chief Operator / BLS First Responder Instructor as well as Consulting and Training for Law Enforcement and Medical Programs both domestically and internationally. Mr. Drish has 30 years of combined experience in Military, Law Enforcement, Emergency Response First Responder and Firearm Instruction.  Skip Drish has provided continued training & mentoring throughout the world ranging from Dignitary Operator Training, Military Police / Investigations (CID) (Europe), Emergency Response Unit (ERU) Border Patrol (Czechoslovakia), Low / High Voltage Certification for Surveillance / Counter Surveillance Measures, International Association of Law Enforcement Firearms Instructors (IALEFI), International Law Enforcement Educators and Trainers Association (ILEETA). Skip Drish successfully provided consultation and training services for Government, State and Local Agency’s in Law Enforcement Training, Firearms, Less Lethal, BLS Trainer CPR – AED – First Aid, Search & Rescue – Airboat, ATV, Motor and Equestrian Operation. Skip Drish is also a consultant for Range Operation for Firearm Manufactures and Advanced Driving Techniques (VIP Services), Gang & Terrorism Task Force Officer and Homeland Security Advisor in the U.S and abroad.

Skip Drish has provided Safe Vessel Operations for over 20 years as well as Chief of Operations for / BLS First Responder Instructor and overseen the training department for all Marina and boat services. Mr. Drish has 20 years of combined experience in the Military, FEMA, Emergency Response First Responder and Firearm Instruction on the water (Maritime Piracy Prevention). Skip Drish has provided continued training & mentoring throughout the world ranging from Dignitary Operator Training, VIP Safety Operations, Emergency Response Unit (ERU) Low / High Voltage Electrical Certification, Dive Certifications, Firearms Instructors (IALEFI), International Law Enforcement Educators and Trainers Association (ILEETA). Skip Drish has successfully provided consultation and training services for Government, State and Local Agency’s in Firearms, Less Lethal, BLS Trainer CPR – AED – First Aid, Search & Rescue – Airboat, ATV, Motor and Equestrian Operation.

Mr. Drish also has more than 30 years of experience in the construction industry. Skip Drish possesses an impressive portfolio of construction training & knowledge. Mr. Drish has orchestrated the successful growth and expansion of his entities through years of strategic planning, controlled investments and market forecasting. He now leads a national workforce and continues to investigate further expansion opportunities. Skip Drish’s tremendous success in the electrical and construction fields has served as the catalyst for attaining an ownership position in companies performing those services.
Other reasons which makes me happy with Cloudflare
Tags: webhosting, cloudflare
Published: 2019-09-11 14:10:27

---
title: Other reasons which makes me happy with Cloudflare
published: true
tags: Web Hosting,cloudflare
canonical_url: https://kevinhq.com/other-reasons-which-makes-me-happy-with-cloudflare/
---

It’s been some months since I put the Cloudflare in front of this blog. The results make me happy. Not only it puts a security layer by filtering the traffic that hits this blog, but it also gives me others. Firewall A firewall makes the job easier to block some countries or IP address. All I have to do… [Continue reading »Other reasons which makes me happy with Cloudflare](https://kevinhq.com/other-reasons-which-makes-me-happy-with-cloudflare/) ![](http://feeds.feedburner.com/~r/kevinhq/~4/3Ht-qb2P52o)