teleren/devto huggingface dataset:
Productivity tip that you may not hear about
Tags: vim, career, beginners, productivity
Published: 2023-01-13 21:10:00

---
title: Productivity tip that you may not hear about
published: true
description: 
tags: #vim, #career, #beginners, #productivity
published_at: 2023-01-13 21:10 +0000
---
Most of us - developers - think about productivity. We like new tools and fancy scripts that do tedious and repetitive work instead of us.

It will not be a post about one of the above. Instead, I’d like to share my idea that increased my productivity more than any tool recently.

I mean, vim.

Yeah, I know what you may think - another vim-believer who could not exit the editor.

But this is not about the editor but about vim-mode in other editors (so you can feel like you are using a legendary tool, and at the same time, you know how to exit it 🙂).

But seriously, this changes a lot in my everyday life. During my work day, I use 4 editors: Xcode, IntelliJ, Android Studio, and Visual Code Studio. Even though I use them daily, I was clunky with editing code inside each.

I could learn some shortcuts but could not see the point. Most of them are valid only in one editor (except ctrl+c and ctrl+v), and when you switch to another, you have to learn a different key combination, and those really useful do not exist at all (like change inside ( or { or [ or ” - I start using vim-slang 🙂).

This is where vim key bindings start to shine. You learn once and use it everywhere. For me, it was a work-life changer. Now I can use the same shortcuts in all of my editors.

Learning vim-binding speeds up my code editing and moving around a file. Since I’ve started using vim-mode, I rarely use a mouse/touchpad to move a cursor around or highlight text.

In the beginning, it was a nightmare. I went all the way into vim-mode, and I’ve changed mode in every editor I use. The first week was a Google-Driven-Editing. I had to check almost everything on the internet.

But after one/two weeks, it started paying off. It is an excellent feeling when your fingers can catch up with your thoughts.

I can’t imagine going back. When I begin to use dd, yy, ci(, p, etc. every day in every editor, there is no turning back.
Give it a try, even if you use only one editor.
Learning vim key bindings is just the beginning. When you go deep into this world, you will learn about registers, vim-plugins, etc.
I am still learning. You can only imagine what you can do after you try.
We're on ruby.social
Tags: meta, ruby, fediverse, mastodon
Published: 2023-01-13 21:08:42

The best of Ruby content on DEV Community is now available via Toot 🦣

We've syndicated our [@The_Ruby_Dev] (https://www.twitter.com/the_ruby_dev) Twitter feed  with [@devcommunity@ruby.social](https://ruby.social/@devcommunity) using [moa.party](moa.party).

{% embed https://ruby.social/@devcommunity %}

Follow us there from anywhere in the Fediverse. Happy Rubying!
Entendendo e utilizando Coleções Codificadas (Keyed Collections) em JavaScript
Tags: beginners, javascript, productivity
Published: 2023-01-13 21:07:24

É um final de semana, e você está se preparando para um grande churrasco que fará em sua casa. Ao observar o que falta, percebe que necessita de sal grosso, e rapidamente se dirige ao mercado. Ao pegar o produto, nota seu valor, e junto dele observa uma coisa, seu código de barras. Se dirigindo ao caixa, a atendente escaneia o código e por ele,podem ver qual o valor computado.

Existe uma similaridade entre o caso acima e as Coleções codificadas. As Coleções são responsáveis por armazenar o valor de um elemento, utilizando chaves(menos um caso que citaremos mais a frente mas que faz parte dessa coleção). Essas chaves são geralmente valores numéricos ou de texto, e podem ser usadas para acessar e organizar os elementos na coleção, assim como o código de barras serve como código do produto que o trás a tela da atendente.

As Coleção codificada( ou como descrito no título em seu nome original:Keyed Collections), atuam de maneira semelhante aos Objetos, mas algumas Coleções tem algumas funções adicionais,visto que foram criadas para ser uma alternativa aos `Objects` e `Arrays`.

```
let events = new Set();
let event1 = { type: "concert", day: "Saturday" };
let event2 = { type: "book launch", day: "Wednesday"};
let event3 = { type: "conference", day: "Thursday"};
let event4 = { type: "meet up", day: "Monday" };

events.add(event1);
events.add(event2);
events.add(event3);
events.add(event4);
```
Podemos ver no exemplo acima que foi se criada uma Coleção parecida com os `Arrays`, onde foi criado um conjunto no `new Set`, e usado `Add` para empurrar os valores "encaixotados".


Dentro dessa Coleção temos o Set que é uma coleção de elementos únicos, sem chaves associadas. Ele não permite elementos duplicados, e os elementos são acessados ​​por seus valores, e não por suas chaves. Ele é útil para armazenar conjuntos de valores sem se preocupar com a ordem.



Já o `Map`permite que você armazene elementos com chaves únicas, e os elementos são acessados ​​por suas chaves, em vez de seus valores. Você pode querer criar chaves que não sejam strings, ou está procurando flexibilidade sem depender de uma biblioteca externa como `lodash`(que armazena métodos como has(), values(), delete()).

```
let map = new Map([
    ["nome", "João"],
    ["idade", 25]
]);
console.log(map.get("nome")); // "João"
console.log(map.get("idade")); // 25

```


Em resumo, as Keyed Collections em JavaScript são uma estrutura de dados versátil e poderosa para trabalhar com coleções codificadas, de diversas maneiras.

Obrigado por ler!!!
Chhalaang Sapno Ki
Tags: chhalaang
Published: 2023-01-13 20:59:08

Chhalaang Sapno Ki is the new upcoming Hindi Language Sony TV Serial. 
The Serials Cast Megha Ray, Kashish Paul Duggal , Simran Tomar and

[Chhalaang Sapno Ki](https://chhalaangsapnoki.com/)
TIL: How to CDK Diff Your Entire App
Tags: todayilearned, aws, cdk, cloudformation
Published: 2023-01-13 20:58:51

---
title: TIL: How to CDK Diff Your Entire App
published: true
description: Thanks to the internet, I learned how to diff all of the resources in a CDK project.
tags: todayilearned, aws, cdk, cloudformation
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2023-01-13 20:55 +0000
---

If you use the [AWS CDK](https://aws.amazon.com/cdk/) to deploy resources, you may also likely use the [Pipelines construct](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.pipelines-readme.html) to deploy. Let's say you do, and you run a `cdk diff` against your app prior to committing. It's awfully disappointing as it will only show you changes to the encasing pipeline. 
  However thanks to this [fantastic answer](https://stackoverflow.com/questions/75099227/using-cdk-diff-to-diff-resources-wrapped-in-a-pipeline/75100254#75100254) from @fedonev on StackOverflow, I learned that there is [special syntax](https://docs.aws.amazon.com/cdk/v2/guide/cli.html#cli-stacks) within the CDK CLI that allows you to wildcard the stack you would like a command to run against. 
  > You may also use wildcards to specify IDs that match a pattern.
    ? matches any single character
    * matches any number of characters (* alone matches all stacks)
    ** matches everything in a hierarchy

So running
  ```
  cdk diff '**'
  ```
  Will diff not only diff the pipeline stack, but all the stack's within your application. 
  
![The more you know](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2ese8dujz0isy0lidcho.gif)

---
Find me on [Mastodon](https://mstdn.social/@therealdakotal) | [LinkedIn](https://www.linkedin.com/in/dakota-lewallen/) | [Github](https://github.com/IamFlowZ) | [Substack](https://dakotalewallen.substack.com)
VSCodeでF#.NETの開発環境構築する方法を解説
Published: 2023-01-13 20:53:06


## 事前準備

### [ポータブル.NETプロジェクト〜開発プロジェクト毎に隔離された異なる.NET Framework SDKバージョンをインストールする方法を解説](https://dev.to/ken_okabe_jp/potaburunetpuroziekuto-kai-fa-puroziekutomei-nige-li-saretayi-narunet-framework-sdkbaziyonwoinsutorusurufang-fa-wojie-shuo-5d2n)

VisualStudioCodeが適切にインストールされているとき、

プロジェクトのルートディレクトリから

```sh
$ code ./
```

とすることでVS Codeを立ち上げることが出来ます。

![image](https://user-images.githubusercontent.com/1316994/212236874-1a274bd7-6749-4144-9112-0cdd4bd7ed19.png)

Extensionsから`net` を検索

![image](https://user-images.githubusercontent.com/1316994/212224528-93ab558a-1254-4849-8770-aaa3d12ed8b2.png)

.NET Extension Packをインストール。Microsoft公式提供です。

![image](https://user-images.githubusercontent.com/1316994/212224826-39ce9395-b802-4e57-8c44-7b6d1fc6b59d.png)

F#開発に必要なのはこのなかで

Ionide for F#ですが、.NET Extension Packに含まれています。

![image](https://user-images.githubusercontent.com/1316994/212225124-2c63f847-a98c-4106-a487-2d926bc1e329.png)



場合によっては必要ないかもしれませんが、VSCodeが（ターミナルから）起動している文脈に関わらず、適切にローカルディレクトリの相対PATHで`dotnet`コマンドが使えるように、VSCodeのSettingで`dotnet`で検索し、

![image](https://user-images.githubusercontent.com/1316994/212236496-40b4b2d1-1246-407f-8698-a76da57a647f.png)

`./.net/`とSDKの相対ルートPATHを指定しておきます、



https://learn.microsoft.com/ja-jp/dotnet/fsharp/get-started/get-started-vscode

カレントディレクトリがプロジェクトルートであることを確認した上で、

`dotnet` コマンドの[テンプレート機能](https://learn.microsoft.com/ja-jp/dotnet/core/tools/dotnet-new?view=aspnetcore-6.0)を利用して、F#プロジェクトのコンソールプログラムを作成します。

```sh
$ dotnet new console -lang "F#"
```

![image](https://user-images.githubusercontent.com/1316994/212227020-68d8ed08-5690-4f92-a184-203c0bf6a102.png)

結果、以下のようなプロジェクトになります。

```sh
fs-test
├── bin
│   └── Debug
├── fs-test.fsproj
├── .net
│   ├── dotnet
│   ├── host
│   ├── LICENSE.txt
│   ├── packs
│   ├── sdk
│   ├── sdk-manifests
│   ├── shared
│   ├── templates
│   └── ThirdPartyNotices.txt
├── obj
│   ├── Debug
│   ├── fs-test.fsproj.nuget.dgspec.json
│   ├── fs-test.fsproj.nuget.g.props
│   ├── fs-test.fsproj.nuget.g.targets
│   ├── project.assets.json
│   └── project.nuget.cache
└── Program.fs
```

![image](https://user-images.githubusercontent.com/1316994/212235013-737a087c-560b-484f-8d04-367f6987953c.png)

`Program.fs` に、たとえば以下のようなコードを追加して、

```fsharp
let f = fun a -> fun b -> a + b
```

![image](https://user-images.githubusercontent.com/1316994/212235885-a74fe965-729e-4845-958c-5d7c221fbdce.png)

結果、自動的に、TypeAnotation（型注釈）が表示されるようになれば成功です。

初期設定では、異なる表示になると思いますが、好みで上手く調整してみてください。

コードを実行するには、プロジェクトのルートディレクトリで、

```sh
$ dotnet run                 
Hello from F#
```
🧠 7 Sources to Keep the Entrepreneurship Mindset
Tags: entrepreneurship, podcast, books, productivity
Published: 2023-01-13 20:42:58

> The only way to achieve success is to keep moving forward. If you're not passionate about your business, it'll show.

These were the outcomes I've reached after my entrepreneurship journey into the world of hyper casual games, ad-supported free mobile games consumed just like snacks.

It all started with a simple idea: my friend and I were college juniors looking to stand out in a highly competitive software industry. We aimed to improve our portfolios by co-creating a project, but little did we know that our simple project would turn into a full-fledged startup.

Then it got more and more serious. The idea of developing a portfolio project evolved into building our own startup.

To prepare ourselves for success, we went all-in.  Hence, we created a new Telegram group, and a Discord server and set up a Trello board. We surrounded ourselves with the entrepreneurial mindset by reading related books and held weekly meetings where we discussed our readings and talked about everything entrepreneurship.

🎧 Back then, these were my favorite podcasts: 

1. [**Startup Therapy**](https://www.startups.com/community/startup-therapy): The duo discusses struggles every entrepreneur faces and how they overcame those in their lives.
2. [**How I Built This with Guy Raz**](https://open.spotify.com/show/6E709HRH7XaiZrMfgtNCun): This one is great because the stories are relatable and thus engaging.
3. [**Entrepreneurs on Fire**](https://www.eofire.com/podcast/): It's more on the motivation and inspiration side of things and an entrepreneur just can't have enough of those things.

📚 Here are some of the books we've read, and I can recommend: 

1. **Built to Sell by John Warillow**: Explains how entrepreneurs should build their companies to make sure they're sellable for the highest amount by basing their success on a well-defined process instead of a person.
2. **The Lean Startup by Eric Ries**: Delves into building a lean company right from the start.
3. **7 Habits of Highly Effective People by Stephen Covey**: This book offers guidance on how to be more effective in both personal and professional life.
4. **How to Win Friends and Influence People by Dale Carnegie**: A classic. Teaches how to communicate effectively and interact with others to build relationships and achieve success.

I'll be writing about them in detail in the coming weeks, stay tuned.

As trend-savvy entrepreneurs, we were constantly searching for the next big thing in the startup world. And then, it hit us: mobile gaming was booming, and hyper casual games were leading the charge.

We saw a golden opportunity and were determined to seize it. This meant shifting our focus and diving headfirst into the world of mobile gaming. But, how could we turn this vision into a reality? Let's explore our journey as we take on the challenge and bring our idea to life.

Let's take a look at that in the next article.

_Got feedback? Anything to share? Don't hesitate to comment!_
Arch Linuxのインストールが超かんたんになっている ~ Arch Installer
Published: 2023-01-13 20:39:40

## Archはそもそもインストールすることが難しかった

![image](https://user-images.githubusercontent.com/1316994/190233766-41b131b1-d600-479c-ba8a-57d81eb72ab5.png)

![image](https://user-images.githubusercontent.com/1316994/190233180-b84c6b85-1b53-4651-864c-67f06ae04360.png)

![image](https://user-images.githubusercontent.com/1316994/190236965-252c710e-fa53-44cd-b6e5-eb1ede29f8b3.png)

[インストールガイド](https://wiki.archlinux.jp/index.php/%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB%E3%82%AC%E3%82%A4%E3%83%89) (難しい)

## 最近公式からインストールスクリプトが公開

![](https://github.com/archlinux/archinstall/raw/master/docs/logo.png)

[Arch Installer](https://github.com/archlinux/archinstall)



記事を書こうと思っていたら、すでに書いている人がいた。

[Installing Arch Linux Using archinstall Automated Script [Complete Guide]](https://www.debugpoint.com/archinstall-guide/)

GUIデスクトップ環境のインストールまで世話をしてくれて、自分の場合はGnomeであるが再起動したらスムーズにGUIデスクトップ環境になった。

基本、鬼門はWifiネット環境の構築なのだが、足場となるイーサネットLAN環境がなくても、今どきはスマホのテザリングでUSBネット接続が可能なので、それをLAN接続代わりにして、あとはスクリプトでGUIデスクトップまで持っていくと、すでにGUIでWifi設定すればいいだけになっている。

あと、通常はGRUBブートの設定がかなり難解なのだが、これはLinuxカーネルのスタブ起動みたいなやつを直接設定してくれており、GRUBを介さずに速やかに起動する構成になるのは素晴らしかった。GRUBフリー。
Adding a swapfile in #Linux
Tags: rockylinux, linux, swap, howto
Published: 2023-01-13 06:43:53

I usually go with a swapfile instead of a swap partition. So, during installation I don't create that partition, and instead I add the swapfile later.

So, here's how I do it.

First, I do everything as `su`:

```bash
~$ su -
Password:
~# 
```

&nbsp;

Create the directory and the swapfile. I prefer the path `/var/vm/`. Others may prefer `/var/swap/`. To create the swapfile - you can use `dd`, or `fallocate` if you prefer that one. I use `dd`.

The size of the swapfile may vary on your needs. I usually go with quite a big one, so in case I want to hibernate - there will be enough room. So, on an old laptop with 3G of RAM - I'll go with 4G.

```bash
~# mkdir /var/vm && cd /var/vm
vm# dd if=/dev/zero of=./swapfile0 bs=1M count=4096 status=progress 
4237295616 bytes (4,2 GB, 3,9 GiB) copied, 45 s, 94,2 MB/s
4096+0 records in
4096+0 records out
4294967296 bytes (4,3 GB, 4,0 GiB) copied, 45,6187 s, 94,1 MB/s
```

&nbsp;

And set the permissions to 600:

```bash
vm# chmod 600 swapfile0
vm# ls -l swapfile0
total 4194304
-rw-------. 1 root root 4294967296  5 jan 03.14 swapfile0
```

&nbsp;

Then make it an actual swapfile, turn the swap on, and check the status.

```bash
vm# mkswap swapfile0
Setting up swapspace version 1, size = 4 GiB (4294963200 bytes)
no label, UUID=<unique hash string>
vm# swapon swapfile0
vm# swapon -s
Filename            Type        Size    Used    Priority
/var/vm/swapfile0   file        4194300 0       -2
```

&nbsp;

To make it mount on boot, we need to add it to `/etc/fstab`. So, with your favorite editor (eg. vim, vi, nano, etc)…

```bash
vm# vim /etc/fstab
```

&nbsp;

And add these lines to the end of the file:

```txt
# Swapfile0
/var/vm/swapfile0   none    swap    defaults    0 0
```

- - -

Using the `free` command will get you information on how much swap you have and are using.

```bash
$ free -h
              total        used        free      shared  buff/cache   available
Mem:          2,9Gi       1,3Gi       493Mi       140Mi       1,1Gi       1,3Gi
Swap:         4,0Gi       132Mi       3,9Gi
```

- - -

## SELinux

To make sure it works fine with SELinux, we need to set the correct context to the file: `'swap_t'`.

```bash
~# semanage fcontext -a -t swapfile_t '/var/vm/swapfile0'
~# restorecon /var/vm/swapfile0 
~# ls -lZ /var/vm/
total 4194304
-rw-------. 1 root root unconfined_u:object_r:swapfile_t:s0 4294967296  5 jan 03.17 swapfile0
```

- - -

## Tuning

To tune the cache so it doesn't swap too much, you can add these settings to `sysctl.conf`. In some systems/distros, you can add them directly there. In others you make an xtra file that will be sourced.

On my Rocky Linux system, I use an xtra file, like this:

```bash
~# vim /etc/sysctl.d/90-swappiness.conf
```

&nbsp;

Then add this content:

```conf
#
# /etc/sysctl.d/90-swappiness.conf
#
# Description:
#     sysctl.conf settings for swap
#

vm.swappiness=10
vm.vfs_cache_pressure=40

vm.dirty_background_ratio=10
vm.dirty_ratio=15 
```

&nbsp;

Now all is good. :)

- - -

_// Happy hacking… 👍_

· Eric
Encapsulation, Inheritance, and Polymorphism: Understanding the Building Blocks of Object-Oriented Programming
Tags: oop, programming, computerscience
Published: 2023-01-13 20:32:39

Object-oriented programming (OOP) is a programming paradigm that uses objects and classes to represent real-world concepts. It is based on three key principles: encapsulation, inheritance, and polymorphism. These concepts are fundamental to the design and implementation of OOP languages such as Java, C++, and Python. In this article, we will use the analogy of building a house to explain these concepts and how they work together to create robust, efficient, and maintainable code.

> Encapsulation

Encapsulation is the practice of keeping the internal workings of an object hidden from the outside world. In the context of building a house, encapsulation can be compared to building walls around the house. The walls keep the inside of the house private and separate from the outside world. Similarly, in programming, encapsulation refers to keeping the internal state and behavior of an object hidden from the outside world, allowing for greater control and security.

> Inheritance

Inheritance is the ability of an object to inherit properties and methods from a parent object. In the context of building a house, inheritance can be compared to building a house with a foundation. The foundation is the base upon which the house is built, and it supports the structure of the house. Similarly, in programming, inheritance allows an object to inherit properties and methods from a parent object, providing a foundation for the new object to build upon.

> Polymorphism

Polymorphism is the ability of different objects to be treated as a single type, even though they may have different properties and methods. In the context of building a house, polymorphism can be compared to building a house with different rooms. Each room serves a different purpose, but they all have a common layout and design. Similarly, in programming, polymorphism allows different objects to be treated as a single type, even though they may have different properties and methods. This allows for greater flexibility and efficiency in code.

> Conclusion

Encapsulation, inheritance, and polymorphism are the building blocks of object-oriented programming. They work together to create robust, efficient, and maintainable code. Encapsulation provides security and control, inheritance provides a foundation for building new objects, and polymorphism provides flexibility and efficiency. Understanding these concepts and how they work together is essential for any programmer working with OOP languages.
Want better keybinding parity between micro and Sublime Text?
Tags: tutorial, sublimetext
Published: 2023-01-13 20:28:59

I went through the key-bindings in [Micro](http://micro-editor.github.io) (which use different modifier keys) and added them to [Sublime Text](http://sublimetext.com):

```json
    { "keys": ["ctrl+s"], "command": "save", "args": { "async": true } },
    { "keys": ["alt+up"], "command": "swap_line_up" },
    { "keys": ["alt+down"], "command": "swap_line_down" },
    { "keys": ["ctrl+left"], "command": "bol" },
    { "keys": ["ctrl+right"], "command": "eol" },
    { "keys": ["ctrl+o"], "command": "prompt_open" },
    { "keys": ["ctrl+z"], "command": "undo" },
    { "keys": ["ctrl+y"], "command": "redo" },
    { "keys": ["ctrl+c"], "command": "copy" },
    { "keys": ["ctrl+x"], "command": "cut" },
    { "keys": ["ctrl+d"], "command": "duplicate_line" },
    { "keys": ["ctrl+v"], "command": "paste" },
    { "keys": ["ctrl+a"], "command": "select_all" },
    { "keys": ["ctrl+b"], "command": "toggle_terminus_panel" },
    { "keys": ["ctrl+q"], "command": "close" },
    { "keys": ["ctrl+up"], "command": "move_to", "args": { "to": "bof" } },
    { "keys": ["ctrl+down"], "command": "move_to", "args": { "to": "eof" } },
    { "keys": ["alt+backspace"], "command": "delete_word", "args": { "forward": false, "sub_words": true } },
    { "keys": ["ctrl+f"], "command": "show_panel", "args": { "panel": "find", "reverse": false } },
    { "keys": ["alt+shift+f"], "command": "show_panel", "args": { "panel": "find_in_files" } },
    { "keys": ["ctrl+t"], "command": "show_overlay", "args": {"overlay": "goto", "show_files": true} }, // Hurts transpose, but never use.
    { "keys": ["ctrl+e"], "command": "show_overlay", "args": {"overlay": "command_palette"} },
```