teleren/devto huggingface dataset:
Vue.js printing
Tags: vue, print
Published: 2022-10-25 02:14:05

Hello everyone, I have a task to implement sales impressions and reports in the application I work on.

I have created a separate page with the data separated from the report and I request it to be printed by the browser, but I have had problems with the page break.

The page break does not occur as expected and does not keep the header on the next page.

Has anyone ever experienced this? Any tips help.
Remove Duplicates from Sorted List
Tags: algorithms, csharp, leetcode, easy
Published: 2022-10-25 02:07:15

_#83.Remove Duplicates from Sorted List_

### Problem statement
Given the `head` of a sorted linked list, _delete all duplicates such that each element appears only once_. Return _the linked list **sorted** as well_.

**Example 1**
```
Input: head = [1,1,2]
Output: [1,2]
```

**Example 2**
```
Input: head = [1,1,2,3,3]
Output: [1,2,3]
```

### Explanation
給定一個從頭開始的已排序鏈結串列，刪除串列裡重複的元素，使每個元素只出現一次，最終返回一個排序好的鏈結串列

### Solution
熟悉鏈結串列的話這題不難，刪除重複值的方法是略過下個節點，將節點與下下個節點連接起來，特別注意的地方是要如何知道該節點是重複值，用變數紀錄嗎？還是有其他方法？

我從題目知道該串列是已經排序過，故將當前的節點值與下一個節點值比對是否相同，如果相同就用前面提到的刪除方式，略過下一個節點，將當前節點與下下節點連結起來；若不相同則將指標位置移動到下一個節點，重複以上步驟直到下一個節點指標為 null 為止

```cs
public ListNode DeleteDuplicates(ListNode head)
{
	if (head != null)
	{
		var curr = head;

		while (curr != null && curr.next != null)
		{
			if (curr.val == curr.next.val)
				curr.next = curr.next.next;
			else
				curr = curr.next;
		}
	}

	return head;
}
```

### Reference
[LeetCode Solution](https://leetcode.com/problems/remove-duplicates-from-sorted-list/discuss/1312934/C-Solution)

[GitHub Repository](https://github.com/FakeStandard/LeetCode-CSharp/tree/main/Solution/0083.Remove-duplicates-from-sorted-list)

---

Thanks for reading the article :tulip: :sunflower: :blossom:

If you like it, please don't hesitate to click heart button :heart:
or click like on my Leetcode solution
or follow my [GitHub](https://github.com/FakeStandard) :star:
or buy me a coffee :arrow_down: I'd appreciate it.

[![Buy-me-a-coffee][1]][2]

[1]: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h077sxd0vx1hix4t7lw8.png
[2]: https://www.buymeacoffee.com/FakeStandard

---
Learning GitHub
Tags: github, learning, beginners, ramblings
Published: 2022-10-25 01:56:11

So, I noticed that when I was looking at shields.io that when I tried to generate a few badges for my current (and only) repo, some of them didn't work. For example, I wanted a download count on in the readme but, because the repo didn't have any releases committed, it kept saying "no releases". After looking into that and getting that fixed, I realized: _"I need to do more research on GitHub"_

I thought that it was literally just a drag and drop away from releasing my repo to the world but, I can see that there is more to GitHub than I thought and I really need to learn more before I upload [Monster Killer MV](https://dev.to/kurtissfrost/dev-blog-01-be5).

So, I'm going dive deep into the internet and look for videos and guides and try to learn as much as I can about this.
JavaScript Prototype
Tags: javascript, beginners, tutorial, programming
Published: 2022-10-25 00:25:53

#### What is object prototype in JS?

* In JS objects use themselves to **share properties** and **inherit features** from one another and this is done using prototype.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jczxazfq1zs3p4nbiif1.jpg) 

```
function Car() {
  this.company = 'Bugatti'
  this.doors   = 4
}

const car = new Car();

console.log(Car.prototype);

// Car{}
```

* The prototype is itself an **object** so the prototype will have its prototype making what is called a **prototype chain**.
* The chain ends when we reach a prototype that has *Null* for its prototype.


* Prototype inheritance is used to **add methods and properties** to the objects.

```
function Car() {
  this.company = 'Bugatti'
  this.doors   = 4
}


const car1 = new Car();
const car2 = new Car();

Car.prototype.model = 'Bugatti veyron'

console.log(Car.prototype)

console.log(car1.model)
console.log(car2.model)


// Output

// Car { model: 'Bugatti veyron' }
// Bugatti veyron
// Bugatti veyron
```   

### Prototype are used because:

1. They use *less memory*.
2. There is *less coupling*.
3. Prototypes can be *easily extended*.

##### Learn more about prototype 

[Guide to JavaScript’s Prototype](https://www.freecodecamp.org/news/a-beginners-guide-to-javascripts-prototype/)

### Connect with Me 😊

#### 🔗 Links

[![linkedin](https://img.shields.io/badge/linkedin-0A66C2?style=for-the-badge&logo=linkedin&logoColor=white)](https://www.linkedin.com/in/mahmoud-el-kariouny-822719149/)

[![twitter](https://img.shields.io/badge/twitter-1DA1F2?style=for-the-badge&logo=twitter&logoColor=white)](https://twitter.com/Mahmoud42275)
Historia de IBM de Venezuela
Tags: spanish, ibm
Published: 2022-10-25 00:24:24

La división de IBM en Venezuela inició operaciones en la ciudad de Caracas, el 18 de enero de 1938 en ese momento llamada CA Watson De Maquinas Comerciales. Ofrecían calculadoras, relojes y máquinas tabuladoras. Uno de sus primeros clientes en el país fue la empresa petrolera Mene Grande Oil Company en la ciudad de Maracaibo en donde se instaló en ese año un equipo de registro unitario de IBM. Mientras que las instituciones financieras de la época adquirieron la IBM 801 Bank Proof.

![Máquina tabuladora](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qsfw7fqxx4c4y4vhrmhp.jpeg)

### De Watson De Maquinas Comerciales a IBM de Venezuela

Para el año 1941 abre operaciones en Caracas una planta dedicada en la elaboración de las tarjetas perforadas usadas para el almacenamiento y el procesamiento de datos. En 1947 cambia de nombre a IBM de Venezuela S.A.

  
![IBM de Venezuela](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/46jqwnboazo3fx8o5v7w.jpeg)


Para el año 1957 IBM de Venezuela instala en Caracas el IBM 650, colocando a Venezuela como poseedora de la computadora electronica mas potente de toda America Latina para ese momento. Realizó tareas de contabilidad, investigación y desarrollo privado. Tuvo un costo de 500.000 dólares de la época, y el alquiler para su uso era de 3500 dólares mensual. 


![IBM 650 Venezuela](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/60uroyvu6mpbp2s30mep.jpeg)


Con el pasar de los años, los equipos de IBM se expanden en el país y llegan a ser adquiridos por las empresas petroleras y el sector financiero venezolano. IBM es una empresa que ha sido fundamental en el desarrollo y surgimiento tecnologico venezolano.  


Fuentes:
Fotos: Archivo IBM Venezuela
https://www.ibm.com/ibm/history/ibm100/us/en/icons/optimizingoilsupplies/
https://www.caracasdigital.com/index.php?keyword=TI&x=6299
How to code almost every programming language in your phone ?
Tags: programming, replit
Published: 2022-10-25 00:20:29

You must have read articles telling you "how to install vs code in mobile phones" but it has the best alternative.

If you've ever used replit, you might know what are its features. If you've no laptop or desktop computer at your home/remote areas, the best alternative is the replit app.

You do not need to follow the complex steps like install vs code through termux. Just one click and you can start coding in your mobile phones.

Link for installation (android link):
[https://tinyurl.com/ddzm9969](https://tinyurl.com/ddzm9969)

Link for installation (iOS link):
[https://tinyurl.com/ywyuysfp](https://tinyurl.com/ywyuysfp)
How to fix - Sourcetree Device not configured
Tags: howto, sourcetree, mac, webdev
Published: 2022-10-25 00:00:08

If you are using SourceTree on Mac, there is high possibility that you might have encountered this issue when trying to push a new release. This mostly happens when you update your SourceTree or Mac OS.

It can be easily resolved with the following steps:

### Step # 1

Go to your source code folder in your `local` and type the following command in console:
```bash
git config credential.helper
```

You should see `osxkeychain`

### Step # 2

Next, run the following command:
```bash
git config credential.helper sourcetree
```

This command will change the Sourcetree config for credentials to `sourcetree`

and now if you type command `git config credential.helper` your should see `sourcetree` instead.

That's it.

If you try again pushing the new release branch and it should work this time.

Happy coding!
TIL Phoenix Live View #1
Published: 2022-10-24 23:46:44

With Phoenix LiveView 0.18 now you can define attributes to components

```heex
attr :name, :string, required: true
# or define with default value
# attr :name, :string, default: "World"

def hello(assigns) do
  ~H"""
    <h1>Hello #{@name} </h1>
  """
end
```

But the most interesting part is that you can also define with a Schema or Struct, helping you with autocomplete (if your editor supports) and [compile warns](https://hexdocs.pm/phoenix_live_view/Phoenix.Component.html#attr/3)

```heex
attr :user, User, required: true

def hello(assigns) do
  ~H"""
    <h1>Hello #{user.name}</h1>
  """
end
```

You can find more information about [here](https://hexdocs.pm/phoenix_live_view/Phoenix.Component.html#module-attributes)
Cómo usar Acentos y Ñ en teclado inglés con AutoHotkey
Published: 2022-10-24 23:10:23

Caracteres en español usando CapsLock
Presionar CapsLock mas la vocal para acentuarla
Para la ñ se puede usar la n o la tecla ; (porque ahí estaba la ñ originalmente)
Para la ¿ usamos CapsLock y la tecla que tiene actualmente el ?

https://gist.github.com/eduardoarandah/512a949e1d6e57d90bd1260ba3bfb062

```
; mapear la n como ñ
CapsLock & n::
If GetKeyState("Shift", "P")
    Send Ñ
Else
    Send ñ
return 

; mapear la ; como ñ
CapsLock & `;::
If GetKeyState("Shift", "P")
    Send Ñ
Else
    Send ñ
return 

; mapear la ? como ¿
CapsLock & /::¿

; mapear las vocales
CapsLock & a::
If GetKeyState("Shift", "P")
    Send Á
Else
    Send á
return

CapsLock & e::
If GetKeyState("Shift", "P")
    Send É
Else
    Send é
return 

CapsLock & i::
If GetKeyState("Shift", "P")
    Send Í
Else
    Send í
return 

CapsLock & o::
If GetKeyState("Shift", "P")
    Send Ó
Else
    Send ó
return 

CapsLock & u::
If GetKeyState("Shift", "P")
    Send Ú
Else
    Send ú
return 
```
Sign In Notes
Published: 2022-10-24 23:05:59

-Add column for user + password onto existing table with
``` rails g migration AddPasswordDigestToUsers ```  creates file in db migrate and names correctly
-go to that file and under def change, ```add_column :users, :password_digest, :string``` can add and remove columns under method def change, with multiple lines, or can create diff migration for each change you want to make
-run with ```rails db:migrate```, will look in folder and run the unrun ones, adds our Password Digest Column to User model
-now we are given 2 attributes on user model, .password and .passwordconfirmation, so now we can call those 2 methods as if they were columns (they're not), makes sure they match, jumble them in secure way and store in string column. this way we don't store plaintext password
-in order to do all this, need to write in User model **has_secure_password** (a declaration we can make thanks to gem in Gemfile, defines .password and .passwordconfirmation attributes automatically and takes care of storing things in secure way IF you have column called password_digest, which we now do)
TypeError: this.userRepository.signUp is not a function
Tags: nestjs
Published: 2022-10-24 22:47:04

I'm new on nest js and I encountered this error while developping login service ``import { Injectable } from '@nestjs/common';
import { UserRepository } from './user.repository';
import { InjectRepository } from '@nestjs/typeorm';
import { AuthSignUpDto } from './dto/auth-signup.dto';

@Injectable()
export class AuthService {
  constructor(
    @InjectRepository(UserRepository)
    private userRepository: UserRepository,
  ) {}
  async signUp(authSignUpDto: AuthSignUpDto): Promise<string> {
    return this.userRepository.signUp(authSignUpDto)
  }
}`
`
Type-safe object builder in TS
Tags: typescript, oop
Published: 2022-10-24 22:31:05

Long story short - object builder pattern in TypeScript :)

```typescript
type Builder<Source extends object, Target> = {
  [Prop in keyof Required<Source>]: (value: Source[Prop]) => Builder<Source, Target>
} & {
  build(): Target
}
```

This type defines an object that will have methods of the same name as the `Source` object plus the `build()` method.

Here's an implementation thereof using Proxy:

```typescript
function clone<S, T>(source: S): T {
  return JSON.parse(JSON.stringify(source))
}

function builder<
  Source extends object,
  Target
>(
  source: Source,
  convert: (source: Source) => Target = clone
): Builder<Source, Target> {

  const proxy = new Proxy<Builder<Source, Target>>(
    source as any, {
    get(target, prop: string, receiver) {
      if (prop === 'build') return build
      else return (value: any) => setter(
        prop as keyof Source, value
      )
    }
  });

  function build(): Target {
    return convert(source)
  }

  function setter(
    prop: keyof Source,
    value: any
  ): Builder<Source, Target> {
    source[prop] = value
    return proxy
  }

  return proxy
}
```

And here's how you could use it:

```typescript
const b = builder(
  {
    x: 1,
    y: 'Hello'
  },
  source => ({
    o1: { a: source.y, b: source.x },
    o2: { p1: source.x, p2: source.y },
  })
)

console.log(b.x(3).y('2').build())
```

Each call to the builder methods is type-safe so it should be easy to work with it :)


Happy coding!
Day 642 : Babylon
Tags: hiphop, code, coding, lifelongdev
Published: 2022-10-24 22:04:05

_liner notes_:
- Saturday : Kind of had a late start to finishing up the radio show. I woke up like at 6am to do some work and started getting a bunch of Twitter notifications. Looks like the recorded talk I did for CityJS Lagos was played. Got a lot of good feedback and I appreciate everyone that checked it out. I finished up some prep work for the radio show and then I went back to sleep. Woke up again, got ready and headed to the station. Had a good time doing the show. The recording is up at https://kNOwBETTERHIPHOP.com

![Radio show episode image of John Bolton standing in front of a map holding a notepad with the words October 22nd 2022 Dos Minutos](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2dde2fikyz50lt1gje0k.jpg)

- Sunday : Did the https://untilit.works cyphers. Got a quite bit done. I actually figured out a blocker I was having on a side project and was able to make a bunch of progress on it. I've also been doing a bunch of research, reading documentation and watching some videos on WebXR. Ended the night watching up with "Atlanta" and "The Walking Dead". Not a bad day.

- Professional : Since the last couple of weeks have been a rush to finish some last minute project, I finally got back to some work in my backlog. Had a couple of meetings. Did some research on WebXR. Wrote up an initial draft for an update to a blog post.

- Personal : So, got a notification that my Meta Quest Pro has been shipped and I should be getting it tomorrow. Looking forward to checking it out. Really looking to dive more into WebXR so I can do more talks and workshops next year. The quick demo prototype I'm working on for my side project is coming together. There's different levels of interaction that people can have with the site and I almost have everything "working".

![A dirt path through a forest on a sunny day in Papudo, Chile where some of the trees have their barks stripped.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n5zpf21dbrrn0lwhvbmz.png)

Going to work on the broadcast/streaming part of my side project, then I want to finish watching an intro course on WebXR. I think I've settled on using Babylon.js for the coding part. Then I want to watch the new "Dr. Who" and maybe some anime if I have time.

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube UxdazAGsTFA %}
Creating Seed Data in AWS Amplify/Studio
Tags: aws, beginners, webdev, tutorial
Published: 2022-10-24 21:53:23

Hey everyone!

I just started trying to use AWS Amplify to deploy one of my old projects and boy did I have some trouble haha.

AWS Amplify uses GraphQL or allows use to use a REST API. I wanted to learn more about GraphQL so I went with that route for my personal project. Understanding the basic concepts of GraphQL were not too difficult and luckily AWS has plenty of documentation to help with that as well. Here's a link to one of the documentation that helped me a lot: https://docs.amplify.aws/lib/graphqlapi/getting-started/q/platform/js/

Once you set up your project and your backend, you may want to have some seed data. For my project specifically, I wanted to add in restaurants for my "Food Journal" project. A nice visual way to set that up is by using Amplify Studio. With your backend schema already set up, you can go to the page below:


![AWS Amplify Backend Environment](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f6ksb97xrkk1upjqoirj.png)

Once you're at the backend environment, click "Actions" and then "Launch Studio." This should take you the following page:

![AWS Amplify Studio](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/im1g00mb8nnb67yolb43.png)

Navigate to the "Content" link under "Manage" in the sidebar on the left.

Once there, you can click on "Action" to "Auto Generate Data" (when you want to seed more than one instance with fake data) or click "Create (table name)".

![Seed your data!](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4czdvycnpkdyrsawmim6.png)

You should now be able to seed your data!

Hope this helped!
Capture Dev Community Articles in Clean Markdown with this Siri Shortcut
Tags: shortcuts, automation, ios, md
Published: 2022-10-24 21:41:22

Updated `10242022-162818`

- [GitHub Issue](https://github.com/extratone/i/issues/283)
- [**RoutineHub Page**](https://routinehub.co/shortcut/13238)
- [Gist](https://gist.github.com/extratone/bbb09be7c07175a66a46a0aadc53964d)
- [David Blue’s RoutineHub Library](drafts://open?uuid=CA94DF33-CAB9-40A0-836E-806225D5B600)
- [iCloud Share Link](https://www.icloud.com/shortcuts/7d943edbbcd64832be2fd0f13e00229d)
- [Working Copy](working-copy://open?repo=i&path=shortcuts&mode=content)
- [Source Repo File](https://github.com/extratone/i/blob/main/shortcuts/Drafts/DevCommunityArticle-Drafts.shortcut)
- [WTF](https://davidblue.wtf/drafts/023EB395-FA1A-4C88-A965-7E810D238ADB.html)
- [Things](things:///show?id=UhWuvoSJpuYKnYJKsqCZxo)

---

## Social

- Telegram

---

## Capture a dev.to article in clean markdown via API.

This shortcut uses [the Dev.to API's `getArticleByPath` endpoint](https://developers.forem.com/api/v0#tag/articles/operation/getArticleByPath) to capture an individual article's data and (markdown-formatted) body contents into a new [Drafts](https://getdrafts.com) draft, formatted (by default) as such:

```
# title

- [**Source**](url)
- Byline: [byline](profile)
- Published: `davodtime`

---

cover

md
```

By default, it also captures the entirety of the API response in a [Data Jar](https://apps.apple.com/us/app/data-jar/id1453273600) jar specified at install. 

---

### Example Output

- [GitHub Gist](https://gist.github.com/extratone/bbb09be7c07175a66a46a0aadc53964d)

```md
# Meme Monday 🎃

- [**Source**](https://dev.to/ben/meme-monday-1o5g)
- Byline: [Ben Halpern](https://dev.to/ben)
- Published: `10242022-074045`

---

[![Meme Monday 🎃](https://res.cloudinary.com/practicaldev/image/fetch/s--tZUC89vk--/c_imagga_scale,f_auto,fl_progressive,h_420,q_auto,w_1000/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/914owpwnth5neaasd5a7.png)](https://dev.to/ben/meme-monday-1o5g)

Welcome to another **Meme Monday** post! Today's cover image comes from [last week's thread](https://dev.to/ben/meme-monday-1299).

DEV is an inclusive space! Humor in poor taste will be downvoted by mods.
```
Is it possible to do accessibility testing using Appium?
Tags: appium, a11y, testautomation, mobiletesting
Published: 2022-10-24 21:34:00

---
title: Is it possible to do accessibility testing using Appium?
published: true
description: Are there any tools I can use to do a11y testing using Appium?
tags: #appium, #accessibility, #a11y, #testautomation, #mobiletesting
cover_image: https://images.unsplash.com/photo-1483478550801-ceba5fe50e8e?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1740&q=80
published_at: 2022-10-24 21:34 +0000
---
Hi all :wave:, I would like to perform an general accessibility audit of the app that I’m testing using Appium. Is it possible for me to write a test that navigates to each screen of the app, scans the screen, and tells me things like any touch targets that are below 48px, contrast issues, missing content descriptions, etc.?

I was looking into [Axe Core for WDIO](https://github.com/dequelabs/axe-core-npm/tree/develop/packages/webdriverio) but not sure if something like what I need exists for Appium to work with native or a hybrid app.

Thank you so much for your help! :slightly_smiling_face:
How to Open Android emulator without Android Studio
Tags: android, cli, mobile
Published: 2022-10-24 20:51:43

Let's see how to open Android Virtual Device (AVD) directly from the terminal without opening Android Studio!

First, we need to get our Android SDK location, [here is a link to help you find it](https://stackoverflow.com/questions/25176594/android-sdk-location). For me (MacOS) is: `/Users/<user>/Library/Android/sdk`.

Now Open the `.rc` file in your favorite editor:

```bash
# if you use ZSH
nano ~/.zshrc
# if you use BASH
nano ~/.bashrc
```

Add this line at the final of the file (your Android SDK path with a `/emulator:$PATH` at the end):

```bash
  export PATH="/Users/<your-user-name>/Library/Android/sdk/emulator:$PATH"
```

Save the file and go back to the terminal and reload the new configuration:

```bash
source ~/.zshrc
#or
source ~/.bashrc
```

Now you can get it running from any location:

```bash
emulator -avd EmulatorName
```

> To see all available emulators just run: `emulator -list-avds`.

Like this? [Check my blog!](https://tuliocalil.com.br/)
Follow me on [Twitter](https://twitter.com/Tuliocalil)