teleren/devto huggingface dataset:
The Best Cryptocurrency and market data API
Tags: api, blockchain
Published: 2022-11-14 02:26:26

Nowadays, more and more people pay attention to digital currency development and want to find an API that provides basic information, market data, etc. of digital currencies such as BTC and eth. In fact, you could consider trying Block.cc.
Block.cc has various types of API interfaces, is dedicated to developers, and is easy to access. Block.cc included 500+ exchanges, 10,000+ currencies, 28,000+ trading pairs, and 1000+ business users. It covers multi-dimensional data such as real-time price, currency information, K-line data, legal currency exchange rate, transaction depth, news flash, block data, and historical transactions.

Access URLs

REST API
https://data.block.cc/api/v3

Websocket Feed
wss://data.block.cc/ws/v3

Access to Block.cc

Before using Block.cc API, you need to register an account and apply for an API Key before developing.

You can provide an API key in a REST API call in the following ways:

1. Preferred method: Via a custom request header named X-API-KEY
2. Convenient method: pass a query string parameter named api_key

The API key can only be provided in the Websocket API via a query string parameter named api_key

example:

`curl -X GET \-H 'X-API-KEY: [YOUR_API_KEY]' \'https://data.block.cc/api/v3/markets'

curl -X GET \'https://data.block.cc/api/v3/markets?api_key=[YOUR_API_KEY]'

wscat -c 'wss://data.block.cc/ws/v3?api_key=[YOUR_API_KEY]`

Example request:

(1) Binance Exchange information can be obtained through the Block.cc  API
`curl -X GET \ 
  'https://data.block.cc/api/v3/markets/binance'`
return:
 `[
  {
    "slug": "binance",
    "fullname": "Binance",
    "websiteUrl": "https://www.binance.com/",
    "volume": 2490122366.2343,
    "reportedVolume": 2490122366.2343,
    "expectedVolume": 2490122366.2343,
    "monthlyVisits": 19386372.159024935,
    "status": "enable",
    "kline": true,
    "spot": true,
    "futures": false
  },
  {
    "slug": "okex",
    "fullname": "OKEX",
    "websiteUrl": "https://www.okex.com",
    "volume": 2490122366.2343,
    "reportedVolume": 2490122366.2343,
    "expectedVolume": 2490122366.2343,
    "monthlyVisits": 19386372.159024935,
    "status": "enable",
    "kline": true,
    "spot": true,
    "futures": false
  }
]`

（2）BTC Bitcoin prices can be obtained through the Block.cc  API
`curl -X GET \'https://data.block.cc/api/v3/price?slug=bitcoin,filecoin'`
Response:
` [
  {
    "s": "bitcoin",
    "S": "BTC",
    "T": 1564201016247,
    "u": 10254.613,
    "b": 1,
    "a": 66180.407,
    "v": 663551832.77,
    "ra": 68260.277,
    "rv": 684890110,
    "m": 182193710000,
    "c": 0.0111,
    "h": 10254,
    "l": 10254,
    "cw": 0.0111,
    "hw": 10254,
    "lw": 10254,
    "cm": 0.0111,
    "hm": 10254,
    "lm": 10254,
    "ha": 10254,
    "la": 10254
  }
]`

If you want to know more about Block.cc, you can visit the website below or read the API documentation
Website：https://pro.block.cc/
API docs:https://blockcc-api-document.pages.dev/en_US/#changelog
Setup Server and Jenkins
Tags: jenkins, ubuntu
Published: 2022-11-14 01:33:30

## Install Dokcer
install docker https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-20-04

## Install jenkins
from website https://www.jenkins.io/download/

use this command
```
wget Generic Java package (.war)
SHA-256: f39cb8d09fd17c72dc096511ce50f245fc3004d1022aaaf60421a536f740c9b9
```

### running jenkins services
before running, open port 8080

and then use this command
```
java -jar jenkins.war &
```

## Open web jenkins
default port 8080

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

## next step select plugin

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

## proxy Manager
https://github.com/oktorakevinarigi/cheat-sheets/blob/master/devops/nginx-proxy-manager/docker-compose.yml


# Note
I'm still progress on article
How to use the Javascript Date Object to count days until a specific date
Tags: javascript, programing, tutorial, countdown
Published: 2022-11-14 00:28:55

Finding out the number of days until a specific date sounds tricky, but using Javascript's built-in date object we can do it easily.

First, we need to understand what the [Date object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) is, and how it works. At it's core, the date object contains a number which represents a specific instant in time, specifically, the number of seconds since January 1, 1970. By using a number of seconds to store the time, we can easily avoid problems related to day shifts caused by leap years and daylight savings time. 

# Making a new Date object
Getting today's date is easy. Simply use the Date object's constructor:

```
 // Get today's date
const now = new Date();
// Sun Nov 13 2022 18:28:22 GMT-0500 (Eastern Standard Time)

```
To make a different date, for example, Christmas, you would use a different constructor, where the date is specified by a string:
```
// Make a date object for christmas
const christmas = new Date("Dec 25, 2022 00:00:00")
```

## How to get the year, month, or day from the Date
Now that we have our time in a Date object, finding the Year, Month, or Day is as simple using Date's methods:
```
const year = christmas.getFullYear() \\ 2022
const month = christmas.getMonth()\\ 11 - Get month as a number (0-11)
```
**Other Methods**

- getFullYear()	Get year as a four digit number (yyyy)
- getMonth()	Get month as a number (0-11)
- getDate()	Get day as a number (1-31)
- getDay()	Get weekday as a number (0-6)
- getHours()	Get hour (0-23)
- getMinutes()	Get minute (0-59)
- getSeconds()	Get second (0-59)
- getMilliseconds()	Get millisecond (0-999)
- getTime()	Get time (milliseconds since January 1, 1970)

Now that we know about Date's methods, getting the difference in milliseconds between two dates is as easy as:
```
const msUntilChristmas = christmas.getTime() - now.getTime();
```
Which can easily be converted to days until christmas by dividing by the number of ms per day:
```
const daysUntilChristmas = Math.floor(msUntilChristmas / (1000 * 60 * 60 * 24));
\\ use Math.floor() to round down
\\ 1000 ms per second
\\ 60 seconds per minute
\\ 60 minutes per hour
\\ 24 hours per day
console.log(`${daysUntilChristmas} days!`) /// 41 days!
```
Now you can calculate the exact number of days until Christmas, even if there is a leap year! Using the same concepts explained above, you can calculate the number of days, hours, or even minutes until, or since any day or time of your choosing!
Phalcon 5.1.1 Released
Tags: phalcon, phalcon5, release
Published: 2022-12-01 13:53:37

---
title: Phalcon 5.1.1 Released
published: true
date: 2022-11-14 00:24:32 UTC
tags: phalcon,phalcon5,release
canonical_url: 
---

Phalcon 5.1.1 is now available.

This release contains bug fixes.

As always, a huge thank you to our community for identifying these issues and suggesting the new features.

## Changelog

### Fixed

- Fixed `Phalcon\Filter::sanitize` to return correct data when `noRecursive` is `true` [#16199](https://github.com/phalcon/cphalcon/issues/16199)
- Fixed `Phalcon\Html\Escaper::html` to not return `null` when a zero string is passed [#16202](https://github.com/phalcon/cphalcon/issues/16202)
The switch Statement - SPVM - The Project for Python/NumPy Porting to Perl
Tags: perl, spvm, python, numpy
Published: 2022-11-13 23:15:03


The <code>switch</code> statement in <a href="https://metacpan.org/pod/SPVM">SPVM</a> language is a statement for conditional branch.

```
# switch statement
my $code = 2;
my $flag = 1;
switch ($code) {
  case 1: {
    print "1\n";
  }
  case 2: {
    print "2\n";
  }
  case 3: {
    if ($flag) {
      break;
    }
    print "3\n";
  }
  case 4:
  case 5:
  {
    print "4 or 5\n";
  }
  default: {
    print "Other\n";
  }
}
 
# switch statement using enumeration
class Foo {
  enum {
    ID1,
    ID2,
    ID3,
  }
   
  static method main : int () {
    my $value = 1;
    switch ($value) {
      case Foo->ID1: {
        print "1\n";
      }
      case Foo->ID2: {
        print "2\n";
      }
      case Foo->ID3: {
        if ($flag) {
          break;
        }
        print "3\n";
      }
      default: {
        print "Other\n";
      }
    }
  }
}
```

## How to install SPVM::Numpy

```
cpanm SPVM::Numpy
```

```
# Developper
cpanm SPVM;
git clone https://github.com/yuki-kimoto/SPVM-Numpy.git
```

See also <a href="https://dev.to/yukikimoto/installing-spvmnumpy-pythonnumpy-porting-to-perl-4hfi">Installing SPVM::Numpy</a>

## What Is SPVM?

<a href="https://metacpan.org/pod/SPVM">SPVM</a> is a static typed language that can be used from <a href="https://perldoc.perl.org/">Perl</a>. <a href="https://metacpan.org/pod/SPVM">SPVM</a> is the essential part of the Python/numpy porting to Perl. If you haven't heard of Perl's SPVM. Please see also <a href="https://metacpan.org/pod/distribution/SPVM/lib/SPVM/Document/Language.pm">SPVM Language Specification</a>. 

## How potential dose SPVM have?

Growth is expected in the fields of Bio Tech, AI/ML, Apple/iPhone/iPad Apps, Google/Android Apps, IoT Device, Connected Car, Smart Device, Smart Home, etc.

This is because SPVM can produce an executable file that supports cross platforms and make easy to calculate arrays and bind C/C++ and Nvidia/GPU/cuda.

## SPVM Documents

- <a href="https://metacpan.org/pod/SPVM">SPVM Documents</a>

## SPVM Modules

- <a href="https://metacpan.org/pod/SPVM::Sys">SPVM::Sys</a>(<a href="https://github.com/yuki-kimoto/SPVM-Sys">SPVM::Sys on Github</a>)

## This project really needs contributors, sponsors, investors.

This project really needs contributors. I am looking for contributors, sponsors, investors.
Reposting Sharif Arfan’s Link
Tags: mern, webdev, fullstackdevelopment, tutorial
Published: 2022-11-13 22:56:23

As I’ve already told @shaifarfan08, this is a pretty neat project. Just wanted to (re-)share it. Thanks again, Shaif.

https://dev.to/shaifarfan08/mern-stack-project-for-beginners-59jf
Running Docker on M1 Mac - docker: compose is not a docker
Tags: docker, m1
Published: 2022-11-18 19:01:16

---
title: Running Docker on M1 Mac - docker: compose is not a docker
published: true
date: 2022-11-13 21:34:00 UTC
tags: Docker, M1
canonical_url: https://dcblog.dev/running-docker-on-m1-mac-docker-compose-is-not-a-docker
---

 ![Running Docker on M1 Mac - docker: compose is not a docker](https://dcblog.dev/images/posts/running-docker-on-m1-mac-docker-compose-is-not-a-docker.png) 

When upgrading from an **Intel** mac to an **Apple Silicone** I noticed docker fails to run. I'm using Laravel Sail when Sail is installed or when a **sail up** command is attempted I get an error: 

**docker: 'compose' is not a docker command**

The reason for this is a **docker-compose** is now a plugin. Docker needs **docker-compose** to be installed. Use brew to install **docker-compose**

```

brew install docker-compose
```

Once installed **sail** will function normally without any extra setup.
Aliasing paths in Vite projects w/ TypeScript
Tags: vite, typescript, react
Published: 2022-11-13 21:13:45

Aliasing paths can be a really handy way of referencing key directories in your project within deeply nested files. For example, take a look at the structure of this fictitious Vite TypeScript project:
```
.
├── index.html
├── package-lock.json
├── package.json
├── public
│   └── vite.svg
├── src
│   ├── App.tsx
│   ├── assets
│   │   ├── image.png
│   ├── components
│   │   ├── ComponentA
│   │   │   └── ComponentA.tsx
│   ├── main.tsx
│   └── vite-env.d.ts
├── tsconfig.json
├── tsconfig.node.json
└── vite.config.ts
```
Let's say we wanted to import `image.png` from `ComponentA.tsx`. Our import would look like this:
```tsx
import image from '../../../assets/image.png';
```
Not so nice. With deeply nested structures you can end up with even longer paths. It'd be a lot nicer if we could just alias the key folders and do something like this instead:
```tsx
import image from `@assets/image.png`
```
Let's see how we can do that in Vite.

## Step 1 - Add aliases to vite.config.ts
Our first step is to register aliases with Vite (and Rollup, which Vite uses under the hood). We can do that in our `vite.config.ts`:
```ts
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import path from 'path';

// https://vitejs.dev/config/
export default defineConfig({
  resolve: {
    alias: {
      '@': path.resolve(__dirname, './src'),
      '@assets': path.resolve(__dirname, './src/assets'),
      '@components': path.resolve(__dirname, './src/components'),
    },
  },
  plugins: [react()]
})
```
*Side note - make sure to `npm install -D @types/node` in order to avoid issues with importing `path` and using `__dirname`*

Now Vite knows to reference the `src` directory whenever we use `@` in our imports.

## Step 2 - Add aliases to tsconfig.json

The TypeScript compiler also needs to know about our aliases so that it can compile all of our imported files. Let's update our `tsconfig.json` accordingly:
```json
{
  "compilerOptions": {
    // ... your other compiler options
    "baseUrl": ".",
    "paths": {
      "@/*": ["src/*"],
      "@components/*": ["src/components/*"],
      "@assets/*": ["src/assets/*"]
    },
  },
  "include": ["src"],
  "references": [{ "path": "./tsconfig.node.json" }]
}
```
There's a slight syntax difference between what we added in our `vite.config.ts`, but the idea is the same. There's also a `baseUrl` property to specify what our `paths` are relative to.

---

That's about all there is to it. Now you can use `@`, `@assets`, and `@components` in your import paths. I kept this example to three aliases for simplicity's sake, but feel free to use as many as your project calls for. Enjoy!
Learning to Code
Published: 2022-11-13 20:34:31

## Hi!
<br>
<ul>
<li>I'm currently just starting out in the dev community. I joined a bootcamp through UMN that starts at the end of November. </li>
<li>I'm here to learn and share my journey from beginner to not-so-beginner! </li>
<li>This week I learned about GitHub, VS Code, Screencastify, and am learning HTML.</li>
Style Components in React JS
Published: 2022-11-13 19:43:12

I wrote code for Global Style Components but getting error "The global style component was given child JSX. createGlobalStyle does not render children."
Do anyone knows how to resolve this issue?
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ysqbrrr7j9e0l1frki4z.jpg)
The Basics of Building A Website
Tags: website, coding, programming, websitedesign
Published: 2022-11-18 04:23:58

---
title: The Basics of Building A Website
published: true
date: 2022-11-13 19:34:31 UTC
tags: website,coding,programming,websitedesign
canonical_url: https://grahamzemel.medium.com/the-basics-of-building-a-website-1cf2ab5eccb1
---

[![](https://cdn-images-1.medium.com/max/2600/0*8sLllQ5Zl7iRWhn3)](https://grahamzemel.medium.com/the-basics-of-building-a-website-1cf2ab5eccb1?source=rss-79a7fbf51e21------2)

TL;DR- Some of the best tools for creating websites for personal use, business use, or just for fun.

[Continue reading on Medium »](https://grahamzemel.medium.com/the-basics-of-building-a-website-1cf2ab5eccb1?source=rss-79a7fbf51e21------2)
How to Share a directory with the Guest System in KVM
Tags: linux, selfhosting
Published: 2022-11-13 19:14:11

---
title: How to Share a directory with the Guest System in KVM
published: true
description: 
tags: linux,selfhosting
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2022-11-01 17:27 +0000
---

https://kevwe.com/blog/Share-a-directory-with-the-Guest-System
Excel Automation with RPA
Tags: rpa, excel, automation, ai
Published: 2022-11-13 18:01:51

Excel automation is a technique for using a program to carry out tasks automatically without any manual assistance. Excel automation generally involves building code to interact with Excel and automatically perform tasks. Before we continue with the piece, please read more on [Excel Automation Here](https://forum.electroneek.com/t/first-excel-steps/1017).

You can use robotic process automation, or RPA, to incorporate Excel tasks into automated processes.

All of the processes that Excel can complete on its own can be accomplished by robotic process automation. It is capable of reading and writing all file types that Excel supports. RPA can also effectively analyze data and produce in-depth reports at the same time. RPA can then be installed by businesses on their computers to function like Excel software.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4pfq2czciiaq7783u1fv.png)

**So what can Excel automation do for you?**

Excel automation can perform a variety of tasks for users to enhance their experience while using an Excel workbook. It simplifies complicated tasks and enables businesses to quickly and precisely repeat procedures to save time, money, and effort.

1. It gives users a user-friendly experience by taking care of all the manual and repetitive tasks so they can concentrate on the importance of the data in the spreadsheets.

2. Excel Automation can help businesses to make informed decisions

3. Integrating spreadsheets and their data into any enterprise system requires automating Excel processes. Spreadsheets are now just another source that can be integrated with more advanced enterprise ones thanks to automation.

4. Excel Automation makes the transfer of data between spreadsheets risk-free.

5. Users can securely share data in the formats .xls, .xlsx, .csv and .xlsm (Excel files that specifically support .vba macros). The data can be compressed, encrypted, and transferred to others via Excel automation, regardless of where they are physically located.

We have a comprehensive guide on how you can automate your excel activities on our forum, navigate to: https://forum.electroneek.com/t/first-excel-steps/1017

You can also be part of our community by registering an account here: https://forum.electroneek.com
Fear of Hypervisors
Published: 2022-11-13 19:12:51

---
title: Fear of Hypervisors
published: true
description: 
tags: 
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/navp6rdchhwynlz3dtla.png
canonical_url: 'https://kevwe.com/weekly/202246'
# Use a ratio of 100:42 for best results.
# published_at: 2022-11-13 19:11 +0000
---
Not unlike how Lucretius described the Superstition springing out from the fear of
thunder and lightning, the Cloud was born as a religion out of the Fear of Hypervisors.

We adore the Cloud and the elastic scalability out of ignorance and misunderstanding.

We can't see, therefore we cannot understand, the magic of KVM and Libvirt.

We can't see, and therefore do not understand what overcommitted resources actually mean.
(Spoiler: it means you can pay 10x your actual physical resources usage)

The thunder gods gave us disposable instances, scalable magic and other heavenly clouds.

Tough, the Original Sin of the [Shared Responsibility Model](https://aws.amazon.com/compliance/shared-responsibility-model/)
is still there: we won't be saved from someone else alone taking care of our own data.

We delegate but still are responsible for our customers data.

We won't be saved by ignorance as, when the thunder gods will decide to unplug humanity,
we will need to re-learn it all again.

It has happened before, and it will happen again.

For the weekly links at: https://kevwe.com/weekly/202246
Laravel 9 Link Active Class Routes Example
Tags: laravel, webdev, tutorial, tailwindcss
Published: 2022-11-13 19:06:20

In this section we will see how to use link active class routes in laravel 9. We will see active link routes in laravel with tailwind css and bootstrap 5.

### Example 1
Laravel 9 simple active class link using request()->is('/') and ternary operator.
```php
<li>
    <a href="/" class="{{ request()->is('/') ? 'text-blue-600':'' }}">Home</a>
</li>
<li>
    <a href="{{ route('vuejs') }}" class="{{ request()->is('vuejs') ? 'text-green-600':'' }}">Vue</a>
</li>
```
![laravel 9 with tailwind css navbar active links](https://larainfo.com/storage/canvas/images/PNxLX0olxrKuur1DaT63Fhpi9EYDAZrcIpwv3WzK.png)
<br>
### Example 2
Using routeIs to create active current routes links.
```php
<li>
    <a href="/" class="{{ request()->routeIs('/') ? 'text-blue-600':'' }}">Home</a>
</li>
<li>
    <a href="{{ route('vuejs') }}" class="{{ request()->routeIs('vuejs') ? 'text-green-600':'' }}">Vue</a>
</li>
```
<br>

### Example 3
You can also use laravel @class directive to active link class with tailwind css navbar links.
```php
<li>
    <a href="{{ route('vuejs') }}" @class(['text-blue-600'=> request()->is('vuejs') ])>Test</a>
</li>
```
<br>
### Example 4
laravel 9 active routes links with bootstrap 5.
```php
<li class="nav-item">
    <a class="nav-link {{ request()->routeIs('/') ? 'active':'' }}" aria-current="page" href="/">Home</a>
</li>
```

If you Know more plz comment below.
1. Two Sum - Leetcode - JavaScript Solution using HashMap - by Abu Saleh Faysal
Tags: leetcode, programming, javascript, tutorial
Published: 2022-11-13 18:45:25

I previously solved this problem using two for loops. However, that was not a very efficient way to solve this problem. So, this time I solved this problem using HashMap.

## Solution:

**Step 01:** Hashmap is a set of key, value pairs. I declared a variable which is an empty hashmap.

**Step 02: ** Using a for loop, iterate the whole array and find out the needed number to meet the target (for each individual number) using this equation: needed number = target - individual number.

**Step 03:** Check if the hashmap contains the needed number or not, if it contains the needed number, then we simply return the needed number index and the index of that particular array element that gave us the needed number. If it does not meet the condition then, I simply store the number and the index in the hashmap.

**Code:**
```
/**
 * @param {number[]} nums
 * @param {number} target
 * @return {number[]}
 */
var twoSum = function(nums, target) {
    let hashMap = new Map();

    for(let i = 0; i < nums.length; i++) {
        let neededNumber = target - nums[i];

        if(hashMap.has(neededNumber)) {
            return [i, hashMap.get(neededNumber)];
        } 
        hashMap.set(nums[i], i);

    }
};
```

If you want me to publish more posts like this, [Buy me a coffee](https://www.buymeacoffee.com/abusalehfaysal). 


👉 YouTube Channel Link: https://www.youtube.com/channel/UCW_09Nbobf4URLkAlEo84sw
👉 PlayList Link: https://youtube.com/playlist?list=PLUnklBXn8NSefCpBaLe39mds6dQx-tDDD

👉 Connect with me (LinkedIn): https://www.linkedin.com/in/abusalehfaysal
👉 Follow our LinkedIn Page: 
👉 Like our Facebook page: https://www.facebook.com/thebacklogprogrammer/
👉 Join our community (Facebook group): https://www.facebook.com/groups/5500588936676942/
👉 Follow me at: https://www.facebook.com/AbuSalehFaysal10
👉 Twitter: https://twitter.com/AbuSalehFaysal

👉 Abu Saleh Faysal’s Blog: https://abusalehfaysal.hashnode.dev/
👉 Hasnode: https://hashnode.com/@AbuSalehFaysal
👉 Dev Community: https://dev.to/abusalehfaysal
👉 freeCodeCamp: https://www.freecodecamp.org/abusalehfaysal
👉 Medium: https://abusalehfaysal.medium.com/

👉 GitHub: https://github.com/AbuSalehFaysal
👉 GitLab: https://gitlab.com/AbuSalehFaysal