teleren/devto huggingface dataset:
Write-Only Social Media
Tags: social, media, anxiety
Published: 2021-05-16 04:05:44

---
title: Write-Only Social Media
published: true
description: Limiting social media consumption while using it for yourself.
tags: social,media,anxiety
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g2ae7zwj56p45gm1rxgb.png
---

Social media can help you look for jobs, be visible to people and get word out about things that could help others. At what cost though?

The current disaster is an unevenly distributed pandemic but 
there have always been unevenly distributed disasters as one side of the world recovers and the other reels.

If you're in the part that's currently reeling it can be hard to open up twitter to share resources or job hunt without a forceful reminder of what the state of everything is.

To solve this problem I've been using tools that are normally used by brands to maintain a social presence, a social media tool like [Buffer](https://buffer.com/)

# Write Only Social Media

[Buffer](https://buffer.com/) is particularly helpful because it has free accounts, is easy to use to get set up for LinkedIn and Twitter and keeps the peace-wrecking "feed" off your eyeballs.

With it you could write and post things without ever having to look at what else is happening.

If you turn on emails for twitter DM's, you won't miss those either and going straight to http://twitter.com/messages/ will bypass the feed again to reply to them.

---

Stay safe, stay home if you're in the currently unlucky country/city and hopefully this too will pass.
AWS Identity and Access Management
Tags: aws, cloud, cloudskills, beginners
Published: 2021-05-16 02:14:40

IAM is the Identity and Access Management service in AWS it is used to create users and assign them to groups. Whenever anyone needs access to an AWS service within out organisation then we only want them to access only some services on our account because they can change something because of malicious intent or a mistake. We want to give them as little access as possible to complete there job to reduce any mishaps but when we create an account on AWS that user by default has root access. 

## Use of IAM

To combat this situation AWS has a service which allows us to create users and allow them only certain restrictions that service is IAM. In IAM for each user we create a new account and give them certain accesses and privileges. We can also create some groups which already contain access and privileges required to complete some tasks. After that we can add users to these certain groups.

## IAM concepts

Majorly IAM is divided into 4 concepts:-

1. User groups
1. Users
1. Roles
1. Policies 

### User Groups

User groups are groups that are created to reuse access given to a certain user. Whenever we create groups we can attach certain access to a group. After that we can add users to a group. This helps in managing users to that all users that are in a group contain the same access. We can also add a user to multiple groups.

### Users 

These are the users created by IAM for every person that use AWS there should be one user. 

We should also avoid  using the root account as from there we can delete our account and this can lead to a massive mishap even if unintended. For all admin purposes we should create a user account and provide admin privileges to that user.

### Roles

Whenever an AWS service needs access to other services than we create a role an we can add access to other services buy using roles. I also allows application code running on an EC2 instance access perform actions on AWS resources.

I also allows to add users from other organisations.

### Policies

Policies are the list of accesses provided to a user, user group or role in a JSON format AWS already contains many preexisting policies which are really helpful in providing access to AWS users.
About redux-saga/effects put, call, take, select
Tags: redux, react
Published: 2021-05-16 00:52:59



This time I used call, fork, put, take, and select.
<ul>
 	<li>call: Wait for the promise to finish. The argument should be a function that returns a promise.</li>
 	<li>fork: Start another task. The argument can be an asynchronous function starting with *function*.</li>
 	<li>put: Dispatch an action.</li>
 	<li>take: wait for an action, an event to occur, and take as argument a string that is not a function of the action, but an action.type.</li>
 	<li>select: select data from a state, taking a function that takes a state as an argument.</li>
</ul>
When importing, use

&nbsp;
<pre><code>
import { call, fork, put, take, select } from 'redux-saga/effects'.
</code></pre>
Write something like

&nbsp;

Here is a sample code

&nbsp;
<pre><code>

function* callSample(){
    const { result, err } = yield call(getData) 
    if(result){
        console.log(result)
    } else {
        console.error(err)
    }
}

const getData = () =&gt; {
    return axios.get('./get')
        .then( res =&gt; {
            const result = res
            return {result} 
        })
        .catch( err =&gt; {
            return {err}
        })
}
</code></pre>
If you give an argument to a function that returns a promise in call, it looks like this

&nbsp;
<pre><code>
function* callSample2(){
    const data = {
      name: 'hoge',
      password:'huga'
    }
    const {responce, err} = yield call(postData(data))
}
const postData = (data) =&gt; {
    return axios('./post')
        .then( () =&gt; { /*something*/ }
        .catch( () =&gt; { /*something*/ }
}
</code></pre>
&nbsp;

The fork is a branch of the root task, and the process is written.

&nbsp;
<pre><code>
//fork sample
export default function* rootSaga(){
    yield fork(forkSample)
}
function* forkSample(){
   //processing
}
</code></pre>
&nbsp;

Put is used to dispatch actions according to the results of other asynchronous processes.

&nbsp;
<pre><code>
//put sample
function* putSample(){
    const { result, err } = yield call(getData) 
    if(result){
        yield put(get(result))
    } else {
        console.log(err)
    }
}
</code></pre>
&nbsp;

Take will be executed when dispatched from elsewhere.

&nbsp;
<pre><code>

function* takeSample(){
    while(true) {
        const action = yield take("ADD")
    }
}
</code></pre>
&nbsp;
<pre><code>

function* selectSample() {
        const state = yield select(getState)
    }
}


const getState = (state) =&gt; ( state )
</code></pre>
&nbsp;
Vue js install vue cli Error
Published: 2021-05-16 00:45:45

npm ERR! Response timeout while trying to fetch https://registry.npmjs.org/typescript (over 30000ms)

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Rahmanullah_Ziar\AppData\Roaming\npm-cache\_logs\2021-05-16T00_22_01_619Z-debug.log
My javascript / tech / web development newsletter for 2021-05-15 is out!
Tags: javascript, tech, webdev, discuss
Published: 2021-05-16 00:35:52

---
title: My javascript / tech / web development newsletter for 2021-05-15 is out!
published: true
description: A roundup of all the best javascript, tech and web development links posted to my linkblog in the past week
tags: javascript, tech, webdev, discuss
---
In this week’s edition:

Serverless, v8, resources for CTOs, Internet Archive infra, cool javascript tutorials & libs, design vs dev, Apple privacy vs Ad Tech , NFTs & crypto, LinuxOnM1, space travel, dev tips

https://markjgsmith.substack.com/p/mark-smiths-newsletter-15-05-2021

Would love to hear any comments and feedback you have.

[@markjgsmith](https://twitter.com/markjgsmith)
Configure Your Laravel Queues with AWS SQS
Tags: laravel, aws, sqs
Published: 2021-05-16 00:33:59

Introduction
Recently, I had to migrate my queue driver on a project from Redis to SQS and for some weird reason the information provided on the official Laravel Queues documentation didn't do justice to this and I couldn't find an article online that could help, that's why I'm writing this, with the hope that you don't spend two hours of your Saturday morning figuring stuff that should have been documented. I'd try to keep this article as brief as possible, I'd attach links to other articles that explain some steps so I can focus on the important parts.

#Prerequisites
An existing Laravel application
An AWS account
An understanding of Laravel queues
Some AWS knowledge

If you use Laravel Horizon to manage your queues, you'd be making some modifications to your horizon.php file. For each worker defined, change the queue connection from redis which is the default to env('QUEUE_CONNECTION')

Out of the box, Laravel dispatches jobs to the default queue, therefore, your first queue should be named default on SQS.

[Configure Your Laravel Queues with AWS SQS](https://www.codecheef.org/article/configure-your-laravel-queues-with-aws-sqs)
Getting Historical Stock Data Using Python
Tags: python, beginners, datascience, stockdata
Published: 2021-05-16 00:26:03

There's an easy way to get stock data using pandas_datareader from yahoo finance which uses basics of pandas dataframe and also doing a moving average. It actually only takes a few lines of code and can help you in your data pipeline.  This is just the quick snippet to get you going, if you want to see the full article you can scroll to the bottom.


##Extracting data from yahoo with Pandas
We will be using Yahoo Finance for obtaining stock data. Firstly we will import pandas_datareader.data then send a request to yahoo finance with ticker , start and end date. The “pandas_datareader” module is a useful module that abstracts extracting web data very easily. You don’t have to bother with “requests” or “urllib” and parse the HTML data, this is all done for you! From the module in response we will get a dataframe containing our data in rows and columns . The columns are basically High , Low , Open , Close , Volume and Adj Close.

```
import pandas_datareader.data as web
import datetime as dt

ticker = "AAPL" # This is Apple's ticker
start = dt.datetime(2020,1,1) # Starting date in format (year,month,day)
end = dt.datetime(2020,12,1) # Ending date 

df = web.DataReader(ticker,"yahoo",start,end)
print(df.head()) # Prints first 5 columns of data
print(df.shape) # Prints the number of rows and columns
```

You get the output:
![Output](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o0apqru4fvys2m5kr6ku.png)
 
* df = web.DataReader(ticker,"yahoo",start,end) - This stores the dataframe obtained in the variable df. The first value passed here is ticker i.e. “AAPL” , second is the source name . As we are using yahoo finance here so it should be “yahoo”. Then the end and start date (in the form of datetime). You can see other data sources here.
* print(df.head()) - It prints the first 5 columns of the data obtained.
* print(df.shape) - Prints the rows and columns in the dataframe . As seen in output there are 241 rows and 6 columns


###There's more..  
There's still want to know more you can find out all of these and more at our full article: [Full article: how to get and chart historical stock data](https://pythonhowtoprogram.com/getting-historical-stock-data-using-python-3/?utm_source=dev.to&utm_medium=cp&utm_campaign=ctalink&utm_term=historical-stock-data-article)
Generate clicking event in js
Tags: html, javascript, dom
Published: 2021-05-16 00:25:07

<h2>Get DOM element is javascript</h2>

```javascript
document.getElementById()
document.getElementsByName()
document.getElementsByTagName()
document.getElementsByClassName()
// Parameter same to parameter css selector
document.querySelector()  
document.querySelectorAll()
// Specific for getting html element
document.documentElement()  
// Specific for getting body element
document.body()  
```

<h2>Generate clicking event in js</h2>
```html
<html>  
    <head>  
        <title>usually function</title>  
    </head>  
    <script>  
      
function load(){  
    //下面两种方法效果是一样的  
    document.getElementById("target").onclick();  
    document.getElementById("target").click();  
}  
  
function test(){  
    alert("test");  
}  
      
</script>  
    <body onload="load()">  
        <button id="target" onclick="test()">test</button>  
    </body>  
<html> 
```

Remark.

btnObj.click() is to actually click the button with the program, triggering the button's onclick() event

btnObj.onclick() simply calls the method pointed to by btnObj's onclick, which is just a method call and does not trigger the event.
Get VSCode On Android 📱
Tags: vscode, android, termux, mobile
Published: 2021-05-16 00:21:22

To Run VSCode On Android, We're Gonna Use A Terminal Emulator Called [Termux](https://play.google.com/store/apps/details?id=com.termux) you can install it on the [play store](https://play.google.com/store/apps/details?id=com.termux) it allows you to run a sort of Linux emulator you'll also need an Electron App Called [Code-Server](https://github.com/cdr/code-server) which is just a VSCode Server so we're gonna use Termux to host Code-Server allowing Us To USe VSCode In Our Browser

### Installing Termux 📥

So First Things First Installing Termux you can get it from the [play store](https://play.google.com/store/apps/details?id=com.termux) and you'll just have to install and launch it

### Installing Dependencies 💾

Now let's Install the Dependencies you'll need NodeJS yarn python and git also build-essentials according to the Termux NodeJS wiki for building native extensions you can use this command to do so
```
pkg install nodejs yarn build-essential python git
```

### Installing And Running VSCode Server 🧑‍💻

finally, install VSCode Server With This Command
```
yarn global add code-server
```
`Note: This May Take A While`

Now You Can Run VSCode Server Using this Command:
```
code-server &
```

### Updating VSCode Server 📥💾

Now If You Need To Update VSCode Server For Any Reason Run This Command:
```
pkg update
yarn global remove code-server
yarn global add code-server
```
this basically updates the package lists and removes and reinstalls VSCode Server

### Hosting On Server
If You Want To Run VSCode Server On An Actual Server You Can Use A Hosting Platform That Won't Break The Bank 🏦  Use [DigitalOcean](https://m.do.co/c/b908a223304d) and Get $100 In Credits To Host Your Servers
How remote work can improve documentation
Tags: remotework, workfromhome, documentation, communication
Published: 2021-05-19 20:27:15

---
title: How remote work can improve documentation
published: true
date: 2021-05-16 00:00:00 UTC
tags: remotework,workfromhome,documentation,communication
canonical_url: https://jhall.io/archive/2021/05/16/how-remote-work-can-improve-documentation/
---

As the pandemic appears to be winding down, there’s a lot of talk about the merits going back to the office versus staying remote, versus a hybrid approach.

One aspect of remote work in particular I think is especially valuable, and very easily lost on colocated teams.

## Remote teams are better at documentation

When we share an office, so many of our meetings and conversations are fleeting. We meet to discuss some minutiae of the day, then walk away implement something, then forget the conversation ever took place.

On a remote team this _can_ happen, but far more often, even by accident, we leave the meeting with some permanent artifacts. It might be a Google doc. It might be a Slack or email thread. Even if the decision is made over a video call, keeping a record is usually as simple as hitting a ‘Record’ button.

So what?

Documenation is one of the most trivial ways to increase team cohesion. The simple act of documenting decisions can reduce [bike-shedding](https://en.wikipedia.org/wiki/Law_of_triviality) and time wasted re-making (or needlessly changing) trivial decisions.

I talk more about documentation (and other aspects of how we communicate) in the video [_Better WFH: Making remote work more effective_](https://www.youtube.com/watch?v=OcUZxA4IICs&t=1185s).

* * *
_If you enjoyed this message, [subscribe](https://jhall.io/daily) to <u>The Daily Commit</u> to get future messages to your inbox._
"Globally" speaking 
Tags: javascript, beginners
Published: 2021-05-15 22:31:00

Only after I finished my first JavaScript project for school I realize that I need to use Global Variables as less as possible.
Think about it, You have a pretty good file of code that you really want to keep tight and clean with a lot of functions that uses the same element more than once, So you the first thing that came to my head as beginner is to grab all the elements that are being used more than once and put them all at the beginning of the page stacked in a nice section.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/84iui896v86xza6tk6az.png)


So I guess I was wrong, I noticed that having so many Global Variables is not that good for two reasons..
The first reason is pretty simple, My cohort leader told me so :)
The second reason is that I noticed it is better to grab the elements individually in each function its being used.



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

There is a tricky part to this way of thinking,
I think that using Global Variables is very good but my recommendation of using it will be that is to check how many times you using a certain Variable for example...
If you using an element just a couple of times in my opinion it should not be in the global scope because you want to keep you Global Variables bank tight and efficient as much as possible.
But if you using a specific element A-LOT  (let’s say at least 4-5 times) that is when it should be in the Global Variables bank.
Also we need to be carful because it is very easy to overwrite a window element or a function when we use Global Variables.

I hope this post help you choose the right way of using Global Variables, 
Good luck with your code.
Lending some color to Tokei Code Analyzer
Tags: rust, showdev
Published: 2021-05-15 21:52:32

Time for another open-source adventure! We’ll be joined by [Max Jacobson](https://twitter.com/maxjacobson) as we visit the Rust cli-tool [Tokei](https://github.com/XAMPPRocky/tokei). Tokei generates statistics around your code and language usage. For example, [chael.codes](https://www.chael.codes/2021/04/07/tokei-open-source.html) looks like: ![tokei code analysis](https://www.chael.codes/assets/img/posts/Tokei-no-color.JPG)

Forem, the repo behind therelicans.com and dev.to, looks like this: ![tokei code analysis of Forem](https://www.chael.codes/assets/img/posts/tokei-forem-no-color.JPG)

We’re going to pick up [an issue](https://github.com/XAMPPRocky/tokei/issues/419) with a lot of discussion that hasn’t been touched in 10 months that I personally like. Those screenshots before weren’t very engaging, right? Let’s add some lovely color to Tokei’s terminal output!

> There are some requirements listed out in the issue above.
> 
> - It must look good in light and dark mode terminals
> - A crate should manage colorizing the output
> - A color flag should manage color output `--color (always|auto|never)`
> - thick rows === should be bold and the thin rows — dimmed

I think it’d look nice to give all the languages a cyan color, and emphasize the subtotals.

First step is identifying how we’ll cover color output, and the issue points us to [colored](https://crates.io/crates/colored) which is based on a Ruby gem of [the same name](https://github.com/defunkt/colored). Usage is very straightforward. `println!("Hello, {}!", "world".green().bold())` will use the terminal’s colors, and bold the text. ![the world in hello, world is green and bold](https://www.chael.codes/assets/img/posts/terminal-color.JPG)

> Note that “cyan” or “green” may not always be cyan or green, they’re just roles in your terminal color scheme.

Next, it’s time to think about how and where to output these colors. Tokei implements a printer interface in [cli\_utils.rs](https://github.com/XAMPPRocky/tokei/blob/611de1fc7b33027b918e97127c67825cc7408273/src/cli_utils.rs) which is where I found the [headers!](https://github.com/XAMPPRocky/tokei/blob/611de1fc7b33027b918e97127c67825cc7408273/src/cli_utils.rs#L150-L164)

With some lovely colors and style implemented in Tokei, it’s time to think about those command line args and turning off color. Some people (like other computers) prefer not to have color. I think we handle this in [cli.rs](https://github.com/XAMPPRocky/tokei/blob/611de1fc7b33027b918e97127c67825cc7408273/src/cli.rs#L10-L26). [ShouldColorize](https://docs.rs/colored/2.0.0/colored/control/struct.ShouldColorize.html) respects environment variables like NOCOLOR and CLICOLOR, but flags seem helpful too. We should document this regardless.

{% github https://github.com/XAMPPRocky/tokei/pull/751 %}
Afficher/Créer une FavIcon
Tags: french
Published: 2021-05-15 21:33:04

_**Qu’est ce qu’une FavIcon ?**_

Une FavIcon est la petite icône situe dans l’onglet d’une page Web :
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ada243sb0rwtnhz70fxz.png)

Cette icône vous permet en un clin d’œil de reconnaître le site que vous visitez ou pour retrouver un onglet rapidement.

_**Comment modifier l’Icone de mon site ?**_

Très facilement !! Pour que la majorité des navigateurs Web puissent lire vôtre **[FavIcon](https://www.favicon.cc)** je vous conseille d’utiliser le .ico pour votre photo. Ce format appartient à Windows et est en BitMap ( BMP).
Mais vous pouvez très bien mettre du PNG, ceci fonctionnera.

Pour cela, il faudra placer dans le Head de votre site la ligne suivante, **en précisant correctement le chemin de votre icône.**

_**En .ico :**_
```<link rel="icon" href="images/favicon.ico"/>```
_**En .png :**_
```<link rel="icon" type="image/png" href="images/favicon.png" />```

_**Comment créer un Favicon ?**_

Alors on a vu comment à partir d’une de nos images de l’afficher sur nôtre site, mais comment faire si je n’ai pas de .ico ?

Vous pouvez allez sur le site **[FavIcon](https://www.favicon.cc)** qui vous permettra de créer une Favicon personnalisée.

Vous pouvez également à partir d’une image, la convertir en .ico 
via des logiciels ou directement en ligne **[ICI](http://www.htmlkit.com/services/favicon)** ou **[ICI](https://image.online-convert.com/fr/convertir-en-ico)**

fin.

_**ps : Ceci etait mon premier post, prochainement j'écrirai sur HTML/CSS/JavaScript et tout ce qui tourne autour de l'informatique en général comme les serveurs également. N'hésitez pas à me laisser un retour. Merci !!!**_