teleren/devto huggingface dataset:
100 days of code — Dia 8
Tags: python, programming, productivity, 100daysofcode
Published: 2020-11-19 01:45:42

<h2>(18/11/2020)</h2>
[fullcalendar + django]

Hoje, trabalhei com algo que não havia usado antes, utilizei o FullCalendar, que é um conjunto de ferramentas em javascript para trabalhar com calendários. Fiz uma integração com o framework Django, onde o django ficou responsavel por gerenciar as views e com js fiz as funções para consumir o retorno das views. Como eu não havia feito esse tipo de integração antes, acabou tomando meu dia todo, mas ainda consegui ler um pouco, assim que acordei de manhã. 

> Sapiens: 386/428 páginas;
> O que é racismo: 40/82 páginas;


_Se hidratem, comam frutas, leiam bastante, a terra não é plana, vacinas salvam vidas e bolsonaro vai tomar no cu._
Using Minio on Laravel + Vapor Locally
Tags: laravel
Published: 2020-11-19 01:10:25

Testing Laravel Vapor application with file uploads locally can be tricky. It is possible to setup S3 bucket to receive file from localhost by adding required CORS configuration but now you have the alternative of using Minio. 

[![Minio S3 Compatibility](https://dev-to-uploads.s3.amazonaws.com/i/9yahhwjojt0kv7fgslw5.png)](https://min.io/)

## Prequisite

* Setup `laravel/vapor-core` using Composer.
* Setup `laravel-vapor` using NPM to allow file uploading.

## Setup Minio

You can setup Minio locally using Docker or Homestead, however for this demonstration I will be using [Takeout](https://github.com/tighten/takeout). Remember that you need to update `config/filesystems.php` to include `minio` disk configuration:

```php
        'minio' => [
            'driver' => 's3',
            'key' => env('AWS_ACCESS_KEY_ID'),
            'secret' => env('AWS_SECRET_ACCESS_KEY'),
            'region' => env('AWS_DEFAULT_REGION'),
            'bucket' => env('AWS_BUCKET'),
            'endpoint' => env('AWS_ENDPOINT'),
            'url' => env('AWS_URL'),
            'use_path_style_endpoint' => true,
        ],
```

Also don't forget to update `.env`:

```ini
FILESYSTEM_DRIVER=minio
FILESYSTEM_CLOUD=minio

AWS_ACCESS_KEY_ID=minioadmin
AWS_SECRET_ACCESS_KEY=minioadmin
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=local
AWS_ENDPOINT=http://127.0.0.1:9000
```

## Setup Laravel

Next we need to setup Laravel to authorize file uploads. You can refer to [Storage > Authorization](https://docs.vapor.build/1.0/resources/storage.html#authorization) documentation. For testing you can just do the following on `AppServiceProvider`:

```php
if ($this->app->isLocal()) {
    Gate::define('uploadFiles', fn ($user) => true);
}
```

Finally you need to map `SignedStorageUrlController` with the following files:

```php
use App\Http\Controllers\SignedStorageUrlController;
use Laravel\Vapor\Contracts\SignedStorageUrlController as SignedStorageUrlControllerContract;

if ($this->app->isLocal()) {
    $this->app->singleton(
        SignedStorageUrlControllerContract::class, 
        SignedStorageUrlController::class
    );
}
```

And the following Gist should be published to `app/Http/Controller/SignedStorageUrlController.php`:

{% gist https://gist.github.com/crynobone/c5f89034d58598d6c60730e97af60333 file=SignedStorageUrlController.php %}
S1E8 Learn JMeter Series - HTTP Cache Manager
Tags: webperf, performance, testing, tutorial
Published: 2020-11-19 01:05:10

Welcome to Learn JMeter Series!

In this season one, episode eight, you will learn the following:

* HTTP Cache Manager

{% youtube _KBHytyqXlk %}

✔ [Buy me a tea 🍵](https://www.buymeacoffee.com/qainsights)
✔ [My Blog](https://qainsights.com)
✔ [My Udemy Course](https://www.udemy.com/course/performance-testing-using-truweb)
Algumas opções grátis e simples para hospedar seu projeto de html/node básico!
Tags: build, html, github, iniciante
Published: 2020-11-19 00:43:37

 Quando eu comecei a estudar desenvolvimento web uma das coisas que eu mais queria fazer era subir algum projeto para outras pessoas conseguir acessar ou no minimo para colocar em meu porrifólio, porém eu sempre travava pois não curtia a ideia de pagar desnecessariamente alguma coisa para subir. Agora um pouco mais experiente vejo que muitas pessoas tem essa mesma vontade e tem projetos muito legais versionados porém nunca subiram ao ar por qualquer motivo que seja. por isso hoje vou trazer duas opções que achei interessante principalmente para um iniciante.
* O primeiro trata-se do [Github pages](https://pages.github.com)
Basicamente as únicas coisas que você precisa fazer para subir algo no github pages é ter um index.html na raiz do seu projeto, e uma branch chamada gh-pages, e quando você for no seu projeto encontrará este simbolo aqui indicando que já está em pé o seu site!
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/t4g3tiht16pev8tgzsxl.png)

* Outra opção legal é utilizar o [vercel](https://vercel.com), quando se trata de projetos que utilizam node.js.
 Você apenas terá que fazer uma conta no vercel (no caso eu fiz usando o github), pedir para importar um projeto e o próprio vercel sobe o seu projeto e faz o build tranquilo.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/i761sfokn2pkq9huawv0.png)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/l887216x5688k4np14qe.png)

Bem, eu sei que é uma coisa bem simples, porém acredito que vai ajudar muita gente e caso tenha te ajudado lembre de repassar o conhecimento para outros que precisem e se conhecer outras formas pls coloca nos comentários que já vira um complemento maneiro pra galera.
Яаж IntelliJ Idea дээр Eclipse Java Formatter оруулах вэ
Published: 2020-11-19 00:19:00

---
title: Яаж IntelliJ Idea дээр Eclipse Java Formatter оруулах вэ
published: true
description: сургалт
tags: 
//cover_image: https://direct_url_to_image.jpg
---

https://stackoverflow.com/questions/30175765/how-to-add-eclipse-code-formatter-file-in-android-studio
Transpilers
Published: 2020-11-19 00:14:43

Transpilers are wonderful tools for programmers. Code can be translated from one language to another. It can even be converted from one syntax or version to another. It can be useful in many different ways. It allows the programmer to always be able to code in his or her preferred language. Some 
libraries and frameworks are incompatible with browsers as well, such as React, which is one of the most popular app frameworks available. Just load the files that are written in your preferred style into a transpiler. The output file can then be used as the reference script and tucked away into a `dist` folder while you focus on your own code. 

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

In the above example, the code on the left is hand-written JavaScript in ES2015 format. The code on the right is code generated from a transpiler which is in ES5 format. Some browsers still do not recognize some ES2015 syntax, so it is useful to convert it to older versions which are universally accepted.

## Implementation
Now that we understand why we use transpilers, it's useful to understand how they work. Work is accomplished in three distinct steps: parsing, transformation, and generation. Here is a nice graphical representation.

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

#### Parsing
Parsing is the process of the transpiler reading the code and interpreting that code. That interpretation is represented by an abstract syntax tree, which is a tree whose nodes represent actions or data in the program such as conditions and assignments. 

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

The above image shows a short function and the corresponding AST. You can see that leaf nodes are used for variables and constants while branching nodes represent either operators or flow. By traversing the tree you can see the path the code will take in its execution. 

#### Transformation and Generation
The nodes are then translated into equivalent nodes in the target language. This is done because it is easier for the transpiler to convert individual nodes instead of raw code.
This process may take one or many steps to complete, depending on the complexity and size of the code.

Once this is done, the final step is the new code generation. This is typically the easiest and quickest step because it is the simple matter of traversing the nodes of the tree and outputting the correct code. 

After that, the new code will be stored on a new file which can be saved within your program and referenced as the main script. Some useful transpilers available for free use include:
* Babel, a JS transpiler for converting from ES6 to ES5
* Traceur, another similar JS compiler
* Opal, a Ruby to JS compiler
* TypeScript, a syntax more in line with an OO language like Java, but acts like JS
* CoffeScript, a syntax similar to Python, but acts like JS

There are many more which can meet a variety of needs. Try them out and see how your work will be made much easier!
How to insert an item into an array at a specific index in JavaScript?
Tags: javascript
Published: 2020-11-19 00:00:00

---
  title: How to insert an item into an array at a specific index in JavaScript?
  published: true
  tags: JavaScript
  date: Thu Nov 19 2020 05:30:00 GMT+0530 (India Standard Time)
  canonical_url: https://melvingeorge.me/blog/insert-item-at-specific-index-in-array-javascript
  cover_image: https://melvingeorge.me/_next/static/images/main-475a31817a6a76d90959cb90c9087196.jpg
  ---
  [Originally posted here!](https://melvingeorge.me/blog/insert-item-at-specific-index-in-array-javascript)
  
To insert an item or element to a specific index in an array, you can use the [`splice()`](https://melvingeorge.me/blog/remove-element-at-specific-position-from-array-javascript) array method in JavaScript.

[Jump to the full code &rarr;](#full-solution)

Most of the time we may be using the `splice()` method to remove an item from a specific position in an array. To know more about it, check out [Removing items from an array using the `splice()` method &rarr;](https://melvingeorge.me/blog/remove-element-at-specific-position-from-array-javascript).

Consider this array of names,

```js
// names array
const namesArr = ["Jon", "Roy", "Riya"];
```

Let's say we need to need to insert the name `Rony` at index position `1` after `Jon's` name.

We can do that with the help of the `splice()` method by passing `3` arguments to the method:

- The first argument is the `index` position you want the item to be inserted.
- The second argument being the number of elements to be deleted starting from the index position, **in our case we don't want anything to be deleted so we will pass `0` as the second argument**.
- And the third argument is the item, in our case `Rony`.

So let's code that in JavaScript,

<a name="full-solution"></a>

```js
// names array
const namesArr = ["Jon", "Roy", "Riya"];

// name to add
const nameToAdd = "Rony";

/*

Using the splice() array method
to add an item at index position 1 🌟

Argument 1: The index position to add item

Argument 2: No. of items to delete starting from the index position, 
            In our case 0 items to delete

Argument 3: The item to add

*/
namesArr.splice(1, 0, nameToAdd);

console.log(namesArr); // ["Jon", "Rony", "Roy", "Riya"]
```

Yes!! We have successfully inserted our item `Rony` at index position `1` 🌟.

See this example live in [JSBin](https://jsbin.com/gukorurola/2/edit?js,console).

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

---
Career Change Tips: Practice Gratitude 🙏
Tags: career, gratitude, devjournal, writing
Published: 2020-11-18 23:26:20

It can be hard to feel grateful when rejection emails keep popping up in your inbox or you find yourself waiting weeks to hear back from a prospective employer. While you may not yet have your dream job, being grateful for what you do have can work wonders on sustaining yourself in your job search journey. Whether it’s a supportive loved one, a place to live, time, or the opportunity to pursue what you really want to be doing, take a little time to reflect on what you are grateful for during this time.

If you are unemployed, that's right – you have time! Time to dedicate to your job search process every day: researching jobs, tailoring cover letters and resumes, taking online courses, volunteering for a place you’d like to work, and beefing up your online portfolio, website, and/or blog. You have time to earn some part-time income on the side while you go after your dream job. Is there a way you could use your experience and skills from your previous career role to earn part-time income?

You could also think about being grateful for what you don’t have – a job you dislike, a long commute, a stressful work environment, or no time to cook healthy meals or exercise. It’s all about perspective. This won’t last forever, and when you do get a job, you might miss some of the things you have now.

If you do have a job, but are working on transitioning to another, time may be something you seem to have less of at the moment, but that doesn't mean you can't take small steps to get where you need to be. 

##3 ways to incorporate practicing more gratitude in your daily life:

* 🌞 Add it to your morning ritual, whether that's in the form of journaling, movement, or after you take your first sip of coffee. Even if it's just ten seconds out of the day, take a moment to reflect on something that you're grateful for.

* 💌 Reach out to someone you are thankful for and let them know. It could be a friend, family member, colleague, or loved one. Send them a text, write a short email, or take out a pen and paper and write a note or mail a letter or card – just because.

* 🌱 Get your nature on. Even if you don't have easy access to the great outdoors, take a minute to appreciate the clouds, trees, sunlight, or the sunset. Buy some plants and fill your living space with a bit of green. Even better - get out for a walk every now and then. The fresh air and movement works wonders for changing my headspace when I'm feeling in a bit of a funk.

It can be stressful when you are in the midst of working toward changing careers, and taking time to be grateful for what you do have – rather than what you don't – can help you on your journey. It definitely helped me on mine. :)

**What are some of your favorite ways to practice gratitude?**

*I'm Ruanna, a content creator and digital marketer for TomTom Developers, and a freelance writer. Feel free to connect with me here on Dev.to and on Twitter!*
Favorite Resource of the Week: Accessible Colors
Tags: design, beginners, html, css
Published: 2020-11-18 23:25:03

In the world of software development, things move fast. New tools, new libraries, new languages! As technology changes to meet the needs of today's problems, it is important as a developer to keep up to date with what tools work best for you. I am always watching for tools that will help improve my workflow, making me a better designer and developer, and making my work more effective. I would like to share the tools I find that seem to make a difference in my work, and might just help solve some of the problems you are facing in your own!

This week my favorite resource is a newly found tool I thought was super useful for color accessibility.

### [WhoCanUse.com](https://whocanuse.com/)

![image](https://imgur.com/DHDhypm.png)



WhoCanUse is a really well made tool to help designers and developers choose proper color combinations for their websites and projects. It allows you to preview background and text colors, view the contrast ratio and WCAG accessibility grading, along with simulating what people with varying degrees and types of vision impairment will see. The simulation factor is super unique, and also really useful when you need to keep certain end users in mind. In a world of many different accessibility tools to choose from, some are more effective tools than others. WhoCanUse has topped my list as being my new favorite color accessibility tool as it is extremely easy to use, informative, and effective.

[![Custom badge](https://img.shields.io/badge/Visit%20Site%20-->-whocanuse.com-blue)](https://whocanuse.com/)
Thinking in JSX
Tags: react, codenewbie, jsx
Published: 2020-11-17 23:46:58

---
title: Thinking in JSX
published: true
description: How to use logic when working in JSX files
tags: react, codenewbie, jsx
//cover_image: https://direct_url_to_image.jpg
---

# JSX
When utilizing the React framework we write code in JSX. JSX is a syntax extension to JavaScript. This means we are able to write HTML and JavaScript somewhat interchangeably. Here's an example: 
```javascript
const editor = 'emacs';
const element = <h1>{editor} is the best!</h1>;
ReactDOM.render(
  element,
  document.getElementById('root')
);
```
As you can see we can declare variables and embed them within our html element using curly brackets{}. It's easy to use but a bit challenging when our code begins to grow and becomes more complex.
# Logic
Often times we want to add logic statements to control the flow of our program. Say we wanted to set the value of something based on if another variable was undefined. In vanilla JavaScript we would probably end up with something like this: 
```javascript
if(object.id){
  value = `${object.id}`;
} else {
  value = '';
}
```
Although we could add an if statement within our curly brackets I prefer using the ternary operator, &&, ||, etc. It makes our code less "blocky" with fewer lines. Here is what our example could potentially look like within React:
```javascript
value={ object.id ? object.id : '' }
```
This accomplishes the same thing and reduces our code length and readability. You could write the same code in vanilla JS and that might be the way you already do things. I would just say that when using React it can sometimes be more challenging to code all the if statements within the curly brackets and keep track of everything. So use ternaries and single lines when you can!
Day 259: Day To Day
Tags: hiphop, code, coding, lifelongdev
Published: 2020-11-18 23:07:01

_liner notes_:
- Professional : Whew, what a day! Some scheduled meetings were cancelled leaving me more time to code, and code I did. haha Got a couple of functions working in the new CLI. Pretty good day.

- Personal : Spent last night reading up on Progressive Web Apps. Seeing if there's anything new that's happened since the last time I looked into it. Then it got really cold and I just wanted to sleep. haha.

![A view into a green valley in Yanacachi, Bolivia with stony mountains surrounding it.](https://dev-to-uploads.s3.amazonaws.com/i/rqc0oojn3ksj5k2tydev.jpg)

Going to read up some more and do research. I think I'll have to start coding on my side projects a little earlier because when the night falls. Need to figure out what I want to get done day to day. Otherwise I would research topics forever! haha.

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube ZlHVXbrGjUk %}
Using QEMU in 32-bit mode
Tags: programming, ownos
Published: 2021-01-08 13:05:43

---
title: Using QEMU in 32-bit mode
published: true
date: 2020-11-17 19:54:45 UTC
tags: programming,ownos
canonical_url: https://www.solarwinter.net/using-qemu-in-32-bit-mode/
---

Lately I’ve been following [this series on dev.to](https://www.solarwinter.net/using-qemu-in-32-bit-mode/(https://dev.to/frosnerd/writing-my-own-boot-loader-3mld)) on writing your own OS from the ground up - it makes a nice change of pace from the web stuff I’ve been doing, from very near the top of abstractions to right down the bottom.

I did fall into one gotcha which I didn’t see it mentioned anywhere else on the web, so I thought I’d post it for the next person.

When you get to the point of switching to 32-bit protected mode and changing how text is output, the text is meant to appear at the top left (initially) of the VGA buffer.

If you’re running [qemu](https://www.qemu.org) with `-nographic` (i.e. in text mode), **that doesn’t happen** , even though the rest of it - the 16-bit real mode text - _does_ come out. So your code can be working perfectly but you won’t see it. Hopefully that’ll save someone a day’s worth of debugging...

I’ve actually found [Bochs](http://bochs.sourceforge.net) is better for the really low-level debugging (of boot-sector code etc). I haven’t got a good way to debug “kernel” stuff yet, but Bochs does have a means to output to it’s console from inside the running code. I’ll let you know if I figure that out!
My #100daysOfCode Challenge - Python 100 projects in 100 days - Journal Entries - Day 5
Published: 2020-11-18 22:26:33

Day 5 - Password Generator

#Password Generator Project
import random
letters = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
numbers = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
symbols = ['!', '#', '$', '%', '&', '(', ')', '*', '+']

print("Welcome to the PyPassword Generator!")
nr_letters= int(input("How many letters would you like in your password?\n")) 
nr_symbols = int(input(f"How many symbols would you like?\n"))
nr_numbers = int(input(f"How many numbers would you like?\n"))

#Eazy Level - Order not randomised:
#e.g. 4 letter, 2 symbol, 2 number = JduE&!91
password = ""


for char in range(1, nr_letters + 1):
  password += random.choice(letters)


for char in range(1, nr_symbols + 1):
  password += random.choice(symbols)


for char in range(1, nr_numbers + 1):
  password += random.choice(numbers)

print(password)

#Hard Level - Order of characters randomised:
#e.g. 4 letter, 2 symbol, 2 number = g^2jk8&P


password_list = []

for char in range(1, nr_letters + 1):
  password_list.append(random.choice(letters))

for char in range(1, nr_symbols + 1):
  password_list += random.choice(symbols)

for char in range(1, nr_numbers + 1):
  password_list += random.choice(numbers)

print(password_list)
random.shuffle(password_list)
print(password_list)

password = ""
for char in password_list:
  password += char

print(f"Your password is: {password}")


Key Takeaway:
1. Learned about Python Loops and the range()
Save time by NOT working
Tags: management, time, clocks
Published: 2020-11-18 22:26:19

## If you use some timers to force yourself to do something else... the time you're working will magically become more effective!

`+` Derek inserts an impromptu mini music video... hahaha

{% youtube ob92RlowwGQ %}

[https://perpetual.education/save-time-by-not-working](https://perpetual.education/save-time-by-not-working/)

Just saying...




...

## Do you think this video is fun???

Our next session is going to be the first Monday in January. If you're interested - well, get involved! We have some ISA stuff in the works... so, the barrier is getting lower and lower -

https://perpetual.education
Tech stack for DIY robotics project
Tags: robotics, diy, arduino, ros
Published: 2020-11-18 22:19:57

# Physical materials
1. Arduino starter kit:
 * Arduino board
 * Breadboard
 * Jumper wires
 * USB cable
2. Servo motor(s)
3. Optional:
 * Popsicle sticks
 * LEGO pieces
4. PC

# Software and frameworks
1. OS:
 * Ubuntu (Linux), or
 * Debian (Linux), or
 * Windows (experimental)
2. ROS (Robot Operating System)
3. Qt library
4. Essential IDE:
 * Eclipse: extended with the plugin PyDev
 * PyCharm
 * Qt Creator - in Qt installation
 * Qt Designer - in Qt installation
5. Git
6. Arduino library
7. Programming languages
 * Python
 * C++
 * C
8. PyQt: Qt library wrapped in Python

# Optionals
1. Redmine: a web application for project management (open source and free)
2. GitLab or GitHub