teleren/devto huggingface dataset:
How to Ledger Nano X - the bulletproof 40 year plan
Tags: crypto, bitcoin, nano, wallet
Published: 2021-05-15 21:32:35

I am setting up my Ledger Nano X and geeking out a bit on how to be absolutely certain I am not getting hacked.  There are 2 attack vectors to consider before I setup my cold wallet:
1) Someone might have installed custom firmware before it made it to me.
2) The Ledger Live app I download might not be authentic.

These are relatively easy to protect against by first verifying the hash of the Ledger Live app and second by re-installing the firmware on my Ledger Nano X.  

## Verify you have an authentic Ledger Live app:

Downloaded the latest build: https://www.ledger.com/ledger-live

I am using a Mac so I opened up the terminal and ran this command after downloading the Ledger Live app:

```
shasum -a 512 ~/Downloads/ledger-live-desktop-2.26.1-mac-2.dmg
```

Compared that to the hash published on Ledger's website [Hash Checking instructions for Ledger Live](https://www.ledger.com/ledger-live/lld-signatures). In my case, everything checked out and I am highly confident I have an authentic Ledger Live application.  The only way a hacker could have fooled me at this point is if they hacked GitHub and Ledger's website (good luck!).  

Side note: I could not find the hash for the Ledger Live iOS app.  It is a little more difficult to check hashes for iOS apps, but it is possible.  Since the app goes through the Apple App Store, this is not a huge concern.

## Reinstall the firmware

The Ledger Live app is used to install the firmware so we are building on the extra steps we have taken to make sure we have an authentic Ledger Live app:
https://support.ledger.com/hc/en-us/articles/360013349800-Update-Ledger-Nano-X-firmware?docs=true

## Setup

After that, the setup process was easy to follow.  I generated a unique PIN number to secure my Ledger.  For the recovery phrase, I cut the cards provided by Ledger in half so that only half of my recover phrase will be in one location at a time.  I stored the two halves in different locations in my house.  I then shared 3 more sets of cards with trusted family members.  Two of which are in another state. So as long as all of Texas and Georgia do not burn down, I should be good.  Haha!   Honestly the main reason I shared it with 3 is because I expect at least two of them will loose at least one of the cards over the next 20 years.  I instructed them to store the two cards in different locations in their house.
   
I plan to make one additional copy out of engraved aluminum (or something with a higher melting point if possible) as soon as I get a chance.  I expect I won't need it again for 20 - 40 years, so it needs to be something that will last.  Regular pen ink starts to fade after about 20 years.
   
Another thought is that once I am over the 100k mark I will store a set of cards in a safety deposit box.
Clean code - Guard clauses
Tags: codequality, cleancode, javascript
Published: 2021-05-15 21:28:01

#### What are guard clauses?
Instead of putting code inside an if-else statement, guard clauses are an early exit for cases that shouldn't run this code.

#### Use Case:
Nested if-else statements can get pretty messy, let's see a way to refactor one by using guard clauses.

```javascript
// Without guard clauses
function processOrder(order, userId) {
  let result;
  if (order.userId === userId) { 
    if (order.status !== "DELETED") {
      result = await updateOrder(order);
    } else {
      result = await deleteOrder(order)
    }
  } else {
    throw new ForbiddenException();
  }
  return result;
}
```
```javascript
// With guard clauses
function processOrder(order, userId) {
  if (order.userId !== userId) throw new ForbiddenException();
  if (order.status === "DELETED") return deleteOrder(order)
  return updateOrder(order);
}
```

This results in each logic block being separated and not a single if-else statement being used.

### Conclusion
Guard clauses are one of the most efficient ways to make code easier to read, every time you use an if-else statement, you should ask yourself: can it be done with guard clauses?
Neumorphism eCommerce Landing Page
Tags: codepen, showdev, css, webdev
Published: 2021-05-15 21:20:13

[View Fullscreen Demo →](https://codepen.io/andrewheinke/full/mdWPezz)

A Lord of The Rings eCommerce landing page using neumorphism design. This project includes a color theme changer and local storage to save theme preference.

{% codepen https://codepen.io/andrewheinke/pen/mdWPezz %}
A visual guide to how my brain understands INTERFACES
Published: 2021-05-15 21:15:24

![A Sketching note showing how to understand interfaces in Typescript comparing interfaces with a bookcase](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/agy090off0oh16vmlqp3.jpg)

This sketching note was the result of my process understanding Interfaces with visual input, practical and simple examples and comparisons with events in my day to day life.

Enjoy!
Global Technology Services - outsourcing company founded in 2021
Tags: testing, sotwsurvey, startup, devops
Published: 2021-05-15 21:15:03

The year 2021 seems to be the year of the IT industry that has developed a lot during the pandemic. New opportunities have emerged for entrepreneurs who have managed to attract many projects.

Thus was born a new start-up for outsourcing companies, namely [Global Technology Services](https://www.globaltechnology.tech/AboutUs) Innovation which provides software services.

Global Technology is an outsourcing company founded in 2021 that works with clients from several industries such as:
- Manufacturing
- Healthcare
- Automobile
- Banking
- Real Estate
- Logistics
- Insurance
- Capital Markets

This new company offers full stack services of:
- Frontend
- Backend
- UX/UI
- QA automation
- DevOps
- AR/VR

At the moment, employees from Global Technology Services work 100% from home. When things will relax with the pandemic, the company's managers will rent offices in different countrys to be able to work hybrid, both remote and from the office, all remaining at the choice of employees.

The expansion plans are very big and in the next years it is desired to expand the company by attracting new projects thus creating new jobs.


Global Technology Services focuses on customers in countries such as:
- Untied States
- Europe
- Canada
- Australia

After a brief discussion with human resources staff, we learned that Global Technology focuses on staff selection. We want to attract the best IT people in the industry, thus attracting and retaining the strongest customers with interesting projects.

Currently the company is preparing to invest in employee training, so they are ready to work with the latest technologies meeting customer requirements.

Attracting customers is a rather difficult process, which is why quality comes first. Most customers come from recommendations. Satisfied customers recommend the company to other entrepreneurs or product companies and thus manage to select the best projects.
Simple way to get react-native local push notifications to work (android).
Tags: reactnative, react, android
Published: 2021-05-15 21:04:11

Do you want to get local push notifications to work? Here's simple steps that might help you:

1) Create a file name it anything you want I named it "AndroidNotificationHandler.js".

2) Import react-native push-notification package:

```
import PushNotification, {Importance} from 'react-native-push-notification';

```

3) Since latest update push-notification package requires you to create a channel id in order for notifications to work properly, here's what it looks like:

```
const createChannel = () => {
  PushNotification.createChannel(
    {
      channelId: 'channel-id', // (required)
      channelName: 'My channel', // (required)
      channelDescription: 'A channel to categorise your notifications', // (optional) default: undefined.
      playSound: false, // (optional) default: true
      soundName: 'default', // (optional) See `soundName` parameter of `localNotification` function
      importance: Importance.HIGH, // (optional) default: Importance.HIGH. Int value of the Android notification importance
      vibrate: true, // (optional) default: true. Creates the default vibration patten if true.
    },
    (created) => console.log(`createChannel returned '${created}'`), // (optional) callback returns whether the channel was created, false means it already existed.
  );
};

```

4) After you have created the channelId function create another function that will do the main work in order to get the notifications that you want it to get. Check this out:

```

const notificationHandler = (title, message, date) => {
  PushNotification.localNotificationSchedule({
    channelId: 'channel-id', // this we get from above func()
    title: title,
    message: message,
    autoCancel: true,
    subText: 'Notification',
    vibrate: true,
    vibration: 300,
    playSound: true,
    soundName: 'default',
    ignoreInForeground: false,
    importance: 'high',
    invokeApp: true,
    allowWhileIdle: true,
    priority: 'high',
    visibility: 'public',
    date: date,
  });
};
```

5) You can also cancel notifications if you want, here's how:

```

const cancelNotifications = () => {
  PushNotification.cancelAllLocalNotifications();
};
```

6) export your functions:

```
export {createChannel, notificationHandler, cancelNotifications};
```

7) You can now import use these functions across your project, example from my project:

```
let alertDescription = `Time to study ${topicName}`;
notificationHandler('Reminder!', alertDescription, date);
// I get date parameter from datepicker.
```

That is it. You shall get your notifications now :).
What to do if AdMob cannot find my app for linking
Tags: admob
Published: 2021-05-15 08:44:53

# Background
When using [Google AdMob](https://admob.google.com/), you first **need to link your app to AdMob**.

According to [the AdMob help page](https://support.google.com/admob/answer/10037806), it may take up to **a week after your app is published** in the app store (e.g. App Store for iOS apps) before your app can be linked.

# Problem
However, **three weeks after publishing** my iOS app, my app was still **not found in AdMob and could not be linked to AdMob**.

This problem has occurred many times in the past, and you can find many people's reports on the Internet.
* See [Stack Overflow: App is not visible in appstore on Admob search](https://stackoverflow.com/questions/64858928/app-is-not-visible-in-appstore-on-admob-search)
  - One person reported that they could not find the app even after more than two months.

# Solution

**Ask in the Google forums for AdMob developers.**

* **Google Mobile Ads SDK Developers**: https://groups.google.com/g/google-admob-ads-sdk

If you report a problem and ask for help on the above forum, **Google's AdMob staff will help you solve the problem right away**.

In my case, after reporting the problem in the above forum, I was able to get my app to show up in AdMob and link to it **just 30 minutes later**.
Pagination for Laravel with Vue3 And Inertia
Tags: laravel, inertiajs, vue3, pagination
Published: 2021-05-15 20:29:24

Hi, I've just published a component on npm for pagination when using laravel with vue3 and inertia 

the repository is here:
https://github.com/tuckbloor/vue3-pagination-inertia-laravel

any feed back is welcome, thank you
How to Use Alpine JS with Laravel
Tags: laravel, php, javascript
Published: 2021-05-15 20:02:32

What is Alpine JS?
Alpine.js  is a relatively new front-end framework that promises the reactive and declarative nature of big frameworks like  Vue.js  or  React.js  without having to run npm, compile scripts, configure webpack all in a nice 7.37kb CDN hosted file. You get to keep your DOM and sprinkle in behavior as you see fit. Think of it like  Tailwind  for JavaScript.

According to the  Alpine.js docs , its syntax is almost entirely borrowed from  Vue.js  (and by extension  Angular.js ), so if you already know either of these frameworks there is a very low learning curve to getting started.

In this blog, We will learn how to use alpine.js In Laravel with two examples.

Alpine.js CDN
Laravel Mix

https://techvblogs.com/blog/alpine-js-with-laravel
Make it Fail to Understand how it works!
Published: 2021-05-15 19:42:23

A Lesson I have have learned on my coding journey is to make things fail to "get" how they work...

Ok that seems like a hokey new age concept I guess, but let me explain what I mean.

When I began my journey with lets say... JavaScript, I saw this huge list of methods and thought ok, ww3 schools yeah I get it, ok next thing. But then weeks later coming to use those methods i'd lost some understanding.

So I guess my point is this, a great way to learn a method or a concept is to open up the terminal and start coding.

Use that method over and over, meditate on it, see all the things it "Can't" do and then your understanding of what it "Can" do becomes more solidified.

I think this goes along with many facets of programming and creating with different languages, to optimise your learning the best thing (in my opinion) is to use what you are learning, if you can apply it to a project great, but also just get that terminal open or IDE or whatever and just tinker.

For me this process is hugely beneficial, its simple, basic and obvious but sometimes I think we all say "ok iv read the documentation/manual" or "I've implemented this lesson perfectly" but our recall is poor and the code is not our own.

There are so many ways to implement your code and i believe its important to find what suits your style, so practice, make it fail, rejoice in your errors they will teahc you more than any success ever will. 

This is my first post so i hope for some newer coders like me this helps. Everything worth doing is hard. As Frank Zappa advised Steve Vai, there are 2 rules..

1) Dont Give Up

2) Keep Going

Thanks for reading.

#newbies #beginners #newtocoding #ideas
Test Driven Development (TDD) in 1 Minute
Published: 2021-05-15 19:41:13

---
title: Test Driven Development (TDD) in 1 Minute
published: true
description: We cover what Test Driven Development, TDD for short, or Red Green Refactor, is in 1 minute.
tags: 
//cover_image: https://direct_url_to_image.jpg
---

{% youtube 35x0kQ2L3oU %}
Do you keep `console.log` in tests?
Tags: javascript, jest
Published: 2021-05-15 19:39:49

---
title: Do you keep `console.log` in tests?
published: true
description: 
tags: JavaScript, Jest
//cover_image: https://direct_url_to_image.jpg
---

On one hand it is very helpful to debug issues locally. 
On other hand it pollutes CI machines.
Thoughts?
What’s better to wrap a SVG - Object, or Img?
Published: 2021-05-21 08:42:50

---
title: What’s better to wrap a SVG - Object, or Img?
published: true
date: 2021-05-15 00:00:00 UTC
tags: 
canonical_url: https://vivekpandey.live/blog/wrapping-svg/
---

Recently I was faced with the situation where I had to use SVG icons in my web app. What did I do next? Wrapped the SVG in `<Img>` tag and went with it. It worked obviously, but it had its own shortcomings. This is what I’m going to discuss today.

Let’s get started with discussing the cons of wrapping a svg in a `<Img>` tag:

- Limited CSS based styling.
- In-line styling is required for some of them to work.
- External Stylesheets have no effect on them except for few basic modifications.

## What should I use then?

Let’s take a look at the syntax for both of of them:

- Image Tag   
`<img src="./sample.svg" alt="Sample SVG" />`
- Object Tag   
`<object data="sample.svg" type="image/svg+xml"> <img src="fallback.jpg" /> </object> `

> If you just need the SVG use the `img` tag, otherwise for an interactive SVG use `object` tag.

## Why I used `img` inside the `object` tag?

It’s called a fallback image incase there’s an issue loading the SVG. The fallback png or jpg is used to replace it. Sounds amazing right. That’s one of the cool benefit of using a object tag.

## My Conclusion

If I were to use a SVG in a everyday scenario, I would use object tag over other available tags like `img`, `embed`, or `iframe`.

Originally posted on: [Vivek's Blog](vivekpandey.live/blog)
Kotlin library to store data classes persistently
Tags: showdev, android, kotlin
Published: 2021-05-15 19:08:06

I made a tiny library, it lets you store single instances of kotlin data classes persistently with not much effort / boilerplate https://github.com/erdo/persista

I'm using it to recover state after process death (my app's state is held in immutable data classes). There is a sample app bundled with the repo so you can play around with it.

Issues / PRs are open :D
Your all-in-one accessibility and productivity Chrome Extension.
Tags: productivity, showdev, javascript, webdev
Published: 2021-05-15 18:47:30

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

Hey Dev Community!

We just launched [Someity](https://chrome.google.com/webstore/detail/someity/jifjdmnjnmpbclnpjlmebkclilekkdho) - the only tool you need to start taking control of webpages in your browser. 🐶

Someity is an overall winner at a Major League Hacking hackathon. After days of hard work we transformed it from a weekend hack to a full-fledge product (our first, yay!) on Product Hunt.

Here's what Someity can do for you:

🤖 Someity Actions
Navigate webpages, play music, translate from any language to English and get directions just by speaking to Someity.

🔤 Webpage Font Customizations
Customize font type, colors and sizes on any webpage on the Internet!

🤟 Sign Language Support
We know not everyone might be comfortable understanding written-languages and so we included Sign Language support. Transform webpage text into sign language with just a click!

🎯 Focus Mode
Suffering from cognitive impairments or just want to kill out all distractions while working? Focus Mode helps you veil images and highlight words on scroll. No more getting distracted!

🔎 Magnifier
Images not a11y compliant and appear too small to make sense of it? Magnifier is just the right tool for you. Enable and hover over images to watch it in action!

👀 Color Blind Aid
We want Someity to be for all and hence we built in color blindness features. Emphasize links in multi-colors and add text strokes to paragraph texts in a user-defined color effective for all types of color blindness.

🖨️ Take your webpages with you
Someity offers easy to use print screen and screen capture features making it way easier for non-tech savvy and accessibility prone users to operate.

---

> Check out - https://someity.tech

Try it out and let us know your feedback and any exciting new features that you would want Someity to have ❤️
Why take up Java as a programming language?
Tags: java, beginners, motivation, goal
Published: 2021-05-15 18:33:47

Okay, so Day 1 of my learning journey and as I said that I will be sharing the journey details of my learning Java, so without any delay let's roll in.
Like every new learner, I was quite apprehensive of me choosing Java as a primary programming language as we all know that with the talks of other programming languages like Python and others rounds the corner the task of selecting a language becomes quite hard. But let me tell you why should you chose Java:-

-  What if I tell you that about **13 Billion** devices run Java and that's a really huge number isn't it, from the smartphones to the smart chips in credit cards, to server-side process and lot many more.
- Another amazing fact that it has been in use for almost two decades now, as Java 1.0 came out in 1995 and that's a pretty good share of time for a programming language where after few years there is a new language in the market and another departs from the market.
- Now there will be an obvious question that how did it survive through time and the reason is by having **backwards compatibility** which is also one of the features of Java.
- It has a huge community of developers about **10 million** from all around the globe and that makes it a lot easier for you if you feel stuck somewhere and obviously if you are looking for help on StackOverflow😅.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r9lmps0norly4e4vtu0d.jpg)
- It was mainly derived from C and C++ and you can say they are the nearest ancestor of Java, as it's quite evident that from C  Java derives many of its syntaxes and from C++ it's Object-oriented model.

- But be careful there are some instances where using **Java can be Dangerous** like for the systems which are using **real-time systems**(basically because of garbage collection) apart from some of the places like this it is one of the best choices as a programming language
>
###*"When web companies grow up, they turn into Java shops."* -       James Governor(Redmonk analyst and co-founder)
Generating Phaser Game assets: Planet spritesheet generator
Tags: gamedev, javascript
Published: 2021-05-15 18:23:49

## Why is that hard to find?

When I first started to google procedural planet generators that would export into spritesheets I thought a few clicks would get me exactly to where I wanted to be. However, to my surprise I noticed that HTML5 game developers seem to have an awkward romantic relationship with assets. Pixelart packs are sold on various platforms and tools that help one map & generate an atlas or spritesheet - while primitive - are not even free. Well, I wasn't going to spend money only to end up doing a lot of manual work, so I decided to finally play with the an algorithm I stumbled upon in a completely different application: [Perlin Noise](https://en.wikipedia.org/wiki/Perlin_noise) 

When it comes to graphics, this can generate the patterns I can use for my surface. The next step was to come up with a plan:
## What is a spritesheet?

The most logical way for me to generate a spritesheet was to calculate the rotation steps for one spin and then draw these frames to a canvas that is later going to be my spritesheet. So my strategy was clear:

- Draw the generated planet on a canvas. 
- Export the frame to a second canvas accounting for the position based on the current frame
- Rotate the planet and repeat.
- Once done, generate an image based on the second canvas and offer it for download.

And while I added a few tweaks and options along the way, this worked just fine.

Now, as always, of course you can say that generating three planets in 5 hours of coding surely takes longer than opening up a graphics tool and generate three planets for [the game](https://neoan.us/game). And as you know, you'd be right. However, the source-code is clear, has no dependencies and no build process and - **most importantly** - can be easily adapted to whatever you need to generate.

| Repo | Deployed |
| --- | --- |
| [generator](https://github.com/sroehrl/planet-generator#readme) | https://sroehrl.github.io/planet-generator/ |
| [game](https://github.com/sroehrl/theGame#readme) | https://neoan.us/game/ |
[Feedback Request] Daydreamer - put your ideas on a timeline
Tags: showdev, opensource, webdev
Published: 2021-05-15 18:11:54

Hey!

Daydreamer (https://daydreamer.app/signup) is a project planner with Gantt charts.
The source code is free and open and available at Github: https://github.com/abrdk/Daydreamer .

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lth8kor6ovilq8cpdfjd.png)
Chart example: https://daydreamer.app/gantt/y_pWXiDRA2QebTNPXdSd9 .

To edit projects it is necessary to log in https://daydreamer.app/login :
Registration doesn't require email or any other contact info.
You can use the following credentials:
username: guest
login: guest

I would appreciate if you give it a try and post some feedback: overall impression, suggestions, etc!

Thanks!