teleren/devto huggingface dataset:
Fetch and display the latest git commit hash in your iOS apps
Tags: ios, git, xcode
Published: 2021-11-25 21:34:12

---
title: Fetch and display the latest git commit hash in your iOS apps
published: true
date: 2021-11-25 21:17:54 UTC
tags: ["ios", "git", "xcode"]
canonical_url: https://tarikdahic.com/posts/fetch-and-display-the-latest-git-commit-hash-in-your-ios-apps/
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dcx91di6fs6yppdpdoqk.jpg
---

If you want to know from what exact commit your app is built you can include the latest git commit hash to the place where you display the app version. I like to call that generated hash **“revision”** or in short **“rev”**.

Displaying this can be useful when you are distributing internal versions of your apps to QA engineers and you want to know on what app version they are testing. While the changes are coming in on development branches we don’t increase version or build numbers, we follow the revision value and always know what version is in use.

In this article I will explain how to fetch the latest git commit hash in Xcode and display it in the iOS app.

## Fetching the latest git commit hash

The procedure I will describe adds a new row to your `Info.plist` file with specified key and sets the value to the short git commit hash.

The first step is to go to your target’s **Build phases** setting and add a new **run script phase**. The “_Run script_” action will be on the bottom and you need to move it above the “_Copy bundle resources_” action.

When you move it, you can paste this code for the script:

```bash
GIT=`xcrun -find git`
GIT_REV=`${GIT} rev-parse --short HEAD`
/usr/libexec/PlistBuddy -c "Set :REVISION ${GIT_REV}" "${SRCROOT}/{{path-to-your-info.plist-file}}"
```

In the script above we rely on **PlistBuddy** to set the key `REVISION` and the value of the latest git commit hash to the app’s `Info.plist` file. **PlistBuddy** is a macOS utility that helps us to manage plist files. You can read more about it [here](https://www.manpagez.com/man/8/PlistBuddy/) or you can type `/usr/libexec/PlistBuddy -h` in your terminal to find out more of what it can do.

Now, when you have run the build process, the script that we added should’ve inserted a new entry in your `Info.plist` file and we can proceed to displaying it.

## Displaying the revision

To display the revision we just need to fetch our `Info.plist` and provide a key to read the value from it:

```swift
let revision = Bundle.main.object(forInfoDictionaryKey: "REVISION") as? String 
```

In Objective-C we would do it like this:

```objc
NSString *revision = [NSBundle.mainBundle objectForInfoDictionaryKey:@"REVISION"];
```
What are you guys thankful for?
Tags: watercooler, discuss, thanksgiving, holiday
Published: 2021-11-25 21:15:52

Welcome back to another post! Today is Thanksgiving, which means that it's time to reflect on the programming resources that you are thankful for. Your response can include:

* Programming languages (Python, JavaScript, Java, etc.)
* Programming tools (GitHub, Stack Overflow, Docker, etc.)
* Your favorite feature of a specific programming language (variables, functions, modules, keywords, etc.)
* Your projects

Enter your response in the comments section below.

---

Anyways, that's all I have for now, and I hope you guys have a safe and happy thanksgiving!
External PR for Release 0.3
Tags: opensource, vue, typescript
Published: 2021-11-25 21:10:38

For the external issue, I chose [badge-generator](https://github.com/MichaelCurrin/badge-generator) which I was able to find in one of the colleague's blog post. It was created with Vue, and I had zero insight on the framework. I first had to research on the framework and understand the syntax, and how it is applied in the code. You can find the issue [here](https://github.com/MichaelCurrin/badge-generator/issues/101).
There were a few components that are needed to be modified in the project. The owner of the project wanted to have all of the tabs to have the html and markdown selection persisted for one single toggle. 

I first had to debug to find out what it does when toggled the switch. It took me the longest time in the whole work. After I find out which action is called when the switch is toggled, I was able to persist the selection by adding an Object in store class. The progress and the changes are in this 
[PR](https://github.com/MichaelCurrin/badge-generator/pull/135).
I still have to work on this more to improve the feature. 

Open source development to me, is more than just a coding or testing. This is a mixture of cooperation and individual work and on top of that, it is the most relevant on how to communicate properly when collaborating . 
Through my six terms of school works, I learned how to code in different languages, In my co-op experiences, I learned how to collaborate. And in this course, open source development, now I am learning how to communicate and work on a same project with different perspectives properly.
Emmet Abbreviation for JSX in VSCode is unstable
Tags: discuss, vscode, productivity
Published: 2021-11-25 21:07:31

Hello DEV Community 👋🏼,

I have a problem that `emmet abbreviation` in my VSCode is unstable, especially when I work with JSX. 
This happens after the latest update of VSCode a few weeks ago on my Windows machine.

Most of the time it works, but sometimes it doesn't. When it doesn't, I have to type every tag manually.
Sometimes creating a new HTML file and start typing on there triggers the emmet back to work. But it doesn't always do the trick. 

I've checked the settings (also with a help of pair of eyes from a friend), and we don't see anything is wrong.
I have a thought maybe an extension is causing this, but I'm not sure.

Does anyone have a thought on where to look at or have any experience with this issue?

Thank you in advance! 😊
MicroServices Live #4 ✉️ Kafka
Tags: microservices, showdev, kotlin
Published: 2021-11-25 19:47:23

En esta cuarta sesión, junto a @tetexxr, usaremos mensajería [Kafka](https://kafka.apache.org/) para nuestro **MicroService** "Hello World" basado en la template que usamos en **Adevinta Spain**.

Puedes ver el repositorio y el streaming de esta sesión 👇

{% github AdevintaSpain/ms-test--hello-twitch no-readme %}
{% youtube pEii_WtJrrM %}

Recuerda que en la última sesión del año mostraremos en live coding la implementación de 🐙 ApiGateway - [KrakenD](https://www.krakend.io/)

Síguenos en [twitter](https://twitter.com/AdevintaEng) o [twitch](https://www.twitch.tv/adevintaspaintech) para no perderte ninguna sesión!

[![Ofertas Backend](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lf57onwagq42xeolawkb.png)](https://careers.adevinta.es/ofertas/?search=backend&stc=aff-blog%20dev.to-microservices%20live%20kafka)
Next.js - breve review
Tags: nextjs, typescript, react, ssr
Published: 2021-11-25 19:43:10

![NextJS](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j5ykqnjw78bq7ivc4k7p.png)

Antes tarde do que nunca! Não é novidade alguma, não vou trazer nenhuma feature nova ou update que possa ter ocorrido. Esse artigo é para trazer um **breve review** desse framework poderoso!

## O que é?
O Next.js é um **framework** da **biblioteca** React.js. Exatamente, o React não é um framework, é uma lib! Dito isso, qual a diferença? Um framework te traz algo um pouco mais pronto, com métodos próprios e já aponta alguns caminhos que devem ser utilizados para um melhor aproveitamento, além de poder trazer em si, um conjunto novo de ferramentas que adicionam features importantes à, por exemplo, uma lib. Uma das vantagens de se utilizar frameworks é a velocidade de desenvolvimento, uma vez que já tem muita coisa pronta.

## O que o Next.js tem destaque?
Bom, o principal destaque é justamente usar o React como base. Então tudo aquilo que você sabe sobre essa lib continua valendo (com pequenas mudanças em pontos específicos).

Outros destaques seriam o **SSR** e o **SSG**:
- SSR: Server Side Rendering - vide `getServerSideProps` na doc; *neste caso a página será gerada em tempo de requisição*;
- SSG: Static Site Generation - vide `getStaticProps`, `getStaticPaths` na doc; *neste caso a página será gerada em tempo de build*;

Por permitir SSR/SSG, o Next.js trabalha muito bem com SEO.

Além dessas features, o sistema de rotas também é muito interessante.

## Javascript ou TypeScript?
Bom, neste caso, vai do gosto? Pessoalmente acho que não. Em termos de escalabilidade, trabalho com multiplos squads na mesma aplicação etc, não vejo como não usar TypeScript. Faz muita diferença e o Next tem total suporte.

## Dependências
Ainda é React! Portanto, você ainda pode usar aquele package que tanto ama.

## Curva de aprendizado
Baixo para quem já conhece bem React.js, TypeScript/Vanilla. Para quem não conhece, não recomendo. Vamos começar do básico e ir escalando! Isso é de extrema importância pra te dar uma base sólida.

## Vale a pena investir nisso?
Depende. Se você quer um SPA, não; neste caso vá de React. Se você necessita de SEO, sim, deve; neste caso o Next vai oferecer um suporte muito melhor por ser SSR/SSG. 

Sua aplicação vai escalar? Talvez seja o caso de pensar em já criar a partir do Next. Grandes empresas tem utilizado, no Brasil a Magalu é uma delas. Mas para pequenos trabalhos, freelas, talvez não seja a melhor opção.

## Conclusão
É uma excelente ferramenta. Tive meu primeiro contato recentemente e já gostei. Por conhecer e trabalhar com React a curva de aprendizado tem sido baixa mesmo. Além disso, é algo que pode pesar a seu favor no currículo uma vez que grandes empresas tem adotado. Hoje não faltam recursos de aprendizado. E o primeiro é aqui:

[Nextjs Official Website](https://nextjs.org/)
Happy Thanksgiving in AR! 🦃
Tags: augmentedreality, discuss, devmeme, startup
Published: 2021-11-25 19:17:33

The [echo3D](https://www.echo3d.co/) team wishes you and your family a wonderful Thanksgiving!🦃

Scan the QR code with your phone or go directly to
https://go.echo3d.co/nBVm
with your phone browser to pardon the turkey!


![1111.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1637867680192/cGCh9gaIQ.png)

[Sign up](https://console.echo3d.co/#/auth/register) to the echo3d platform for free to create this yourself!

![1_-Jku_VdlnolDmz96fpsKnw.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1637867422824/U5IC4iijf.png)

> echo3D (www.echo3D.co; Techstars ’19) is a cloud platform for 3D/AR/VR that provides tools and network infrastructure to help developers & companies quickly build and deploy 3D apps, games, and content.


![2.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1637867390845/MjIpOxYbZ.png)
Publishing my package to NPM
Published: 2021-11-25 19:17:05

## Introduction
Hello everyone, my name is Dustin. Today, I'd like to talk about my experience of publishing my static site generator to NPM. It's quite a fun experience as I finally made my project up and running in public.

## Process
I've used [this](https://docs.npmjs.com/packages-and-modules/contributing-packages-to-the-registry) as instruction to publish it to NPM.

You can check it out [here](https://www.npmjs.com/package/cv-ssg)

Because I already built my project for quite a long time so, I can skip most of the steps, and just focus on [this](https://docs.npmjs.com/creating-and-publishing-unscoped-public-packages) step and some steps that help me understand the semantic versioning and dist-tags. 

When I first start using command line `npm publish` to publish the project, I had to sign up and log in to NPM. But I encountered an error where it said something like this 
```
npm ERR! code E403
npm ERR! 403 403 Forbidden - PUT https://registry.npmjs.org/cv-ssg - Forbidden
npm ERR! 403 In most cases, you or one of your dependencies are requesting
npm ERR! 403 a package version that is forbidden by your security policy, or
npm ERR! 403 on a server you do not have access to.
```

As it stated right there, the error code is 403 which means it involved sign up or log in part. After a few minutes, I just realized that I forgot to verify email. So just make sure that if this is your first time publishing a project to npm, you have your email verified.

While working with updating version stuff, I also had to delete e2e snapshot file and run it again because when I changed the version in the `package.json`, and pushed the repo to github, the github action won't be happy. I'm not sure if I'm doing the right way that other people do. If I don't, please show me. Thank you.

I tried to test it as a client's perspective by installing Nodejs and then I do `npm install -g cv-ssg` to install it globally so that I can run it anywhere I like. As expected, it worked very well, I got no error. Or maybe I'm just testing the bright side of the project. 

In order to tackle that problem, I got one of my friend who is also a student of this course to test it out on his computer. Fortunately, he also ran it successfully a few times using `cv-ssg` command.  

## Wrap up
For this lab, it didn't require us to code anything as this is like a final step for the project, not quite the final one because if the project is delivered to end users and they found bugs or errors. It needs to be fixed and published again. The cycle keeps going and going.
Tech Salaries: All that goes up, must come down
Tags: salary, career
Published: 2021-12-03 13:04:43

---
title: Tech Salaries: All that goes up, must come down
published: true
date: 2021-11-25 18:59:24 UTC
tags: salary,career
canonical_url: https://jasonstcyr.com/2021/11/25/tech-salaries-all-that-goes-up-must-come-down/
cover_image: https://theagilecoder.files.wordpress.com/2021/11/pexels-photo-6289027.jpeg
---

Some folks are mad about this tweet by @laurieontech but it is important to understand what happened in our field’s history. 

[![Tech salaries will come down. It's not a matter of it, but when. It may be soon, or a while from now. But assuming this supply/demand will last for your entire career is probably not a good bet.](https://theagilecoder.files.wordpress.com/2021/11/image.png)](https://twitter.com/laurieontech/status/1458455887207714817)

I saw this as I was starting into tech. Telecom companies drastically cutting staff after years of booming, causing an abundance of available, skilled, engineers.

This does not mean we are about to have this happen right now, but we should recognize the patterns that have happened before and be ready. Plenty of demand right now, and that drives salaries up so long as workers demand those salaries. But when people start losing jobs?

Those folks are willing to take less to keep working. This starts applying pressure to the economics of salaries. If a company can hire somebody with 15 years experience at the price of a new grad? The hiring manager will not flinch. A one-off situation though, until it is not.

When an entire part of an industry starts cutting jobs, the influx of talent is too great. Supply exceeds demand, salaries start to lower. Before the dot com bubble burst, I was getting offers for huge salaries in SF when I had not even graduated yet. I stayed in school… 🤦🏻‍♂️

By the time I graduated, the bubble had burst. I already had a few years experience and was able to get an entry level job for 40K Canadian. But at least I had the job. Neighbours who had a lot of tech experience were taking on other jobs, but not what they were skilled at.

I hope we don’t see that happen again soon, but it’s good to understand what happened before and learn from the mistakes made. As workers, we need to ensure we have a diverse skillset that can transfer to another part of the tech industry. Survive the whims of the hype engine.

As managers, we need to ensure our teammates are paid what they’re worth. We should also make sure they have the opportunity to develop those transferable skills. History is a great teacher, but it will not necessarily repeat itself. Always good to be ready, though!

*NOTE: This content was originally posted as a thread on Twitter:* https://twitter.com/StCyrThoughts/status/1458802830484119561
Balance with care
Tags: career, watercooler
Published: 2021-11-25 18:52:28

I have not been a developer for 1 year now and I have to tell you I do miss it, or at least I miss my own projects and being sharp on the subject of front end. Now I'm a consultant I'm a bit more of a generalist and that's okay, but is it my fault that I'm not as sharp? Probably, you see my life no longer revolves around work, work has to coexist with my life, everyone is heading back to offices, but I'm staying here at home where it's warm and cosy.

Do you think I will stagnate? Maybe is should focus on writing something for myself again?
🧠 Thoughts - a self-hosted microblogging web app for teams and groups
Tags: opensource, microblog, teams, socialnetwork
Published: 2021-11-25 18:42:18

---
title: 🧠 Thoughts - a self-hosted microblogging web app for teams and groups
published: true
description: Share your ideas, thoughts, and feelings. Let your team and group know what's up.
tags: opensource, microblog, teams, socialnetwork
//cover_image: https://direct_url_to_image.jpg
---
## 🧠 Thoughts - a self-hosted microblogging web app for teams and groups
- Share your ideas, thoughts, and feelings. Let your team and group know what's up.
- Lightweight, easy to use, and free.
- For startups 🚀, teams and groups.

## ✨ Features
- ✍🏻 Share your thoughts, ideas, and feelings.
- 🔔 Get notified when someone shares, comments, or likes your thoughts.
- 💖 Like and share your view on others thoughts, ideas, and feelings.
- #️⃣ hashtags, mentions, and links.
- 🧠 Share Ideas and get validated.
- ✅ Polls and Forms.
- 📝 Write your thoughts in Markdown as Blogs.

## 👩🏻‍💻Tech Stack
- 💻 Node.js
- 📦 Feathers.js
- 📦 MongoDB
- 🆚 vue.js

## Installation ( Under construction, once ready you could )
- ⬇️ Download the latest release from GitHub
- 📦 Run `npm install` to install dependencies
- 🔌 Run the app with `npm start`

## Follow
- 👁 Watch and 💖 star this repo to get notified
- https://github.com/git-kamesh/thoughts
Difference between sort() and sorted() in Python
Tags: python, sorting
Published: 2021-11-25 18:00:48

Sorting is the act of rearranging a given sequence. In Python, sorting is easily done with the built-in methods sort () and sorted().
. The sorted() and sort() methods sort the given sequence in either ascending or descending order.
Though these two methods perform the same task, they are quite different.
-> sorted():
Syntax:
```
sorted(iterable, key, reverse=False)
```
This method makes changes to the original sequence.(Refer example-1,line-13)

Return Type: returns none, has no return value.(Refer Example-1,line-12)

->sort():
sort() function is very similar to sorted() but it returns nothing and makes changes to the original sequence which differs it from sorted function.
sort() is a method of the list class, so it can only be used with lists.
Syntax: 
```
List_name.sort(key, reverse=False)
```

Example-1:

```
# based on alphabetical order of first letter
courts=["Supreme","High","District"]
print(" the original list :",courts)

# using sorted()
new_list=sorted(courts)
print("using_sorted():",new_list)#returns a sorted list
print("aft_sorting_lst",courts)#doesn't change original list

#using sort()
k=courts.sort()
print("using_sort():",k)#returns Nothing
print("aft_sort_lst:",courts) #changes the original list
```
output:

the original list : ['Supreme', 'High', 'District']
using_sorted(): ['District', 'High', 'Supreme']
aft_sorting_lst ['Supreme', 'High', 'District']
using_sort(): None
aft_sort_lst: ['District', 'High', 'Supreme']
Example-2:

```
#Using diff datatypes sorting through sorted() method

courts=["Supreme","High","District"]
print(sorted(courts))#list
courts=("Supreme","High","District")#tuple
print(sorted(courts))
courts="high"#string
print(sorted(courts))
courts={'Supreme':1,'High':2,'District':3}#dictionary
print(sorted(courts))
courts={"Supreme","High","District"}#sets
print(sorted(courts))

#sort() is used only for lists
#print("using sort():",courts.sort())
#  attribute error
```
output:
['District', 'High', 'Supreme']
['District', 'High', 'Supreme']
['g', 'h', 'h', 'i']
['District', 'High', 'Supreme']
['District', 'High', 'Supreme']
Looking at the new v-memo directive in Vue 3.2
Tags: vue, javascript, webdev
Published: 2021-11-25 17:53:30

The release of Vue 3.2 introduced some new functionalities, mainly related to performance and optimisations. One of these features is a new directive called **v-memo**

## What is v-memo?

v-memo, as the name suggests, is a new directive related to the *memoization* of parts of a template.
If you are not familiar with the term "memoization", wikipedia describes it as:

> In computing, memoization or memoisation is an optimization technique used primarily to speed up computer programs by storing the results of expensive function calls and returning the cached result when the same inputs occur again

In Vue this description sounds really like what `computed` properties already do.
In fact v-memo can be seen as a computed property for parts of a template!

## Using v-memo

v-memo accepts a single parameter, which should be an array of dependencies. The element that uses this directive and all its descendants will only be re-rendered when one of the dependencies change. 
For example:

```vue
<div v-memo="[dep1, dep2]">
  ...
</div>
```

Note that if you don't provide dependencies , ie:`v-memo="[]"`, you obtain the same functionality as `v-once`.

## Examples

Since v-memo is mainly useful for performance reasons, one of the best scenarios where you'd want to use it is when rendering huge lists of items with `v-for`:

```vue
<div v-for="item in list" :key="item.id" v-memo="[item.id === selected]">
  <p>ID: {{ item.id }} - selected: {{ item.id === selected }}</p>
</div>
```
In this example we are telling v-memo to only re-render an item if it has been selected or deselected, all other items will be skipped entirely. 
We don't need to include `item.id` in the dependency array since the sub-template of every item is already keyed,  so it generates a separate sub-tree.
Another thing to keep in mind is that v-memo is only useful in a v-for if you are using some kind of interpolation. If for example you are rendering a list of components like `<MyComponent v-for="item in list" :key="item.id" v-memo />`, you are not going to benefit from v-memo as the diffing is made inside each component.

I've prepared an example on StackBlitz that shows visually how v-memo helps with performance in lists: [https://stackblitz.com/edit/vue-v-memo](https://stackblitz.com/edit/vue-v-memo)