teleren/devto huggingface dataset:
Daily Developer Jokes - Monday, Feb 8, 2021
Tags: jokes, dailydeveloperjokes
Published: 2021-02-08 13:00:11

---
title: "Daily Developer Jokes - Monday, Feb 8, 2021"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
cover_image: "https://private.xtrp.io/projects/DailyDeveloperJokes/thumbnail_generator/?date=Monday%2C%20Feb%208%2C%202021"
published: true
tags: #jokes, #dailydeveloperjokes
---

Generated by Daily Developer Jokes, a project by [Fred Adams](https://xtrp.io/) ([@xtrp](https://dev.to/xtrp) on DEV)

___Read about Daily Developer Jokes on [this blog post](https://xtrp.io/blog/2020/01/12/daily-jokes-bot-release/), and check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/).___
### Today's Joke is...
![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e1258d16351b.png)

---
*Have a joke idea for a future post? Email ___[xtrp@xtrp.io](mailto:xtrp@xtrp.io)___ with your suggestions!*

*This joke comes from [Dad-Jokes GitHub Repo by Wes Bos](https://github.com/wesbos/dad-jokes) (thank you!), whose owner has given me permission to use this joke with credit.*

<!-- 
Joke text:
___Q:___ What do you get when you cross a computer and a life guard?

___A:___ A screensaver!
 -->
Use the Rails helper `highlight` when showing search results
Tags: ruby, rails, product, webdev
Published: 2021-02-10 01:19:57

---
title: Use the Rails helper `highlight` when showing search results
date: 2021-02-08 13:00:00 UTC
published: true
tags: ruby,rails,product,webdev
canonical_url: https://boringrails.com/tips/rails-highlight-search-results
---

Use the Rails `highlight` helper to wrap search result matches in `<mark>` tags.

![Rails highlight helper](https://boringrails.com/images/highlight.png)

Highlight the search term “comment” in a list of notifcations

## Usage

Pass the search term to your controller via params (e.g. `params[:search]`) and use that to filter down your results.

```ruby
# app/controllers/inbox_controller.rb
class InboxController < ApplicationController
  def index
    @notifications = Current.user.notifications.for_search(params[:search])
  end
end

# app/models/notification.rb
class Notification < ApplicationRecord
  belongs_to :recipient, class_name: "User"

  validates :message, presence: true

  def self.for_search(term)
    if term.present?
      # Implement searching however you'd like
      where("message ILIKE ?", "%#{term}%")
    else
      all
    end
  end
end
```

Render the notifications and use `TextHelper#highlight` on the message to emphasis the matching query.

```erb
<% @notifications.each do |notification| %>
  <%= link_to highlight(notification.message, params[:search]), notification %>
<% end %>
```

You can style the `<mark>` tag however you’d like.

```css
mark {
  background-color: yellow;
}
```

## Options

You can pass either a string, array, or a regex as the phrase to match. Matches are case-insensitive.

```ruby
highlight('Boring Rails is the best', 'rails')
# => Boring <mark>Rails</mark> is the best

highlight('Boring Rails is the best', /rails|best/)
# => Boring <mark>Rails</mark> is the <mark>best</mark>

highlight('Boring Rails is the best', ['is', 'best'])
# => Boring Rails <mark>is</mark> the <mark>best</mark>
```

If there are no matches or you leave the phrase blank, everything still works fine.

```ruby
highlight('Boring Rails is the best', 'JavaScript')
# => Boring Rails is the best

highlight('Boring Rails is the best', '') # nil works too
# => Boring Rails is the best
```

You can also override the HTML markup wrapped around the matches using the `highlighter` option. Use `\1` to reference the match. The output is sanitized by default

```ruby
highlight('Boring is best', 'best', highlight: '<b>\1</b>')
# => Boring is <b>best</b>

highlight('Boring is best', 'best', highlight: '<a href="tagged?q=\1">\1</a>')
# => Boring is <b>best</b>
```

If you need to run additional code, you can pass a block to render instead.

```ruby
highlight('Blog: Boring Rails', 'rails') do |match|
  link_to(match, public_share_path(term: match))
end
# => Blog: Boring <a href="/public/share?term=Rails">Rails</a>
```

## Additional Resources

Rails API Docs: [TextHelper#highlight](https://edgeapi.rubyonrails.org/classes/ActionView/Helpers/TextHelper.html#method-i-highlight)

* * *
[![](https://boringrails.com/images/twitter-banner.png)](https://twitter.com/_swanson)
IINA : The modern media player for macOS with Picture-in-Picture mode and Browser Extension
Tags: mac, tools, webdev, video
Published: 2021-02-08 12:13:43

## Picture-in-Picture

IINA supports the native Picture-in-Picture mode, enables you to enjoy either local or online videos without being distracted.

![Alt Text](https://iina.io/images/feature-2.png)


## Browser Extension

Powered by the open source media player mpv, IINA can play almost every media file you have. With the support of youtube-dl and our browser extensions, you can also play a variety of online streams in IINA via one click.

![Alt Text](https://lh3.googleusercontent.com/g9zjI1RYksLzUYtj3tv8OGJmChANWogoMoHKoUoCudFBpBSE8fxqDO56iX0fHipsTBk_2yqYXHfUc0EvmKoMdZ8pjRE=w640-h400-e365-rj-sc0x00ffffff)

## Dark Mode

IINA ships with a carefully crafted user interface for the macOS Mojave dark mode, which includes adjusted colors, icons and textures, providing a sleek and unified look.

![Alt Text](https://iina.io/images/feature-1.png)

## Link

[https://iina.io/](https://iina.io/)
Powershell + Alexa, iniciando o dia
Tags: powershell, tutorial, beginners, alexa
Published: 2021-02-08 12:12:26

A ideia desse script veio com uma automação que eu fiz em casa utilizando a Alexa (sim, eu usei Powershell junto com ela, preciso dar uma parada com Powershell? Provável), onde a ideia era pedir para ela abrir alguns programas. 

Sendo mais especifico, minha ideia era falar "Alexa, hora de trabalhar" e ela abrir todos os programas que eu utilizo normalmente, como o Edge e o Teams. 

Para fazer ela funcionar junto com o Powershell, eu usei de base um video, de um canal focado em conteúdos com Alexa: 

{% youtube FTxIabp8CRg %}

Basicamente, eu escrevo um script e passo o caminho dele de parâmetro para o Trigger, com isso, ao criar a rotina com a Alexa ela executa tudo que está no meu script.

Pode colocar o que fazer sentido para você, como por exemplo, criar uma rotina para abrir paginas Web, desligar o monitor, mandar um e-mail... um amigo chegou a fazer a Alexa executar pull requests.

Nesse exemplo vamos fazer algo bem simples, meu script inicial para abrir o navegador e o chat da empresa. No navegador, coloquei para abrir o Email corporativo, no caso o site do Outlook para empresas/estudantes.

No inicio, ele verifica se esses programas já estão abertos, ou seja, ele não vai tentar abrir eles se já estão abertos. Você pode criar um segundo script, e configurar um para encerrar os programas relacionados ao trabalho. 

No lado da rotina da Alexa, coloquei para ligar a luz, ler as noticias do dia e falar minha agenda.

{% gist https://gist.github.com/IGDEXE/e6a6524b6363575cc2c70df6ba233db5 %}

Um detalhe importante, é que esse processo de iniciar cada aplicativo vai ser algo um pouco mais chato, uma vez que precisa ver como pode fazer isso, para cada um dos que pretende utilizar. 

Mas no geral, tende a funcionar colocar o caminho do executável dele. Caso seja algo do sistema, provavelmente vai suportar mais parâmetros.
I built an interactive course that teaches you vim in the browser. 
Tags: productivity, tooling, showdev
Published: 2021-02-08 12:12:12

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

I recently launched an interactive course (https://www.vim.so) that helps you learn vim in the browser. 

## Why build this? 

I built vim.so because I was frustrated with how unapproachable it was to learn vim. The text-based tutorials didn't do a great job of helping me actually practice and get comfortable with vim. 

I wanted something to help with muscle memory and be an easier onboarding to vim for developers. 

This video shows what a lesson looks like 👇 

{% twitter 1351178904686514178 %}

## Why learn vim? 

If you're a productivity nerd (🖐) you'll probably like vim. Once you get past the learning curve, it feels like super-powered CMD+C, CMD+ V. 

You can do things like "select all text within brackets" or "replace all text within quotes" or "go to first occurrence of this letter in this line". 

With practice, it feels easier to stay in the flow while editing code. 

The great thing about it nowadays is that you can use vim within most IDE's and code editors. 

## Vim in VS Code 

I use vim inside of vs code as my main development flow. I'd been using vs code for years and didn't want to switch off of it. I think it's a powerful combination and allows you to start adding vim commands little by little while you're learning. 

The vim extension I use is called vscodevim https://marketplace.visualstudio.com/items?itemName=vscodevim.vim
Salesforce Admin Learning - Part 3
Published: 2021-02-08 12:11:03


## Data Security
Salesforce Data security deals with the security or sharing settings of data and visibility between users or groups of users across the organization.

Four level of security
**a) Organization Level** - The access to the organization is secured  by maintaining a list of authorized users, setting password policies, and limiting login access to certain hours and certain locations.

**b) Object Level** - Object-level security provides the simplest way to control which users have access to which data.By setting permissions on a particular type of object, you can prevent a group of users from creating, viewing, editing, or deleting any records of that object.

**c) Field Level** - lets user access to certain fields in an object

**d) Record level** - lets user to access only few records

## Access to organization

We can restrict access to org level by the following ways
1) Allow only authorized user to access Salesforce
2) Setting Password Policies
3) Restricting IP ranges for Users
4) Restricting Login Hours for user

## Object Level Security

Object level security provides a way to control data access. It prevents a user or group of user from creating, viewing, editing and deleting any record of an object  by setting permissions on that object.

Two ways of setting object permission
####1) Profiles
It is a collection of settings and permission that tells which data and feature in the platform users have access to.
* Settings tells what user can see like tabs, fields or recordTypes
* Permission tells that what user can do like create, edit etc.

####2) Permission sets
A Permission set is just a way to give a user or a set of users extended permissions without granting them to the entire group of users with a certain Profile.

Example - 
Profile is like a Key to House
Permission sets are like keys to individual Rooms.

So if this profile is assigned to user means he can enter in to house but can’t enter in to the rooms
Until and unless permission sets are assigned to user he cant enter in to the rooms

**Note** user can have only one profile and can have multiple permission sets at a time.

####3) Field Level Security
Field level security in salesforce controls whether a user can see, edit or delete the value for a particular field on an object

####4) Record Level Security
Record Level Security in Salesforce determines which individual records users can view and edit in each object they have access to in their profile.
* permission on a record is always evaluated according to a combination of object, field, and record-level security permission.
Toggle Natural Scroll in MacOS
Tags: tutorial, todayilearned, todayisearched, productivity
Published: 2021-02-08 12:08:46

🖱 If you are one of those people who are irritated by the repetitive process of toggling the natural scroll of MacOs while switching between trackpad and mouse, this is going to help you. 👨‍💻👩‍💻

📜 Open Apple Script and paste the script below.

```
try
	tell application "System Preferences"
		activate
		set current pane to pane "com.apple.preference.trackpad"
	end tell
	delay 2
	tell application "System Events"
		tell process "System Preferences"
			click radio button "Scroll & Zoom" of tab group 1 of window "Trackpad"
			click checkbox 1 of tab group 1 of window "Trackpad"
			tell application "System Preferences" to quit
		end tell
	end tell
end try
```

Save this script as an application and move it to Dock down there. Now each time you connect a mouse, just click the script application you moved on the dock.

🔗 If you face trouble or need more help, you can refer the place where I found this: [https://apple.stackexchange.com/questions/153243/changing-trackpad-scroll-direction-with-applescript-in-yosemite](https://apple.stackexchange.com/questions/153243/changing-trackpad-scroll-direction-with-applescript-in-yosemite)

Happy working! 🥂
[Video] Bash Scripting Crash Course + Giveaway ⭐
Tags: linux, bash, codenewbie
Published: 2021-02-08 12:01:55

# Introduction

Hello everybody! Welcome to this Introduction to bash scripting video series, where you will learn the basics of bash scripting and start creating some awesome scripts! 

My name is Bobby and I've been working as a Linux system administrator for the past 7 years and a few months ago I wrote an opensource ebook on how to get started with Bash scripting, for more information on how to download the book for free check out the video description.

In this video series, we are going to spin up a Linux server on DigitalOcean and create our scripts on there. If you are new to this channel make sure to hit the subscribe button and I will see you in the next video!

{% youtube ur9lAPcbMhs %}

# Playlist

[Introduction to Bash Scripting Crash course playlist](https://www.youtube.com/playlist?list=PLY7SzAmnEqp78tsHh1kK0gOx_f-uwQZAT)

# Giveaway

I've got those awesome stickers here:

![Free stickers](https://dev-to-uploads.s3.amazonaws.com/i/jcd2ao7925c258inutip.jpg)

One way to support me is by clicking the subscribe button! I will send out a sticker to everyone who does so! 🙏

# Conclusion

This is the first video course that I ever created! Any feedback will be appreciated 🙌

Useful links:

* [The Introduction to Bash Scripting Opensource eBook](https://github.com/bobbyiliev/introduction-to-bash-scripting)

* [Free $100 Credit For DigitalOcean](https://m.do.co/c/2a9bba940f39​)

* [Website with interactive training](https://ebook.bobby.sh​)
This 9 Coolest CLI Tools that i found this week
Tags: webdev, productivity, tools, mac
Published: 2021-02-08 11:59:02

## fzf

It's an interactive Unix filter for command-line that can be used with any list; files, command history, processes, hostnames, bookmarks, git commit

![Alt Text](https://cdn-media-1.freecodecamp.org/images/YrD36K2ENGCVEPlslYvMzSwTG1xTsZRiIlHS)

Link : [https://github.com/junegunn/fzf](https://github.com/junegunn/fzf)

Replace : *find*

## ripgrep

![Alt Text](https://www.santoshsrinivas.com/content/images/2017/09/demo-ripgrep.gif)

Link : [https://github.com/BurntSushi/ripgrep](https://github.com/BurntSushi/ripgrep)

Replace : *grep*

## bat

bat supports syntax highlighting for a large number of programming and markup languages.

![Alt Text](https://user-images.githubusercontent.com/101152/48487457-94eca600-e81e-11e8-87b6-a164f591c347.gif)

Link : [https://github.com/sharkdp/bat](https://github.com/sharkdp/bat)

Replace : *cat*

## exa

exa is an improved file lister with more features and better defaults. It uses colours to distinguish file types and metadata. It knows about symlinks, extended attributes, and Git. And it’s small, fast, and just one single binary.

![Alt Text](https://cdn.ourcodeworld.com/public-media/articles/articleocw-5c1ab36413020.jpg)

Link : [https://the.exa.website/](https://the.exa.website/)

Replace : *ls*

## watch

Execute a program periodically, showing output fullscreen

![Alt Text](https://www.2daygeek.com/wp-content/uploads/2017/03/watch-command-example-3.gif)

Link : [https://gitlab.com/procps-ng/procps](https://gitlab.com/procps-ng/procps)

## jq

jq is a lightweight and flexible command-line JSON processor.

![Alt Text](https://raw.githubusercontent.com/rike422/kirinuki-cli/master/assets/sample.gif)

Link : [https://github.com/stedolan/jq](https://github.com/stedolan/jq)

## peco

peco can be a great tool to filter stuff like logs, process stats, find files, because unlike grep, you can type as you think and look through the current results.

![Alt Text](https://camo.githubusercontent.com/00ac9dd8fa29725a926bc8eef15f0108ecd5c9f3b355e2a921df4deaa4b16628/687474703a2f2f7065636f2e6769746875622e696f2f696d616765732f7065636f2d64656d6f2d72616e67652d6d6f64652e676966)

Link : [https://github.com/peco/peco](https://github.com/peco/peco)

## pomo

pomo is a simple CLI for using the Pomodoro Technique. There are some amazing task management systems but pomo is more of a task execution or timeboxing system. pomo helps you track what you did, how long it took you to do it, and how much effort you expect it to take.

![Alt Text](https://raw.githubusercontent.com/kevinschoon/pomo/master/www/static/demo.gif)

Link : [https://kevinschoon.github.io/pomo/](https://kevinschoon.github.io/pomo/)

## httpie 

HTTP is a user-friendly command-line HTTP client for the API era. It comes with JSON support, syntax highlighting, persistent sessions, wget-like downloads, plugins, and more.

![Alt Text](https://httpie.io/static/img/httpie.gif?v=70bc5a5b7fdf2b4982ed18b364c32b11)

Link : [https://github.com/httpie/httpie](https://github.com/httpie/httpie)

Replace: *curl*
Laravel and Vue.js: The Best Combination for a Perfect Web Application
Tags: laravel, vue, javascript, webdev
Published: 2021-02-08 11:44:31

Today, smart and tech-savvy customers tend to browse and shop online through a website or a dedicated mobile app. In such a scenario, businesses need to come up with user-friendly, feature-rich websites and web applications. Thanks to advancing technology, we have several frameworks and technology stacks available to build customized web applications. We usually suggest the combination of Laravel with Vue.js for building robust web apps.

In this post, we will dig deep into the major advantages of Laravel and Vue.js combination from the perspective of a Vue.js and Laravel development company. But, before moving forward, let’s have a brief introduction of both these frameworks.

Laravel- Leveraging the Advantages of PHP

Since its release in the year 2011, Laravel has successfully grabbed the attention of thousands of developers worldwide. As the most popular PHP framework, Laravel has got over 61000 stars on Github from its developers. Laravel has gained ground globally for its security, sessions, caching, and authentication aspects. This open-source PHP framework follows Model-View-Controller Architecture.

Vue.js- Popular Frontend Web Development Framework

There is no exaggeration in mentioning that Vue.js is the most loved front-end framework for building customized web interfaces and even one-page applications. This JavaScript-based framework was released in 2014 with the best part of the Angularjs platform. Vue.js has already got the top position in GitHub while leaving React.js and Angularjs behind. This framework is ideal for developing custom web interfaces.

Top Benefits of Laravel, Vue-based Web Applications for Your Business

Reactive Apps

Vue.js is known for developing the best-in-class event-driven apps, which enable developers to handle all the activities on the front-end. Vue.js has Composable Components that make the framework a perfect fit for the Laravel framework. Developers can utilize this combination for developing unique and seamlessly-performing web apps. When we combine Vue.js with Laravel, only a few steps are necessary to request data from the existing Laravel app.

Read More: https://www.suriainternational.com/laravel-and-vue-js-the-best-combination-for-a-perfect-web-application/
Techcord Provides Best Civil and Mechanical  Engineer Jobs in Australia

Tags: civilengineering, mechanicalengineer, jobsinautralia, engineeringjobs
Published: 2021-02-08 11:35:08

Techcord provides the Best Engineering jobs in Australia and is a major technology, engineering, construction, manufacturing and financial service conglomerate with global operations. They provide ample of job opportunities in various disciplines, especially in the field of Mechanical and Civil Engineering.

 Visit Here >> https://techcord.com/
Improving interfaces
Tags: watercooler, webdev, opensource, privacy
Published: 2021-02-08 11:30:28

We develop a fair and lightweight web analytics software called [Offen](https://www.offen.dev/?utm_source=forum) that treats operators and users as equal parties. Here is a glance at what has been happening over the last six weeks.

**Offen is now also available in English and German.** 

Our consent banner and the Auditorium for operators and users are available in the respective language. A further locale, Indonesian, is in the works at the moment. If you would like to support our fair approach to web analytics by contributing French, Spanish or other language versions, please do not hesitate to request an invite.

**Custom time intervals**

To further develop Offen into a fully competitive analytics tool, we still have some essential UX improvements on our to-do list. In the last few weeks, we have been implementing just one of them. Using the new feature, you can now easily display customised intervals of existing data. In addition, we have revised the choice of default time periods. As always, we welcome feedback on usability.

**Experimental JS API**

For those who would like a little more precision in exercising user consent, here's some good news. Offen captures a consent decision from the user automatically and gathers pageviews if consent is granted. Now, for finer control, you can instead use the JavaScript API provided by the Offen script and trigger a pageview event all by yourself. [Read more about this in our docs.](https://docs.offen.dev/running-offen/embedding-the-script/#triggering-pageviews-using-the-javascript-api/?utm_source=forum)
Salesforce Admin Learning - Part 2
Tags: salesforce, admin, developer, beginners
Published: 2021-02-08 11:21:43

## Master-Detail Relationship

1) It creates the parent(master) child(Detail) relationship between objects.
2) If we delete master records then detail (Child) records are deleted.
3) Rollup-summary field can be created in a master-detail relationship.
4) We can have maximum 2 master details on an object
5) Master is required field on the child object.

## Look up Relationship :
1) Look up relationship creates relations between two objects.
2) If we delete any object then another object not get's deleted.
3) We can have maximum 25 lookups on an object.
4) Parent is not required in the child record.
5) Rollup-summary field can't be created in this relationship.

**Note** You can convert a master-detail relationship to a lookup relationship as long as no roll-up summary fields exist on the master object.

**Note** You can convert a lookup relationship to a master-detail relationship, but only if the lookup field in all records contains a value.

##Roll up summary
A roll-up summary field calculates values from related records.
We can create a roll-up summary field to display a value in a master record based on the values of fields in a detail record.

Roll-up summary field has the following functions:

* Count() - Count displays the record count. It calculates the number of child records in the master-detail relationship.
* Min() - Min calculates the least values for a specified field on the child records. Number, currency, percent, date and date/time the fields are available for Min calculations.
* Max() - Max calculates the highest values for a specified field on the child records. Number, currency, percent, date and date/time the fields are available for Max calculations.
* Sum() - Sum Calculates the sum of the values of a specified field on child record. Number, currency and the percent fields are available for sum calculations.