teleren/devto huggingface dataset:
6 Reasons Why Candidates DON'T Negotiate (video)
Tags: salary, tips, career, advice
Published: 2020-01-08 19:49:49

If you've never negotiated a job offer before, you're not alone: most candidates don't negotiate. 

It's not because people don't want to. We've all heard stories from colleagues or read articles on the internet in which people say "It's okay to negotiate! It works! You should be negotiating!"

We know it's a good idea, but we still aren't doing it. 

I want to start this series by looking at the six main obstacles that hold candidates back from negotiating. By the end of this video, I hope you'll be pumped up to not let those obstacles stop you from negotiating future job offers.

---

Brought to you by Adam Dangoor and Lusen Mendel, the team behind candidates who kick butt. 

POST NOTES
☆ Lusen's middle management comics and zines http://formillennialmanagers.com/

HAVE A CANDIDATE QUESTION YOU WANT US TO ANSWER?
☆ candidateplanet@gmail.com

OTHER WAYS TO CONSUME THIS CONTENT:
☆ Youtube ☆ https://www.youtube.com/channel/UCdvny6qs8e4VUJIG01puw2Q
☆ Newsletter ☆ https://www.dangoormendel.com/blog (sign up at top of blog)
☆ Podcast ☆ https://candidate-planet.simplecast.com
☆ Dev.to ☆ https://dev.to/candidateplanet

MORE ABOUT DANGOORMENDEL:
☆ DangoorMendel ☆ https://www.dangoormendel.com
☆ Speaking and Client Inquiries ☆ hello@dangoormendel.com
☆ Lusen on LinkedIn  https://www.linkedin.com/in/lus
☆ Lusen on Twitter ☆ https://twitter.com/staycalmcomic
☆ Adam on LinkedIn ☆ https://www.linkedin.com/in/adamdangoor
☆ Adam on Twitter ☆ https://twitter.com/adamdangoor
How to Handle Content Scraping with Pagination in Laravel
Tags: laravel, laravel58, laravel6, laravelcodesnippet
Published: 2020-01-10 19:46:25

---
title: How to Handle Content Scraping with Pagination in Laravel
published: true
date: 2020-01-08 19:28:35 UTC
tags: Laravel,Laravel 5.8,Laravel 6,Laravel Code Snippet
canonical_url: https://codebriefly.com/how-to-handle-content-scraping-with-pagination-in-laravel/
---

 ![How to Handle Content Scraping with pagination in Laravel](https://codebriefly.com/wp-content/uploads/2020/01/How-to-Handle-Content-Scraping-with-pagination-in-Laravel.jpg)

In this article, we will discuss “How to Handle Content Scraping with pagination in Laravel”. I will try to explain to you to Content Scraping with pagination data. Here’s, only the required changes are explained. So I recommend you to check our previous post “How to Handle Content Scraping in Laravel” for better understanding. Update […]

The post [How to Handle Content Scraping with Pagination in Laravel](https://codebriefly.com/how-to-handle-content-scraping-with-pagination-in-laravel/) appeared first on [Code Briefly](https://codebriefly.com).
Dark Mode Switch
Tags: codepen, css, javascript, html
Published: 2020-01-08 19:13:21

# Switch Toggle in Dark Mode

Switch toggle is quite troublesome when you just started in web design or web development. Because HTML element is not supported switch toggle like on/off stuff and you must style it alone using checkbox, i have create a codepen for switch toggle for Dark Mode and you can fork it and learn from it.

{% twitter 1214986098222321664 %}

I can't embed it because it using the codepen projects and dev.to didn't support it.

Thank's for your time to read these stuff. Hopefully i will share more knowledge that i know to you all.
Determine a File Type of io.Reader
Tags: go
Published: 2020-01-08 19:13:00

# Overview
It isn't easy to determine a file type of [io.Reader](https://golang.org/pkg/io/#Reader) since it doesn't have `Seek()` or `Peek()`. If we read some bytes from `io.Reader`, we can't revert them.  As for Gzip, I tried to use `gzip.NewReader` and determine if it is Gzip by checking an error, but `gzip.NewReader` reads 10 bytes and doesn't write them back. If you try another `NewReader` after `gzip.NewReader`, it should fail due to lack of 10 bytes.

I did not come up with a smart way, but I found it when reading the source code of [containers/image](https://github.com/containers/image). 

You can see the actual example [here](https://github.com/containers/skopeo/blob/8f24d281302cc6aaa7ba9301d4a87bfceb7141b6/vendor/github.com/containers/image/v5/pkg/compression/compression.go#L96).

# Detail
I will show you an example of Gzip. You can use the same way if you need to determine other file types.

```go
func isGzip(input io.Reader) (io.Reader, bool, error) {
    buf := [3]byte{}

    n, err := io.ReadAtLeast(input, buf[:], len(buf))
    if err != nil {
        return nil, false, err
    }

    isGzip := buf[0] == 0x1F && buf[1] == 0x8B && buf[2] == 0x8
    return io.MultiReader(bytes.NewReader(buf[:n]), input), isGzip, nil
}
```

First of all, it reads only 3 bytes from `io.Reader`. In the above example, it uses `io.ReadAtLeast`, but I feel we can use `io.ReadFull` as well.

Then, we check if it is Gzip with 3 bytes. Of course, you need another process if you want to determine other file types.

Finally, we combine `buf[:n]` and `input` by `io.MultiReader`. The new `io.Reader` generated by `io.MultiReader` reads 3 bytes from the first `bytes.NewReader` and the rest bytes from the second `io.Reader`. This is equivalent to the original io.reader.

I wrote an example using the above technique.
https://play.golang.org/p/VH19FHQnqdr

# Caution
If you want to use [io.Copy](https://golang.org/pkg/io/#Copy), this way doesn't seem good from the perspective of a performance since `io.MultiReader` doesn't have [WriteTo](https://golang.org/pkg/io/#WriterTo). `io.Copy` [prefers](https://golang.org/src/io/io.go?s=13615:13679#L379) `WriteTo` for a performance. In that case, you can use [bufio.Reader](https://golang.org/pkg/bufio/#NewReader)

# Summary
You can use `io.MultiReader` if you need to peek some bytes from `io.Reader`.
Community Hangout - 2020-01-11 - v4.0.1
Tags: hangout, community, hoa, phalcon4
Published: 2020-01-08 19:30:25

---
title: Community Hangout - 2020-01-11 - v4.0.1
published: true
date: 2020-01-08 19:00:31 UTC
tags: hangout,community,hoa,phalcon4
canonical_url: 
---

![](https://blog.phalcon.io/assets/files/hangout-20200111.png)

Community hangout and releasing 4.0.1 all wrapped in one!

Join us on Saturday the 11th of January 2020, at 12:00:00 EST (17:00:00 UTC), to talk about our progress, address concerns and find solutions to common problems as well as release our first minor version for v4: 4.0.1

We will hold this virtual meeting on a live event in YouTube. The URL for the hangout is:

[https://youtu.be/oRwVx4pwemI](https://youtu.be/oRwVx4pwemI)

Topics to discuss:

- Introduction, welcome to all attendees
- Thank you to the whole community and contributors
- Status update since last hangout
- v4.0.1
- Devtools - Sample applications (vokuro etc.)
- Q/A

Looking forward to hearing from all of you and seeing you during the hangout.

* * *

Chat - Q&A

- [Discord Chat](https://phalcon.io/discord)
- [Forum](https://phalcon.link/forum)

Support

- [OpenCollective - Support Us](https://phalcon.io/fund)
- [Store - Merchandise](https://phalcon.io/store)

Social Media

- [Telegram](https://phalcon.io/telegram)
- [Gab](https://phalcon.io/gab)
- [MeWe](https://phalcon.io/mewe)
- [Parler](https://phalcon.io/parler)
- [Reddit](https://phalcon.io/reddit)
- [Facebook](https://phalcon.io/fb)
- [Twitter](https://phalcon.io/t)

Videos

- [BitChute](https://phalcon.io/bitchute)
- [LBRY](https://phalcon.io/lbry)
- [YouTube](https://phalcon.io/youtube)

![](https://assets.phalcon.io/phalcon/images/emoji/heart.png) Phalcon Team
Is the JAMstack eco-friendly?
Tags: jamstack, jamuary
Published: 2020-01-08 18:45:18

Climate change is the defining issue of our time. With shifting weather patterns and rising sea levels, the need to go green is stronger than ever. The cloud, however magical, consumes very real resources. It’s heavy reliance on servers has made the tech industry one of the fastest growing contributors to carbon emissions. According to the EPA, data centers now account for 1.5% of all electricity consumption in the US alone and are expected to surpass the aviation industry in green house gas emissions in the coming years. Though the JAMstack shirks servers in favor of APIs, and encourages hosting sites statically via a CDN, the JAMstack approach still relies on the existence of a robust cloud infrastructure (read: servers) to work. Even so, the JAMstack architecture is centered around serving content from the edge, a practice which is significantly more energy efficient than serving content directly from the server. When a site is served from the edge, it is often fast because of its proximity to the visitor. This proximity of content to the end user means one less round trip to the server to fetch content and less energy wastage from having to navigate a request through to the origin server. Serving dynamic content like from a Wordpress site additionally demands added CPU time to render each page view before serving up the content. At scale, this distinguishing feature between the JAMstack and traditional monoliths becomes much more perceptible. Compared to their “dynamic” counterparts, static assets hosted on a CDN can be served to the end user easily and as needed without having to overprovision servers to handle load. 

Thankfully, many cloud infrastructure providers that JAMstack sites rely on (i.e. Google, AWS) have made commitments to significantly reduce carbon emissions through carbon offsetting schemes and switching to renewable energy. These pledges alongside the JAMstack’s (theoretically) small carbon footprint, mean that JAMstack sites are fairly eco friendly—at least when compared to their monolithic counterparts and as long as you’re frontloading your build process as much as possible. If you’d like to be a part of the discussion around eco-friendly initiatives of hosting providers like Netlify, be sure to check out the many threads on this in the Netlify [community](https://community.netlify.com/t/is-netlify-powered-by-renewable-energy/3951) [forum](https://community.netlify.com/t/is-jamstack-more-eco-friendly-than-other-traditional-stacks/5411). And if you’re feeling gutsy, test your site’s carbon footprint over on https://www.websitecarbon.com.
Throwing All Your Work Away in Git
Tags: git, cli
Published: 2020-01-08 18:43:09

---
title: Throwing All Your Work Away in Git
published: true
description: Undo every change, even things Git doesn't know about yet.
tags: git,cli
canonical_url: https://smallsharpsoftwaretools.com/tutorials/git-trashit/
---

Occasionally you'll find yourself in a situation where you've written some code, created some files, and done a whole bunch of work, only to realize that you don't need it, or don't want it anymore. Now you've got to clean up your working directory.

The `git checkout` command can get you part of the way there, as can `git reset`. But these won't handle any new objects you've created. So rather than manually cleaning things up, take advantage of some additional options Git provides.


These two commands will reset your repository and clean up all of the things you haven't checked in yet:

```bash
$ git reset --hard HEAD
$ git clean -f -d
```

The first command reverts all of your changes to the code. You're probably familiar with that.  The second command removes any new files and directories you've created.


Give it a try. Create a new repository:

```bash
$ mkdir -p testing && cd !$
$ git init
```

Add some code:

```bash
$ echo "this is a file" > README.md
$ git add README.md
$ git commit -m "initial import of readme"
```

Now add a new directory and a file:

```bash
$ mkdir lib
$ echo "this is another file" > lib/file.txt
```

Then make a change to the `README.md` file:

```bash
echo "This is a second line" >> README.md
```

Use `git status` to see the state of your repository:

```bash
$ git status
On branch master
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
	modified:   README.md

Untracked files:
  (use "git add <file>..." to include in what will be committed)
	lib/

no changes added to commit (use "git add" and/or "git commit -a")
```

So from this output you see there's a change to the `README.md` file and a new `lib` folder Git doesn't know about.

To throw all this away, execute the `git reset` and `git clean` commands. Run them sequentially with `&&` which runs the `clean` command if the `reset` command succeeds:

```bash
$ git reset --hard HEAD && git clean -f -d
```

You'll see this message, letting you know it worked:

```
HEAD is now at 2949ebf initial import of readme
Removing lib/
```

The `lib` directory and its contents are gone, as is your change to the `README.md` file.



Since the command to clean things up is a lot of typing, open your `~/.gitconfig` file and add an alias for it:

```
[alias]
trashit = !git reset --hard HEAD && git clean -f -d
```

With the alias in place, you can run `git trashit` to clean things up.


This cleanup approach is handy if you've used CLI tools to generate new files in your project and you made a mistake, or for other situations where you just want everything put back the way it was.
The story of a Compound Timer
Tags: react, opensource, javascript, webdev
Published: 2020-01-08 17:42:09

## Prologue:
The open-source community is quite huge. Usually, for the most common problems, you’d always find a solution. But sometimes, the same solution may or may not fit your use-case.
So, what do we do then? Either, we spend time trying to tweak it or we discard it and prefer to write our version of the same.
Thus, a library was born with a simple focus in mind:- __Extensibility.__

## Chapter 1 (The Situation):
If you are working with Javascript, you’d find plenty of packages solving a problem in their unique way and sometimes, the solution you trust isn’t the solution you want.
Now, let’s say, we want to implement a timer in React.
How do we do it?
1. Write an implementation ourselves
2. Install a package that does the same.

## Chapter 2 (The pain):
While developing, one always trusts their code. But what if, the same implementation is the one you despise?
Why? Because it could be either:
1. Unoptimized
2. Lacking proper abstraction
3. Lacking extensibility
4. Containing duplicate code

So, we try the second approach we mentioned before. The journey isn’t any smoother.
Why? As the package, could either:
1. Lack extensibility
2. Be poorly documented
3. Contain extra bloat that we can’t get rid of
4. Not function as intended

## Chapter 3 (The solution):
Searching about timers in React, we are greeted with a plethora of packages but most of it coming with its own set of UIs and UXs (at the time of implementation).
Hence, a need was born for a component that could return the computed value without having any design attached to it.

Presenting [React-Timer](https://www.npmjs.com/package/@xendora/react-timer)

This package is designed to return the computed value in units. Not hours, minutes, seconds or milliseconds, just plain units. Why? Due to the fact, that it abstracts the implementation of the timer back to the user itself.

How? Here’s an example:

The package saves one the hassle by setting up the basic interval properties to execute a timer and sends back the final value, which then can be used/manipulated/designed as per requirement.

You can try it out here:

```
yarn add @xendora/react-timer (YARN)
npm install @xendora/react-timer (NPM)
```
or check out more [examples](https://xendora.github.io/react-timer/examples) :)

PS:: This package is platform-agnostic, so it’ll work in __React Native__ as well! :P
Minimum Configuration for log4j
Tags: log4j, java
Published: 2020-01-08 17:37:31

> No appenders could be found for logger(log4j)

You may have encountered this issue with many applications (hibernate, spring, etc.) when trying to run a Java program from command line.
The error appears in console something like this:

```java
log4j:ERROR Could not find value for key log4j.appender.CONSOLE
log4j:ERROR Could not instantiate appender named "CONSOLE".

log4j:WARN No appenders could be found for logger (com.company.module.ClassName).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
```

As the warning says itself: `Please initialize the log4j system properly`, you must check when running the program did the `log4j.properties` or `log4j.xml` is available on the *classpath* or either one of them do really exists?

####A minimum configuration would be
##### log4j.properties
```properties
# Set root logger level to DEBUG and its only appender to CONSOLE.
log4j.rootLogger=DEBUG, CONSOLE

# CONSOLE appender is set to be a ConsoleAppender.
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender

# CONSOLE appender uses PatternLayout.
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
```
##### log4j.xml
```xml
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration debug="true" xmlns:log4j='http://jakarta.apache.org/log4j/'>
 
  <appender name="console" class="org.apache.log4j.ConsoleAppender">
    <param name="Target" value="System.out"/>
    <layout class="org.apache.log4j.PatternLayout">
    <param name="ConversionPattern" value="%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n" />
    </layout>
  </appender>

  <root>
    <priority value ="debug"></priority>
    <appender-ref ref="console"></appender>
  </root>
</log4j:configuration>
```

You can name anything for the appender name which I had chosen `CONSOLE`/`console` as this is more relevant if you want to see the logs in console rather than appended in some file. 


## Application specific log configuration

```properties
log4j.logger.domain.company.name=<LOG_LEVEL>
```
Scaling WordPress: Latency vs Throughput
Tags: aws, wordpress, webdev, webperf
Published: 2020-01-08 17:35:56

When scaling WordPress sites, one of the first things people try is adding more hardware. Unless this is a proven bottleneck in the stack, this added hardware capacity is often left idle only to be used by various buffers and caches later.

So how do you do capacity planning for large WordPress sites? At Scale Dynamix, we like to think of it in terms of latency and throughput.

Roughly speaking, latency is how fast the site loads for one visitor. Throughput is how many visitors can access the same site at the same time. If latency is too high, adding more hardware makes little difference.

Imagine you are going on a road trip. To avoid traffic, you leave at 2 am and have all six lanes of the interstate to yourself.

But…

You are driving a Toyota Yaris! Would adding another lane on the freeway make you go faster? Of course not.

Similarly, if WordPress is slow for one visitor while most of the CPU is idle, adding more hardware won’t make much difference.

This is why the right starting point when scaling WordPress is latency reduction. Making sure the site loads as fast as it can for one visitor helps when you are ready to open the floodgates and start serving thousands of visitors per minute.

Having said this, I would choose an empty freeway and a Yaris over a congested road and a BMW any day.
Create a public screenshot service with one click
Tags: puppeteer, heroku, screenshot
Published: 2020-01-08 17:27:33

---
title: Create a public screenshot service with one click
published: true
description: 
tags: puppeteer, heroku, screenshot
cover_image: https://thepracticaldev.s3.amazonaws.com/i/byvqexc12wwfa8fnej1g.png
---

I wrote a tutorial about creating a service that takes an URL to produce a PNG file from it [here](https://fabiofranchino.com/blog/create-website-screenshot-service-with-puppeteer-on-heroku/)

You can skip it completely and deploy with [one click](https://github.com/fabiofranchino/puppeteer-heroku-screenshot-service) (thanks to Heroku) your own service.

Happy screenshotting!
How to show operation time when run `history` command - Linux Tips
Tags: linux, bash, ubuntu
Published: 2020-01-08 17:11:34

We can use `history` command to get our history operations in console:

```bash
$ history | tail -5
  1659  vim test.sh
  1660  cat ping.log
  1661  ls
  1662  vim a.py
  1663  history | tail -5
  ...
```

By default, `history` will only show a operation sequence number (the leading 1659, 1660, ... in this case) and the command name. 

What if we want to see when we did such operation? 

The trick is define `HISTTIMEFORMAT` environment variable:

```bash
$ export HISTTIMEFORMAT='%F %T '
```

After define it, now let's run the `history` command again:

```bash
$ history | tail -5
  1661  2020-01-08 11:56:50 ls
  1662  2020-01-08 11:56:56 vim a.py
  1663  2020-01-08 11:57:02 history | tail -5
  1664  2020-01-08 11:57:41 export HISTTIMEFORMAT='%F %T '
  1665  2020-01-08 11:57:43 history | tail -5
  ...
```

Now the time shows up.

But you may find commands that ran before we set the `HISTTIMEFORMAT` variable are showing the same time, for example:

```bash
$ history | head -10
  671  2020-01-08 11:56:25 kill -INT 16055
  672  2020-01-08 11:56:25 kill -INT 16094
  673  2020-01-08 11:56:25 kill -2 16122
  674  2020-01-08 11:56:25 kill -2 16138
  675  2020-01-08 11:56:25 kill -10 16162
  676  2020-01-08 11:56:25 ps axu | grep test.sh
  677  2020-01-08 11:56:25 kill -10 16174
  678  2020-01-08 11:56:25 kill -10
  679  2020-01-08 11:56:25 kill -10 16195
  680  2020-01-08 11:56:25 exit
```

You can see in this case, all commands' time show as "2020-01-08 11:56:25", this is because before we set the `HISTTIMEFORMAT` variable, system didn't record the timestamp for each command. To show time for those old commands, system chose to use the earliest time it started to record.

In fact, the command histories are saved in `~/.bash_history` file. If you check the content of it:

```bash
$ cat ~/.bash_history
...
ls
vim a.py
ls
exit
#1578501725
history | head -5
#1578501743
export HISTTIMEFORMAT='%F %T '
#1578501745
ls
#1578501748
history | head -5
#1578501829
history
#1578502154
exit
```

You can see that after we set the `HISTTIMEFORMAT` variable, there is an extra timestamp like `#1578501743` is saved associate with the command. When we run the `history` command, it will read this `.bash_history` file, convert the timestamp to human friendly format and show it with the command.
Set Bazel BUILD_EMBED_LABEL to git commit SHA with state of uncommitted changes
Tags: bazel
Published: 2020-01-08 16:43:52

The following git command:

```sh
git describe --always --dirty
```

produces this output:
```
a3da1ee # when working tree does not have uncommitted changed
a3da1ee-dirty # when working tree has uncommitted changed
```


Next, we plug the `git describe` command into `--workspace_status_command` flag

```sh
bazel build target --workspace_status_command='echo "BUILD_EMBED_LABEL `git describe --always --dirty`"'
```


For convenience of not having to repeat the flag, I've placed the following in `.bazelrc`

```
build --workspace_status_command='echo "BUILD_EMBED_LABEL `git describe --always --dirty`"'
```
On.NET Episode: Azure Service Bus Core Features
Tags: dotnet, azure, messaging, microservices
Published: 2020-01-08 16:33:45

In this episode, [Ashish Chhabria](https://twitter.com/ashishc1) returns to talk to us about some of the core features and capabilities  of Azure Service Bus. We will see demos of how to leverage things like Peek Lock, Receive Delete, Rules and Transactions.


{% youtube cdSSA5L-Ndw %}

If you liked this video and would like to see some more of our .NET content, please subscribe to our [.NET Developers YouTube Channel](https://www.youtube.com/channel/UCvtT19MZW8dq5Wwfu6B0oxw).


## Useful Links
* [What is Azure Service Bus](https://docs.microsoft.com/en-us/azure/service-bus-messaging/service-bus-messaging-overview?WT.mc_id=ondotnet-devto-cephilli)
* [Choose between Azure messaging services](https://docs.microsoft.com/en-us/azure/event-grid/compare-messaging-services?WT.mc_id=ondotnet-devto-cephilli)
* [Messaging Patterns](https://docs.microsoft.com/en-us/azure/architecture/patterns/category/messaging?WT.mc_id=ondotnet-devto-cephilli)
* [Azure Service Bus Samples](https://github.com/Azure/azure-service-bus)