teleren/devto huggingface dataset:
Hacktoberfest Contribution: One Line of Code
Tags: css, hacktoberfest, telescope, opensource
Published: 2021-10-28 20:40:41

## Second Cute PR for Hacktoberfest
For my second PR for #hacktoberfest challenge, I wanted to try fixing a bug, instead of working on a feature. I enjoy fixing front-end related bugs, so I decided to give this [issue](https://github.com/Seneca-CDOT/telescope/issues/2370) a try. 

## Challenge Accepted 
The issue was about author info hiding behind the GitHub info when scrolling down the page in [Telescope](https://github.com/Seneca-CDOT/telescope). At first, I thought that fixing that issue was a matter of removing one of the HTML elements and having both author info and GitHub info being wrapped around in one element. I was thinking that maybe when they are both in a single element, the bug will go away. However, after trying to apply this approach, I realized that it wasn't as easy as I thought. The more code I kept changing, the more issues that were not even related to that bug started coming up. That made me have an epiphany that I was most likely overcomplicating everything. 

So I decided to stash my changes just in case and start over where I began. This time, I decided to change as less code as possible to fix the bug🐛. So I run the app and thought that using Developers Tools would be a good option. I clicked on element picker and selected the area of the website I was concerned about. Then, I was just playing around with the CSS it had, by turning each CSS element on and off one by one to see if maybe the issue will be fixed having one of them off. Eventually, I found out that the issue was with the sticky element and its container. Here is my [PR](https://github.com/Seneca-CDOT/telescope/pull/2391) for this issue.

## Here is what I learned: 
Basically, the container will delimit when the sticky element should be kept on the screen. In other words, sticky element will keep the position relative to the screen. Sticky basically means "staying within the screen". So when you put 10px as a value for the [top](https://developer.mozilla.org/en-US/docs/Web/CSS/top) attribute (top: 10px), you are telling the sticky element to start being sticky once the top of the screen gets closer than 10px from the element. There is a great demonstration of how this works with code snippets that I found on Stack Overflow. You can check it out [here](https://stackoverflow.com/questions/54689034/pure-css-multiple-stacked-position-sticky)(P.S. check out the first comment with the code snippets). 

## Takeaways:
I learned that when it comes to CSS related bugs, it is better to start off with Developers' Tools when fixing them rather than changing too much code when it could be just a matter of adding one line of CSS. Next time, I will start debugging from there!😜
How to Boot Raspberry Pi 4 From a USB SSD HDD
Published: 2021-10-28 20:38:34

A Raspberry Pi is such a useful device so why don't give it more power by making it boot from an SSD instead of the default SD card?
Raspberry Pi Desktop is the recommended OS for this tutorial. Visit the link to learn how to [Setting up your Raspberry Pi](https://www.raspberrypi.com/documentation/computers/getting-started.html)

1. Connect to Raspberry Pi over SSH
Default username is pi & password is: raspberry
    
    ```bash
    ssh pi@YOUR_RPI_IP
    
    ```
    
2. Update OS and firmware
    
    ```bash
    sudo apt update && sudo apt full-upgrade
    sudo rpi-update
    ```
    
3. Reboot Raspberry Pi
    
    ```bash
    sudo reboot
    ```
    
4. How to Update EEPROM on Raspberry Pi 4 For USB Boot...
    
    Install latest bootloader
    
    ```bash
    sudo rpi-eeprom-update -d -a
    ```
    
5. Launch this tool for final configurations       
    
    ```bash
    sudo raspi-config
    	advance options > boot order > USB
    	advance options > bootloader Version > E1 - last version ROM
    	display options > Resolution > MODE 82 - 16:9
    ```
    
6. Reboot Raspberry Pi
    
    ```bash
    sudo reboot
    ```
    
7. Copy SD to USB or SSD 
    1. Connect to Pi using HDMI or VNC
        - **Enable VNC in the Pi**
            
            Interface menu > VNC > enable. Using the code below:
            
            ```
            sudo raspi-config
            ```
            
    2. Go to Menu > accessories > SD card copy.
    3. From SD (dev/mmcblk) to SSD
    
    ```bash
    sudo reboot
    ```
    
8. Once it Finish, Turn off the pi
    
    remove the SD and boot from SSD
    
    ```bash
    sudo poweroff
    ```
October: Forem Twitch Events Roundup 👾
Tags: opensource, meta, twitch
Published: 2021-10-28 20:26:59

In October, Nick Taylor and I kicked off Hacktoberfest. We were also joined by 4 awesome guests throughout the month who taught us about GitHub actions, Terraform, DivOps, Framer Motion and more! This is a round up of all the wonderful guests who joined us.

## DEV Hacktoberfest Kick-off
If you are interested in contributing to open source, Nick and I chatted about [open issues](https://github.com/forem/forem/issues) in Forem, how to get started contributing, and how you can use GitPod for your development environment. 

{% youtube 8w1AXyIWiks %}

## Walkthrough Wednesday with Brian Douglas
Brian Douglas , Director of Developer Advocacy at GitHub, joined us to talk about Open Sauced and the GitHub features it leverages, GitHub Actions and packages, project tables, and more.

{% youtube d1KCS6C4Rus %}

**Places to Follow Brian:**
- [Open Sauced](https://twitter.com/saucedopen)
- [Twitter](https://twitter.com/bdougieYO)
- [Personal Website](https://bdougie.live/)


## Walkthrough Wednesday: Learn Terraform with Andrew Brown
Andrew Brown taught us how to use Terraform with AWS. We talked about resources, providers, modules, and more.

{% youtube wHWzxGD_cRk %}

For Andrew's full Terraform course check out their article/video on [FreeCodeCamp](https://www.freecodecamp.org/news/hashicorp-terraform-associate-certification-study-course-pass-the-exam-with-this-free-12-hour-course/)

**Places to follow Andrew:**
- [Twitter](https://twitter.com/andrewbrown)
- [LinkedIn](https://www.linkedin.com/in/andrew-wc-brown/)
- [DEV](https://dev.to/andrewbrown)

## Walkthrough Wednesday with Jonathan Creamer
Jonathan Creamer, Senior Engineer at Microsoft, joined us to chat about mono repos, npm workspaces, DivOps and more.

{% youtube Waw_SZPT_VI %}

**Places to follow Jonathan:**
- [Twitter](https://twitter.com/jcreamer898)
- [DivOps Community](https://www.jonathancreamer.com/announcing-div-ops/)


## Walkthrough Wednesday with Will Johnson
Will Johnson joined us to chat about DevRel, Auth0, Framer Motion, content creation, their new course, and RenderATL .

{% youtube wZdYhsLqdLE %}

**Places to follow Will:**
- [Twitter](https://twitter.com/willjohnsonio)
- [Framer Motion Course](https://motion.williamjohnson.dev/)

Thanks to all our viewers who joined the streams and chatted with us this month! 

Be sure to follow the [ThePracticalDev Twitch](https://www.twitch.tv/thepracticaldev) channel to be notified when future streams begin and check out all the great guests we have joining us every Wednesday this month. 

Be sure to join us next week as we chat with [Stephanie Eckles](https://twitter.com/5t3ph) about CSS, Front-end development and more. 

> **Note:** We will be winding down streams toward the end of the year as we take vacations and enjoy the holidays. But we will be back at the beginning of 2022!
Discoveries in Ruby(and Rails): Enumerable#minmax
Tags: ruby, rails
Published: 2021-10-28 20:04:26

Hi. I'm ahmed, a Rails enthusiastic and i use in my daily life as a developer. This will hopefully be a series in which i write on small(tiny-tips) i discover while coding Ruby.

## Enumerable#minmax
Whenever you need to get the maximum and minimum value in any enumerable list. It returns a tuple which is an array of exactly two items(because tuples are not types in Ruby!). The first item being the `min` and the second being the `max` in `minmax`.

```ruby
[1,2,3,4,5,6].minmax
# => [1,6]
```

The list does not even have to be in any specific order, you can also use it with enumerables that are not ordered.

```ruby
[6,1,5,10,9,0].minmax
# => [0,10]
```

Get the farthest between a group of dates(with Rails extensions)

```ruby
[3.days.from_now, 1.day.from_now, Date.today].minmax
#=> [Thu, 28 Oct 2021, Sun, 31 Oct 2021 15:00:38.694977000 CDT -05:00] 
```

Hope you have a great day!. Happy Coding.

## Links

- [Enumerable#minmax](https://apidock.com/ruby/v2_5_5/Enumerable/minmax)
- [Rails Tiny tips](https://boringrails.com/tiny-tips) by [@matt swanson](https://twitter.com/_swanson)
Pentest/networking project
Tags: showdev, python, cybersecurity, security
Published: 2021-10-28 19:58:56

MedSec is a network and pentest utility that I developed so that I could perform different kinds of task using the same suite, instead of jumping from one tool to another.

Currently, this script can perform a good variety of tasks such as ifconfig, ping, traceroute, port scans (including SYN, TCP, UDP, ACK, comprehensive scan, host discovery (scan for up devices on a local network), MAC address detection (get MAC address of a host IP on a local network), banner grabbing, DNS checks (with geolocation information), WHOIS, subdomain enumeration, vulnerability reconnaissance, packet sniffing, MAC spoofing, IP spoofing, SYN flooding, deauth attack and brute-force attack (beta).

Other features are still being implemented. Future implementations may include WAF detection, DNS enumeration, traffic analysis, XSS vulnerability scanner, ARP cache poisoning, DNS cache poisoning, MAC flooding, ping of death, network disassociation attack (not deauth attack), OSINT, exploits, some automated tasks and others.

If you want to become a contributor, make a pull request or issue.

Waiting for your feedback. Kudos

Link to the repository: https://github.com/medpaf/medsec
Testing in Android. Better return value.
Tags: java, android, testing, tristan
Published: 2021-10-28 19:54:27

###Introduction
- Now that I have officially released my first app, which can be found [HERE](https://play.google.com/store/apps/details?id=com.elliottSoftware.ecalvingtracker&hl=en&gl=US) on the Google Play store. I want to add more features to my app, however, I think the next best step is to add some tests. So, this series is going to be a practical series dedicated to understanding testing in the Android framework.

### Source code
- You can find my source code [HERE](https://github.com/thePlebDev/Calf-tracker/blob/master/app/src/main/java/com/elliottSoftware/ecalvingtracker/util/Resource.java)


###Better return value
- So inside the best practices section of the [Android architecture](https://developer.android.com/jetpack/guide#addendum) guide it recommends adding a Resource class to wrap around our return values to encapsulate both the returned data and its state. Which is great, however, the the only problem is that the example is in Kotlin. So here is my example of converting the class displayed [HERE](https://developer.android.com/jetpack/guide#addendum) into a Java class

```
public class Resource<T>{
    private  T data;
    private  String message;

    public Resource( T data, @Nullable String message){
        this.data = data;
        this.message = message;
    }

    public static <T> Resource<T> success( T data){
        return new Resource<>(data,null);
    }

    public static <T> Resource<T> loading(T data){
        return new Resource<>(data,null);
    }

    public static <T> Resource<T> error(T data, String message){
        return new Resource<>(data,message);
    }


    //GETTERS
    public T getData(){
        return this.data;
    }
    public String getMessage(){
        return this.message;
    }

}
```

- The code above is a pretty straight forward class. The only thing that might seem a little off is all the `T` which are called type parameters and allows us to use this class with multiple data types.

- The main benefit of this class is to wrap the return values from the DAO in this Resource class. This allows us to provide our UI with more info. Especially when an error occurs.

- This code might not seem relevant now but I will be using it to unit test the repository layer of my app.

#Conclusion
- Thank you for taking the time out of your day to read this blog post of mine. If you have any questions or concerns please comment below or reach out to me on [Twitter](https://twitter.com/TristAndroidDev).
Applying to the API for a job with POST and Postman
Tags: api, programming, beginners, codenewbie
Published: 2021-10-28 19:34:31


#What I used
I remember from a recent tech convention I went to we used Postman to do a quick API call to reverse engineer the dominos pizza app. since this is a much more simpler thing and I have an account made with Postman I will be using it for this POST request to applying for a job at Plaid.

I wanted to try and stand out a little more than the traditional applicant and thought it was a neat way to send my info to them.

##HOW TO
1. After creating an account [Postman](https://www.postman.com/) you will be on your home page you will see a "Get Started with Postman" the first box will **Start with something new**
![HTTP request](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i8zgns9apj47jpvt5yhc.png)
2. click on the **Create New link** a box will pop up with a few options the first being HTTP request.
![create new](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/52o5dmo4gpw3jrhbtqaf.png)

3. after clicking on that go to the dropdown to change the GET to a POST request then input the URL they gave you to to their APIs endpoint. 
below where you entered the endpoint will be a list of things like below. 
![Body tab](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cu5zkatucnnw13g1c2xp.png)
4. find the **Body** tab click in the circle for **raw** and then to the right of the GraphQL circle is a dropdown. since they want it in a JSON object change the dropdown to JSON and copy paste their example from the application site if provided. this was the copy provided by Plaid I used. 
![JSON Object](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zhym5oc1esjcsokfbd4y.png)
and what I entered into that body tab
![sample JSON object](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8pyqgqj5sni45gms82u3.png)
5. after that just hit the big blue send button and you should get a response back like the one I received below!
![API Response](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7ifh73e5exa36mx8ecz0.png
)
and with those few easy steps and Postman you've applied to their API with a POST request. Not to difficult but a great little way companies have been testing people out before you even talk to someone.
meta-system
Published: 2021-10-01 21:42:23

Eu tenho trabalhado com uma equipe de programadores em um projeto de código aberto e gratuito chamado Meta-System, e acho que pode interessar à vocês. Ele tem o propósito de trazer sanidade de volta pro desenvolvimento de softwares.

Os desenvolvedores que trabalham comigo já passaram dias ou semanas configurando bibliotecas, ambientes, arquitetura, e repositórios em outros projetos; com o Meta-System, é possível focar diretamente no problema que se quer resolver.

De uma forma mais técnica, acreditamos que todo software é feito de três coisas: Dados, Regras, e Protocolos. O Meta-System é uma abstração construída em cima deste conceito, que permite uma alteração granular e desacoplada de qualquer um destes elementos. Com isto, é possível que os fluxos de negócio de uma aplicação sejam construídos com a mínima necessidade de código adicional.

Além disso, dá pra estender a funcionalidade do software, caso o que venha por padrão não seja o suficiente pra você. E dá pra fazer isso sem nenhuma alteração no código fonte.

Eu de verdade acredito nessa proposta, e ainda com uma comunidade incrível por trás, sei que dá pra fazer muitas coisas com uma ferramenta desse porte.

Temos nossa comunidade no Discord, onde a gente pode conversar sobre. Eu quero ouvir o que vocês acham e pensam sobre a ferramenta, assim como as dúvidas de uso e tal.

Discord: https://discord.gg/ndGsnbTW7V
Documentação: https://mapikit.github.io/meta-system-docs/
Código: https://github.com/mapikit/meta-system
Finally Switching from Microsoft LocalDb to SQLite
Tags: database, dotnet
Published: 2021-10-28 19:03:20

Why didn't I do that before? I know, it doesn't make sense.
Well, for my new [Windows app](https://www.xplan-taskmanager.com/en/) I wanted to stay in the Microsoft stack - as usual - and plans were about scaling up to SQL Server. Only option left nowadays, now that SQL Compact is deprecated and Access is not supported by Entity Framework, is [Microsoft SQL Server Express LocalDb](https://docs.microsoft.com/it-it/sql/database-engine/configure-windows/sql-server-express-localdb?view=sql-server-2017).
Yes, it's that bad. Microsoft forgot file-based databases for Windows apps.
Now, LocalDb comes with plenty of drawbacks. Let's recap just two of them.
First one is that it needs a separate setup. It's a Microsoft database... it's intended for small apps... and yet... you cannot embed it in your setup from Visual Studio. You need to handle a separate install - trying not to annoy your customers - and handle different setups/versions for different Windows versions. Just madness.
Second, SQL Server databases have versions. SQL Server Management Studio automatically upgrades databases, so you need to use an old version and be extremely careful, if you want previous version of Local Db to work.
More on on this mess on [Databases for Windows Desktop Development: Welcome to the Jungle](https://dev.to/vicobiscotti/databases-for-windows-desktop-development-welcome-to-the-jungle-23k3).
Well, despite all the universe telling me "don't use LocalDb," I released the 1.0 with LocalDb.
Later, I developed a twin Android app, and used [SQLite](https://www.sqlite.org/index.html) for it. So, late-genius in me said: "time to try it for the desktop too."
And so did I.
Well, having it working it's not been fun as it's usually "advertised" but it finally worked perfectly. No performance improvements, but a huge improvement in terms of schema changes (no mess with database versions), smaller setup (127 Mb to 7 Mb) and... unique setup.
I feel so... light, now!
How to run custom SQL queries using functions in Supabase
Tags: javascript, supabase, postgres
Published: 2021-10-28 18:56:02

Recently I needed to run custom SQL functions in a Supabase project. Their Javascript SDK doesn't support this so the only way is via database functions. You can then call those functions using the Javascript SDK.

![Supabase](https://img.bloggu.io/ipfs/bafkreidyyytr7h5uindrv776chnzkfqtxip4wpfwx435jqipkqac6k66mi)

Let's look at a very simple example using a table called `users`
```
CREATE OR REPLACE FUNCTION all_users()
  RETURNS TABLE (f_id   uuid   
               , f_email   text
               , f_full_name text)
  LANGUAGE plpgsql AS
$func$
BEGIN
   RETURN QUERY
   SELECT id, email, full_name FROM users
END
$func$;
```
The above function will return the `id, email, full_name` for all users in the table. To quickly test the function you can run `SELECT * FROM all_users();`.

Now, moving to your Javascript code, you can run the function using the following syntax:
```
let { data, error } = await supabase.rpc('all_users')
```
It's that simple 😅. 

Now, let's look at a function that receives two parameters:
```
CREATE OR REPLACE FUNCTION all_users(created_from timestamp, created_to timestamp)
  RETURNS TABLE (f_id   uuid   
               , f_email   text
               , f_full_name text)
  LANGUAGE plpgsql AS
$func$
BEGIN
   RETURN QUERY
   SELECT id, email, full_name FROM users BETWEEN created_from AND created_to
END
$func$;
```
And, we can call this function from the Javascript SDK like this:
```
const { data, error } = await supabase
  .rpc('all_users', { created_from: ..., created_to: ... })
```

If you want to reach me, [check out my Twitter](https://twitter.com/StatescuRazvan).

*Article posted using [bloggu.io](https://bloggu.io). Try it for free.*
What Made You Decide to do a Coding Bootcamp?
Tags: beginners, bootcamps
Published: 2021-10-28 18:43:31

> "What made you decide to do a coding bootcamp?"

For those that have made a big career shift of any kind but particularly into the tech field this question is probably familiar. Changing careers from Social Work to Software Engineering has had many people asking this question, sometimes multiple times. At this point, I have most of my answer rehearsed.
  
* It's a field that is constantly changing
* Working remotely is more often an option - thus making it more possible to travel while working
* The emotional toll is a lot less than social work
* Opportunities are endless - jobs are available in almost every field of interest
* There's still opportunity for helping others in this line of work

This list is just a start too. Some of these are particular to my experiences and preferences. However there are plenty of shared reasons that draw people to make the change. After taking time to do some research on the job field at large, I was easily convinced this was a good decision for me. Here are three reasons that might convince you too: 

### Development is a growing field

In 2020, during a time that many job fields declined  due to COVID, software development continued to grow. It's expected that in the next 10 years alone, the job market will grow by 20%. The US Bureau of Labor Statistics estimates around 150,000 open positions a year. As the daughter of someone from the boomer generation, the phrase "job security" has been hammered in as an important attribute of any job decision. As far as security goes - a growth rate of 20% isn't bad. 

### Development is inherently a team based role

Due to the nature of projects - collaboration is an expectation in this field. The need for diversity within teams becomes more necessary due to this as well. A solid team will be communicative, diverse, and goal oriented. (This is not a complete list, but for our purposes it's enough.) For those who are like me and enjoy working with people - this is a huge draw. The initial stereotype is working on a computer by yourself. Thankfully, only half of that is true. 

### Software Development is a lot like puzzling

Often you'll hear that HTML is like the skeleton, CSS is like the skin, and Javascript is like the brain. Another way to look at it is that HTML and CSS are the edges and corners of a puzzle with Javascript as the the all the middle pieces. There's a lot of time figuring out how individual pieces work together, you have an idea of what the ending result will look like, and sometimes you'll want to make pieces fit that don't. Finally, both have that euphoric feeling of accomplishment when you figure out a section that was proving to be particularly difficult. 

Overall, changing careers is equally terrifying and exhilarating. For me, a list makes the decision process (as well as the reminder of why I made said decision) that much easier. Whatever has lead you down this path, preparing for what's ahead, and remembering why you started down this road helps with the ups and downs.