teleren/devto huggingface dataset:
Đồng phục công sở
Tags: webdev, programming, javascript
Published: 2023-11-11 08:19:52

Ngày nay, đồng phục đã trở thành một trong những mối quan tâm chính của các doanh nghiệp, tổ chức. Đồng phục không chỉ thể hiện nét đẹp riêng của tổ chức mà còn là phương tiện phổ biến đem hình ảnh thương hiệu đến với khách hàng. Bạn đã biết xu hướng đồng phục công sở năm 2021- 2022 chưa? Tìm hiểu thêm về xu hướng đồng phục công sở năm 2021 – 2022 qua bài viết dưới đây nhé.
Xu hướng đồng phục công sở là gì?
Khi nói đến xu hướng thời trang công sở hàng đầu của năm 2021 – 2022, không thể bỏ qua thiết kế ngẫu hứng đến từ những bộ trang phục quen thuộc. Đi đầu với tinh thần hướng tới một tương lai tươi sáng hơn, các nhà thiết kế đã đặt ngẫu nhiên các gam màu sáng và tối cạnh nhau để tạo ra những bộ trang phục hợp thời trang, bắt mắt.

Đồng phục là một loại quần áo tương tự được thiết kế riêng cho các thành viên của một tổ chức. Đồng phục thường đi kèm với nội quy tổ chức và các sự kiện đặc biệt. Đồng phục công sở là loại đồng phục chuyên dùng trong môi trường công sở. Đồng phục sẽ thể hiện xu hướng đa dạng tùy theo tính chất công việc liên quan. Xu hướng đồng phục công sở được hiểu đơn giản là một trào lưu phát triển các mẫu đồng phục công sở trở nên hiện đại, thời thượng và cá tính hơn.

Khi bạn nghĩ đến trang phục công sở, bạn sẽ nghĩ ngay đến những bộ trang phục nhàm chán và đơn điệu. Nhưng hiện nay đồng phục đã được thay đổi để phù hợp với mọi nhu cầu. Đặc biệt, khi gặp gỡ khách hàng, đối tác, bạn nên chú ý quản lý và kiểm soát ngoại hình của mình bằng những trang phục ấn tượng, gây thiện cảm nhưng vẫn giữ được sự tôn trọng cho người đối diện.
Tìm hiểu thêm tại: https://dongphuchh.com/2022/01/30/xu-huong-dong-phuc-cong-so-nam-2021-2022
FCM browser push notifications - open a different URL on click.
Tags: beginners, python, webdev, tutorial
Published: 2023-11-11 08:18:15

Let me save you an hour or two trying to find information in Google's sea of documentation which can be painful.

Here's a little Python script, you can use to send Push notifications in the background. This allows for users to be directed to a URL on your website, instead of just landing on your homepage.

```python
import argparse
import json
import requests
import google.auth.transport.requests
from google.oauth2 import service_account

# Get this from your project settings in the firebase console.
PROJECT_ID = "project-name-messaging"
API_BASE_URL = "https://fcm.googleapis.com/"
SCOPES = ["https://www.googleapis.com/auth/firebase.messaging"]

'''
Get authentication token. 
To get a credentials JSON file - you will need to:

1) In firebase messaging - click on "Service Accounts"
2) Manage service account permissions
3) On the right hand side you will see the 3 vertical dots
 next to your service account name. Click on "Manage Keys"
4) Add Key. And Download the .json file.
'''
credentials = service_account.Credentials.from_service_account_file(
    "app-credentials-file.json", scopes=SCOPES
)
request = google.auth.transport.requests.Request()
credentials.refresh(request)
token = credentials.token

headers = {
    "Authorization": f"Bearer {token}",
    "Content-Type": "application/json; UTF-8",
}


'''
Build message payload. Notice the "webpush" options. 
We set "link" - this will override the default
link opened - which basically is your root domain. 
Here you can change that to any sub-link on your domain.
'''
fcm_message = {
    "message": {
        "token": "YOUR DEVICE TOKEN",
        "notification": {
            "title": "Some crazy sale",
            "body": "Hurry big sale...",
            "image": "http://mywebsite.com/someimg.png",
        },
        "webpush": {
            "fcmOptions": {
                "link": "http://mywebsite.com/some/page/10",
            }
        },
    }
}

resp = requests.post(
    f'{API_BASE_URL}v1/projects/{PROJECT_ID}/messages:send',
    data=json.dumps(fcm_message),
    headers=headers,
)

print(resp.text)

```

## Conclusion
 
That's all there is to it. You can also add various other options to your payload for mobile devices and extra parameters. 

Here's the full documentation for the Message payload:
https://developers.google.com/gmail/api/reference/rest/v1/users.messages#Message

You will still need to implement the JavaScript code for receiving messages and registering service workers on your website.

Here are some samples on GitHub from the Firebase team to help you implement the JavaScript aspects: https://github.com/firebase/quickstart-js/tree/master/messaging
Is Software Development a dead end job after 35?
Tags: career, softwaredevelopment, coding, workplace
Published: 2023-11-11 08:09:51

To read the opinion of many experts and mine on this topic follow this link to the article on TechBullion:

https://techbullion.com/is-software-development-a-dead-end-job-after-age-35/


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3v2gozulbnlyw7jl7c9x.jpg)
Easy way to build your own SHORTEN URL WebApp with NextJS
Tags: webdev, programming, softwaredevelopment, productivity
Published: 2023-11-14 01:28:55

---
title: Easy way to build your own SHORTEN URL WebApp with NextJS
published: true
date: 2023-11-11 08:07:13 UTC
tags: webdevelopment,programming,softwaredevelopment,productivity
canonical_url: https://medium.com/p/17ae9152a74f
---

![shorten url webApp](https://cdn-images-1.medium.com/max/1024/1*bfRZ-EZ9a-ZRaccKCWR1qg.png)
_shorten url webApp_

Are you tired of sharing long and cumbersome URLs?

Do you want to create your own URL-shortening service?

While there are a lot of services available that help with this, they are not free.

I offer my work on creating an open source Shorten Url in order to save costs (sometimes I just need to pay for the domain name).

In this tutorial, I’ll walk you through the process of building your very own URL-shortening web application using Next.js, a popular React framework.

### [Read More](https://medium.com/p/17ae9152a74f)

Author: [bunhere.com](https://bunhere.com/)

_I am always looking for feedback on my writing, so please let me know what you think._ ❤️
How to delete multiple git branches locally and remotely?
Tags: webdev, programming, tutorial, git
Published: 2023-11-11 08:03:57

To delete multiple Git branches locally, you can use the following command in the terminal:

```bash
git branch -d branch1 branch2 branch3
```

This will delete the locally specified branches. If any branches have not been merged, you will need to use `-D` instead of `-d` to force the deletion.

To delete the same branches remotely, you can use:

```bash
git push origin --delete branch1 branch2 branch3
```

Make sure to replace "branch1", "branch2" and "branch3" with the actual names of your branches. This removes branches both locally and in the remote repository.
Đồng phục bảo hộ lao động
Published: 2023-11-11 07:42:01

Một bộ đồng phục bảo hộ lao động có chất lượng tốt, phù hợp với điều kiện và môi trường làm việc sẽ giúp họ cảm thấy an toàn khi làm việc, tránh khỏi các tác nhân gây hại sức khỏe sẽ được bảo vệ và năng suất lao động được đảm bảo. Hiểu được điều đó, xưởng đồngphục HH Uniform luôn hướng tới chất lượng sản phẩm tốt hơn mỗi ngày đến với tay quý khách hàng.
Quần áo chịu nhiệt do Bảo Hộ Lao ĐộngHH Việt Nam cung cấp đạt tiêu chuẩn chất lượng, da dạng về màu sắc, đủ kích cỡ cho người sử dụng, kèm theo các chi tiết phụ như găng tay, bó ống tay và mũ, giúp bao phủ toàn bộ cơ thể khỏi nhiệt độ cao. Sản xuất bằng chất liệu datự nhiên hay bằng sợi a-mi-ăng công nghiệp,… chịu được nhiệt độ cao, có khả năng chống nóng và chống cháy, được sử dụng rộng rãi trong công tác PCCC và luyện kim.
Mua hàng tại: https://dongphuchh.com/dong-phuc-bao-ho-lao-dong
Unlocking the Power of Apache Age: Advanced Techniques for SQL/Cypher Hybrid Queries
Tags: postgres, database, apacheage, sql
Published: 2023-11-11 07:19:22

## Using Cypher in a CTE Expression
You can use a CTE (Common Table Expression) to define a Cypher query and then reference it in a SQL query. This can be useful for breaking down a complex query into smaller, more manageable pieces. For example:

```
WITH graph_query as (
  SELECT * FROM cypher('graph_name', $$
    MATCH (n)
    RETURN n.name, n.age
    $$) as (name agtype, age agtype)
)
SELECT * FROM graph_query;

```
The above query will first execute the Cypher query in the CTE, which will return all nodes in the graph with their names and ages. The SQL query will then select all rows from the CTE, returning the same results.

## Using Cypher in a Join expression
You can also use a Cypher query in the JOIN clause of a SQL query. This can be useful for combining data from the graph with data from a relational database. For example:

```
SELECT id,
  graph_query.name = t.name as names_match,
  graph_query.age = t.age as ages_match
FROM schema_name.sql_person AS t
JOIN cypher('graph_name', $$
  MATCH (n:Person)
  RETURN n.name, n.age, id(n)
  $$) as graph_query(name agtype, age agtype, id agtype)
ON t.person_id = graph_query.id;
```
This query will join the sql_person table with the results of the Cypher query, which will return all nodes in the graph with their names, ages, and IDs. The join will be performed on the person_id column.

## Using CTEs with CREATE, REMOVE, and SET: Cypher queries with CREATE, SET, or REMOVE clauses cannot be used in SQL queries with Joins, as they affect the Postgres transaction system. One possible solution is to protect the query with CTEs.

```
WITH graph_query as (
  SELECT * FROM cypher('graph_name', $$
    CREATE (n:Person {name: 'New Person'})
    RETURN n
    $$)
)
SELECT * FROM graph_query;

```
The query above first execute the Cypher query in the CTE, which will create a new node in the graph with the name "New Person". The SQL query will then select all rows from the CTE, returning the new node.

## Querying Multiple Graphs
There is no restriction to the number of graphs an SQL statement can query. Allowing users to query more than one graph at the same time.

```
SELECT graph_1.name, graph_1.age, graph_2.license_number
FROM cypher('graph_1', $$
    MATCH (v:Person)
    RETURN v.name, v.age
$$) as graph_1(col_1 agtype, col_2 agtype, col_3 agtype)
JOIN cypher('graph_2', $$
    MATCH (v:Doctor)
    RETURN v.name, v.license_number
$$) as graph_2(name agtype, license_number agtype)
ON graph_1.name = graph_2.name
```

These are just a few examples of how you can use Cypher queries in SQL/Cypher Hybrid Queries. By using these advanced techniques, you can perform more complex and powerful queries on your graph data. Apache AGE offer a versatile and powerful platform for working with graph and relational data concurrentlyz. To learn more you can visit age [website](https://age.apache.org/) or [github page](https://github.com/apache/age).
Placeholder Contributor
Tags: hack23contributor
Published: 2023-11-11 06:58:22

### Intro
I am Abhishek Pareek, a student at IIT BHU. I already had participated in the hacktoberfest last year but still I am a newbie in the field of open source. GitHub profile link : { % https://github.com/abhishek10pareek %}

### Highs and Lows
While participating I had to work on a repo which required DSA related contribution. As I am currently learning DSA so it was not much of a problem to complete the PRs.

### Growth
My skillset before was NodeJS, Express, MongoDB and PostgreSQL, currently I am learning about React. By participating in hacktoberfest, I brushed up on my skills of DSA which is going to help me in my future placement preparation.
Design Callback Pattern in Java for WorkerContext
Tags: java, backend, programming, designpatterns
Published: 2023-11-11 06:48:30

## Introduction
Callbacks are a prominent programming paradigm in Java that is used for asynchronous and event-driven programming. Callbacks were traditionally created and used by establishing interfaces and putting them into anonymous inner classes, which could result in verbose and crowded code. But lambda expressions, which offer a more concise and expressive method of working with callbacks, were introduced in Java 8.

We'll look at a real-world example in this blog article to see how lambda expressions can make using callbacks in Java easier. We will compare the lambda approach with the old method using a WorkerContext class that uses callbacks to accomplish some work.

## Design Callback Pattern
Let's begin by discussing the traditional approach to callbacks pattern in Java.

```java
interface Callback {
    void call(int data);
}

class WorkerContext {
    private Callback callback;

    public WorkerContext() {}

    public WorkerContext(Callback callback) {
        this.callback = callback;
    }

    public void startWork(int min, int max) {
        if (callback != null) {
            callback.call(ThreadLocalRandom.current().nextInt(min, max + 1));
        }
    }
}
```
The conventional way involves defining a Callback interface with a single call method, utilising an anonymous inner class to generate an instance of the interface, and passing it to the WorkerContext.

## Traditional Way
```java
class Solution {
    public static void main(String[] args) {
        Callback callback = new Callback() {
            @Override
            public void call(int data) {
                System.out.println("Random : " + data);
            }
        };
        WorkerContext workerContext1 = new WorkerContext(callback);
        workerContext1.startWork(0, 100);
    }
}
```

## Lambda Way
Now, let's explore how lambda expressions can simplify the callback process.
```java
class Solution {
    public static void main(String[] args) {
        WorkerContext workerContext2 = new WorkerContext((count) -> System.out.println("Random : " + count));
        workerContext2.startWork(0, 100);
    }
}
```
When constructing the WorkerContext instance via the lambda method, we explicitly describe the callback at that point. As a result, anonymous inner classes and a separate interface specification are not required. 

## Conclusion
Using functional programming concepts in your Java applications is made possible by adopting the lambda approach, which also increases code readability and maintainability.
Hams Live
Tags: translation, company, interpretation
Published: 2023-11-11 06:22:00

HAMSLIVE IS A LEADING NAME IN INTERNATIONAL MARKETING COMMUNICATION SERVICES COMBINED WITH LOCALIZATION SERVICES IN INDIA. OUR SERVICES ASSIST YOU IN INTERNATIONAL MARKETING, PROMOTION AND LOCALIZATION OF YOUR PRODUCTS TO ENABLE EMPIRICISM OF GLOBAL MARKETS.

[](https://hamslive.com/
)
What Is a Line Lock and How Does It Improve Braking?
Published: 2023-11-11 06:20:16

A line lock is a device used in automotive applications, primarily in drag racing and certain performance driving scenarios, to improve braking and assist with controlled burnouts. The primary purpose of a [line lock](https://flasharkracing.com/products/flashark-line-lock-roll-control-brake-lock-universal-launch-line-lock-kit-for-brakes-electric-solenoid-kitblack) is to lock the front brakes of a vehicle while allowing the rear wheels to spin freely. This feature is especially useful in situations where a driver wants to perform a burnout but doesn't want the car to move forward.

Here's how a line lock works and its applications:

How a Line Lock Works: Installation: A line lock is typically installed in the hydraulic brake system of a vehicle, often on the front brake lines [See Youtube Link](https://www.youtube.com/watch?v=_-19qy_lCe13). It's a solenoid-controlled valve that, when activated, traps hydraulic pressure in the front brake lines.

Activation: The driver activates the line lock using a switch or a button inside the vehicle. When activated, the line lock prevents hydraulic pressure from releasing in the front brakes.

Front Brake Lock: With the line lock engaged, the front brakes are locked, preventing the vehicle from moving forward. However, the rear brakes remain unaffected, allowing the rear wheels to spin freely.

Burnouts: This feature is commonly used in drag racing for performing controlled burnouts. The driver can rev the engine, engage the line lock, and spin the rear tires without the car moving forward.

Release: Once the burnout or desired maneuver is completed, the driver releases the line lock, restoring normal brake function to all wheels.

Applications and Benefits: Controlled Burnouts:

The primary application of a line lock is to facilitate controlled burnouts. This is especially popular in drag racing, where warming up the tires for better traction is essential. Launching in Drag Racing:

In drag racing, a line lock can be used to hold the car stationary while the driver revs the engine and builds up torque before launching down the drag strip. Reduced Wear on Transmission:

By allowing the rear wheels to spin independently during a burnout, a line lock can reduce stress on the transmission, as the vehicle isn't trying to move forward against the locked front brakes. Precise Control:

Line locks provide precise control over the braking system, allowing the driver to selectively apply brakes to the front or rear wheels as needed. While line locks can be beneficial in specific performance scenarios, they are not intended for regular on-road use. Engaging in burnouts or excessive tire spinning on public roads can be unsafe and may violate traffic laws. Therefore, the use of line locks is generally limited to controlled environments, such as drag strips or private racing facilities. Always follow local laws and regulations regarding the use of such devices.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hkx5mg7sewwkazhli1on.jpg)
pyenv notes
Tags: learning
Published: 2023-11-11 06:18:17

to install a specific version 

`pyenv install 2.7.18`

to check all the versions

`pyenv versions`

to switch between system and other versions

`pyenv global 2.7.18`

`pyenv global system`

to switch python version for local or a particular shell 

`pyenv local 2.7.18`

`pyenv shell 2.7.18`

to test out the installed version

`pyenv -m test`

to see the current version 

`pyenv -V`


"learn about virtual env using pyenv next"
Twin - Link Truy Cập Trang Chủ Tải Twin68
Published: 2023-11-11 06:16:54

Twin68 nổi tiếng với nhiều thành công rực rỡ, cung cấp lựa chọn cá cược đa dạng và chất lượng, thu hút đông đảo người tham gia và nhận được phản hồi tích cực.
Địa Chỉ: 18b Ng. 28 P. Nguyên Hồng, Láng Hạ, Đống Đa, Hà Nội, Việt Nam
Email: twin68la@gmail.com
Website: https://twin68.la/
Điện Thoại: (+63) 9453077385
#twin #twin68 #twinclub #conggametwin
Social Links:


https://twin68.la/gioi-thieu-twin/
https://twin68.la/bao-mat-twin/
https://twin68.la/dieu-khoan/
https://twin68.la/lien-he-twin/
https://twin68.la/huong-dan/
https://twin68.la/tin-tuc/
https://www.facebook.com/twin68la/
https://twitter.com/twin68la
https://www.youtube.com/channel/UChdnk_GaX80HbF_ID3zQbZw
https://scholar.google.com/citations?user=GV4rtNMAAAAJ&hl=vi
https://www.pinterest.com/twin68la/
https://500px.com/p/twin68la?
https://social.msdn.microsoft.com/Profile/twin68la
https://social.technet.microsoft.com/Profile/twin68la
https://www.skillshare.com/en/user/twin68la
https://soundcloud.com/twin68la
https://bbs.now.qq.com/home.php?mod=space&uid=5906860
https://draft.blogger.com/profile/10649936365040383489
https://twitback.com/twin68la
https://favinks.com/profile/twin68la
https://www.blogger.com/profile/10649936365040383489
https://twin68la.blogspot.com/
https://www.reddit.com/user/twin68la
https://gravatar.com/twin68la
https://medium.com/@twin68la/about
https://www.flickr.com/people/twin68la/
https://www.tumblr.com/twin68la
Passing Test Data to onTestEnd Reporter Method in Playwright
Tags: playwright
Published: 2023-11-11 06:13:38

**Introduction**

When working with Playwright for end-to-end testing, it's essential to gather meaningful data during test execution. In certain scenarios, passing test-specific data, such as configurations or test case details, to the onTestEnd reporter method can be beneficial for comprehensive reporting and analysis. This article provides guidance on how to achieve this in Playwright.

**The Scenario**

Consider a scenario where you have a test suite iterating over a set of records, and you want to pass individual record data to the onTestEnd method for reporting purposes. Here's a simplified example:

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

In the onTestEnd method, you need to access the record object for reporting:

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


**Custom Annotations in Playwright**

To pass data from each test to the `onTestEnd` method, Playwright provides the concept of custom annotations. Annotations are key/value pairs accessible via `test.info().annotations`. While Playwright annotations typically accept key-value pairs, they don't directly support objects. To overcome this limitation, you can stringify the object before storing it in the annotations.

Here's how you can implement this:

**Test Implementation**

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

In this example, JSON.stringify is used to convert the uiRecord object to a string before storing it in the annotations.

**Reporter Implementation**

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

In the onTestEnd method, the description property of the annotation is parsed back into an object using JSON.parse. Now, you have access to the original uiRecord object for reporting.

**Conclusion**
By utilizing custom annotations in Playwright, you can efficiently pass test-specific data, even objects, to the onTestEnd reporter method. This approach enhances the reporting capabilities and allows you to gather valuable insights during your test execution.
Google Sign In and Google Calendar API tutorial with client and server (iOS and Pyhton backend)
Tags: googlecloud, firebase, calendar
Published: 2023-11-11 06:12:59

I'll briefly show you how to do 2 things:
1) Logging in on iOS with Google
2) Getting the access and refresh tokens 

Here are the steps:

Go to Google API and enable Google Calendar
Create OAuth Consent Screen
Generate a OAuth for your frontend (iOS / Android / Web)
Integrate sign in with Firebase
Make sure to add scope on sign in with Google (this is for iOS but similar for other frontends)

            

```
let additionalScopes = [
                "https://www.googleapis.com/auth/calendar.readonly",
                "https://www.googleapis.com/auth/userinfo.email",
                "https://www.googleapis.com/auth/userinfo.profile",
            ]
            let result2 = try await gidSignInResult.user.addScopes(additionalScopes, presenting: getRootViewController())
```

Then a serverAuthCode will be returned. Call a backend POST route to obtain access and refresh tokens (more details here: https://developers.google.com/identity/sign-in/ios/offline-access)

Use Google’s client libraries on backend to generate

 

```
credentials = client.credentials_from_clientsecrets_and_code(
			CLIENT_SECRET_FILE,
			['https://www.googleapis.com/auth/calendar.readonly'],
			auth_code,
			redirect_uri="" # this must be there!
		)
if gcal_access_token:
  creds = Credentials.from_authorized_user_info(
   gcal_access_token,
   scopes=CALENDAR_SCOPES
  )
  print(creds.to_json())
 if not creds or not creds.valid:
  # If the credentials are expired, refresh them
  if creds and creds.expired and creds.refresh_token:
   creds.refresh(Request())
   print(creds.to_json())
```

8. You can then use the creds with the library to get events:

```

   calendar_event_result = service.events().list(
    calendarId="primary",
    singleEvents=False,
    orderBy="updated",
   ).execute()
```

I spent at least 10 hours of my life on navigating this maze due to improper documentation on how to authenticate with google sign in on frontend and then use Google Calendar API on backend, so hope this helps someone!


BY the way, if on the server you get a `redirect_uri_mismatch` bug, make sure to enable your localhost / production urls and then also have `redirect_uri=""` above