teleren/devto huggingface dataset:
The Best Digital Marketing Company In Ambala
Tags: digitalmarketing
Published: 2024-03-01 18:35:36

Navigate the Digital Jungle: Essential Tools for Your Digital Marketing Trek

Imagine venturing into the vast digital landscape, a dense jungle teeming with possibilities. Feeling lost? Fear not! With the right tools and knowledge, you can become a skilled explorer, navigating this ever-evolving terrain and connecting with your target audience.

Think of your website as your base camp. Here, tools like Google Search Console and keyword research platforms act as your map and compass, ensuring your website is easily found by search engines. Content marketing fuels your journey. Platforms like blogs, social media, and email marketing let you create engaging content that attracts and retains customers, like building campfires to lure and warm weary travelers.

And just like checking water levels on your trek, data analytics tools like Google Analytics and social media platform insights provide valuable information on website traffic, audience demographics, and campaign performance, helping you refine your strategies for a smoother journey.

At Teemers, we're a passionate group of skilled professionals with a singular mission to deliver exceptional IT solutions that transform businesses. We engage your audience with intuitive, visually stunning UI/UX design, digital marketing, development and customized software.. 

Remember, this isn't a one-time excursion, but an ongoing exploration. By understanding your target audience, setting clear goals, experimenting and adapting, and staying informed, you'll possess the essential tools to navigate the digital jungle and achieve your marketing goals.


For more info, visit our website : https://teemers.in
Easy, automated macOS setup
Tags: macos, webdev, productivity, shell
Published: 2024-03-01 18:31:33

If you're like me, setting up your Mac manually after a format or clean install can be a tedious task.
It's a time-consuming, repetitive process that I'd rather skip. 
So, in a burst of frustration, I created a script to automate the whole process.

[install.sh:](https://github.com/donnybrilliant/install.sh)
It's a simple bash script that performs a variety of tasks to prepare a macOS machine for use:

- Updates macOS to the latest version.
- Installs Homebrew, the package manager for macOS.
- Installs essential software and applications through Homebrew casks and formulae.
- Offers the choice between installing Node.js via NVM (Node Version Manager) or Homebrew.
- Installs global NPM packages.
- Provides options to install additional software, such as .NET, Firefox Developer Edition, PostgreSQL, MySQL, MongoDB, Epic & Steam, Unity Hub, and Figma.
- Cleans up the installation environment by running `brew cleanup` and other maintenance commands.
- Sets up Git with global username and email configurations.
- Installs VSCode extensions.
- Installs selected apps from the App Store using `mas` (Mac App Store command-line interface).
- Installs and configures ohmyzsh for a better terminal experience.
- Applies custom system settings and Dock configurations to optimize the user experience.
- Automatically updates Homebrew installed packages with a specified frequency.

Just clone the repo, tweak the config file to your liking, and run it. It's that simple.
It's set up to my liking as a web developer by default.

Here's the link to the script on GitHub: [https://github.com/donnybrilliant/install.sh](https://github.com/donnybrilliant/install.sh)

I'm hoping it can save you some time and make setting up your Mac a bit easier.
It's designed to be a starting point, so I'm really keen to hear your feedback, suggestions for improvements, or any cool tweaks you'd add.
Leetcode Daily Question - 2864. Maximum Odd Binary Number
Tags: learning, cpp, beginners
Published: 2024-03-01 18:11:07


When given a binary string containing at least one '1', the task is to rearrange the bits to create the maximum odd binary number possible. To achieve this, it's essential to understand the optimal positioning of the '1's within the string to maximize the resulting value.

## Understanding the Approach

The key to forming the greatest odd number lies in placing the '1's in a specific manner. By placing the rest of the '1's in front of the string and having the final '1' at the end, we can ensure that the resulting binary number is the maximum odd number possible.

### Formulating the Result
The resulting string can be expressed as:

``` (total-1 '1's) + (total '0's) + '1' ```

By employing this strategy, it becomes possible to rearrange the given binary string to form the maximum odd binary number, optimizing the positioning of the '1's to achieve the desired result.


## Code 
``` c++
class Solution {
public:
    string maximumOddBinaryNumber(string s) {

        int c1=0, c0=0;
        for (auto a: s)
        {
            if(a=='1') c1++;
            else c0++;
        }

        return (string(c1-1, '1') + string(c0,'0') + '1');
        
    }
};
```
How to Cache in NodeJs APIs
Tags: node, api, express, frameworkx
Published: 2024-03-01 17:54:17

Speed is what all web/mobile apps need. And with growing database size, the speed is the first thing that takes a hit. Comes cache to rescue.

A cache can be defined as storing data in RAM for quick access (faster than getting data from DB), also we can store the results for regular calculations in the cache to save time on recalculation again and again.

There are various types of available caches, you can research that for a more detailed understanding. We will not cover that in the scope of this article.

## How to implement cache

Implementing a cache is more or less a kind of art, depending on your requirements and available methodologies. What I prefer is using Redis for cache. It's easy to use, fast and reliable.

**Installation**

```
npm install redis
```

**Usage**

```
const { createClient } = require("redis")

const  cacheing = async () => {
    let redisConfig = {
        host: "localhost",
        port: 6379,
        username: "",
        password: "",
        database: 0
    }

    const client = createClient(redisConfig)

    client.on("error", (err) => console.log("Redis Client Error", err))
    await client.connect()

    // setting cache
    await client.set("key", "string_value")

    // getting cache
    const value = await client.get("key");
    //If the key does not exist, the value will be null
}

```

## OR

**or you can use Framework X (AKA Fx). Which comes with a supper charges cache in build. Fx cache not only caches your data but also updates the cached data in a given duration so that your cache never goes out of new data, checking when the given data was accessed. AND all this with an implementation time of less than a min.**

To Know about how to get started with Fx, [please follow this link.
](https://codebysamgan.com/how-to-create-rest-api-in-nodejs)

Once up and running, you can use the cache as follows.

```
const { setCache, getCache } = require("@3rdplanet/x-core/cache")

exports.index = async (req, res) => {
    let responseData = await getCache(req.url)

    if (responseData) {
        return res.send(successResponse("cache found...", responseData.response))
    }

    let someCalculationAnswer = someCalculations(1, 1, 1)

    setCache(req.url, someCalculationAnswer, {
        function: someCalculations,
        params: [1, 1, 1]
    }).then(() => {})

    return res.send(successResponse("cache in progress...", someCalculationAnswer))
}
```

Also, you will need to add the following keys in your .env file.

- CACHE_UPDATE_INTERVAL - The interval in seconds to update the cache. The default is 10 seconds.
- CACHE_EXPIRE_TIME - The time in seconds to expire the cache. The default is 60 seconds.

You can learn more about [Fx cache here.](https://www.frameworkx.info/docs/overview/cache)

Feel free to ask questions in the comments if you have any sort of doubts or queries.
USDY chega na Sui como nova alternativa nativa para Stablecoin
Tags: web3, move, blockchain, sui
Published: 2024-03-01 17:51:49


### A alternativa de stablecoin criada pela Ondo Finance, USDY, torna-se disponível como um ativo nativo no Sui.

![Stablecoin Nativa da Sui, USDY](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1b2567h2fvlj38qx2fqe.png)


O sucesso do DeFi na Sui, com o valor total bloqueado (TVL) ultrapassando meio bilhão de dólares em apenas nove meses, é ainda mais reforçado pelo lançamento de uma nova  [stablecoin alternativa](https://blog.sui.io/stablecoins-explained/), USDY, na rede este mês. Como uma alternativa de stablecoin, o valor do USDY é atrelado ao dólar americano numa base um-para-um (1:1), enquanto também gera rendimentos para os proprietários, o que na formulação atual acrescenta ao preço do token.

A Ondo Finance, criadora da stablecoin alternativa USDY, respalda a moeda com títulos do Tesouro dos EUA de curto prazo e depósitos à vista em bancos. O nome da moeda significa US Dollar Yield, significando sua característica de gerar rendimentos.

Stablecoins como USDC e USDT, uma categoria similar ao USDY, podem ser negociadas na Sui. No entanto, estas são moedas não nativas que são transferidas para a rede e encapsuladas (wrapped) em um contrato inteligente para torná-las negociáveis nas DEXs da Sui.

Nos últimos seis meses, o site de análise de dados [Wormholescan](https://wormholescan.io/?ref=blog.sui.io) mostrou que mais de $300 milhões em ativos foram transferidos do Ethereum para a Sui, representando 64% (por cento) de todas as moedas transferidas da Ethereum através do [Wormhole](https://wormhole.com/?ref=blog.sui.io). Das stablecoins USDC e USDT existentes, o Wormholescan mostra que o Sui emite $46 milhões da primeira e $18 milhões da segunda, tornando-o um local de destaque para essas stablecoins.

A disponibilidade do USDY na Sui oferece aos usuários do DeFi uma opção de moeda atrelada ao valor do dólar americano e acumulando juros.

*Nota: Este conteúdo é apenas para fins educacionais e informativos gerais e não deve ser interpretado ou utilizado como endosso ou recomendação para comprar, vender ou manter qualquer ativo, investimento ou produto financeiro e não constitui aconselhamento financeiro, legal ou tributário.*

Leia a matéria original: [Clique aqui](https://blog.sui.io/ondo-stablecoin-alternative-usdy/)

Traduzido por: [b1gvini](x.com/b1gb0tdev)

*Considere fazer uma doação - sui wallet: b1gvini.sui*
Playing with Python in node
Tags: python, node, runtime, environment
Published: 2024-03-01 17:48:04

Good days of playing with 🔥 just to get burned are still alive. Just like playing with python in node and forcing the square in a circle. What an experience!

Just like that, 👻 has a lot of brain to injure. 

Just wrote a quick package to tryout for 🏃‍♂️ python in a node environment.Can we argue, if this is native or just trying to be native? Guess it is for you to find out. 

Hit that click on your computer and head to **npm**, search `py-em-node`. Found it already. Read the guide and try it out on your python project. Tiny video will be coming soon for a sample usage.

[Py-em-node](https://www.npmjs.com/package/py-em-node)

[![Py-em-node-sample-video](//img.youtube.com/vi/ByRaGhVCKPQ/0.jpg)](//www.youtube.com/watch?v=ByRaGhVCKPQ)

By default, I had it tested on a flask project. It worked amazing! Not really amazing like amazing but amazing 😅, Something is totally working...

**Updates on testing**

- 
 Works with FastAPI via explicitly controlling unicorn this way in your `entryPoint` like main.py: 

```python
# Import uvicorn at start of `entryPoint` file could be app.py, main.py or other

import uvicorn

if __name__ == "__main__":
# Configure to needs of project, this is the same as command on terminal or cmd
   uvicorn.run("main:app", reload=True)
```

**Changes** 

- 
Use `python.config.json ` for `py-em-node`, `python.config.tson` has been removed from support

- Documentation is updated to the latest version released.

All was needed was to setup python like the `venv` stuff and have requirements met. 

Go check it out, if you have anything to ask or add, feel free to visit the repo on GitHub and create an issue or something good to make a difference.

Must have been a quick read, 👻 have already disappeared.
useRefreshScreensStore Hook
Published: 2024-03-01 17:46:50

```
import { useState, useEffect } from 'react';
import { getFocusedRouteNameFromRoute, useRoute } from '@react-navigation/native';
import { useRefreshScreensStore } from '../stores/stores';

function useRefreshScreens() {
    const [shouldRefresh, setShouldRefresh] = useState(false);

    const refreshScreen = useRefreshScreensStore(state => state.refreshScreen);
    const scheduleRefresh = useRefreshScreensStore(state => state.scheduleRefresh);
    const refreshScreens = useRefreshScreensStore(state => state.refreshScreens);

    const route = useRoute();

    const scheduleRefreshScreen = (screen) => {
        scheduleRefresh(screen);
    }

    useEffect(() => {
        const routeName = getFocusedRouteNameFromRoute(route) || route.name;

        if (refreshScreens.includes(routeName)) { setShouldRefresh(true); refreshScreen(routeName) }
        else { setShouldRefresh(false) }
    }, [route, refreshScreens, refreshScreen]);

    return { shouldRefresh, scheduleRefreshScreen };
}

export default useRefreshScreens;
```
useRefreshScreensStore
Published: 2024-03-01 17:44:50

```
const useRefreshScreensStore = create((set) => ({
    refreshScreens: [],
    scheduleRefresh: (screen) => {
        set((state) => ({ refreshScreens: [...state.refreshScreens, screen] }));
    },
    refreshScreen: (screen) => {
        set((state) => ({ refreshScreens: state.refreshScreens.filter((item) => item !== screen) }));
    }
}));

```
useDrawerSheetStore
Published: 2024-03-01 17:44:11

```
const useDrawerSheetStore = create((set) => ({
    drawerSheets: {},
    currentRoute: null,
    previousRoute: null,
    addDrawerSheet: (drawerSheetObject) => {
        set((state) => {
            const drawerSheets = { ...state.drawerSheets };

            if (drawerSheets[drawerSheetObject.name]) { drawerSheets[drawerSheetObject.name].children = drawerSheetObject.children }
            else { drawerSheets[drawerSheetObject.name] = drawerSheetObject }

            return { drawerSheets: drawerSheets };
        });
    },
    removeDrawerSheet: (drawerSheetName) => {
        set((state) => {
            const drawerSheets = { ...state.drawerSheets };
            delete drawerSheets[drawerSheetName];
            return { drawerSheets: drawerSheets };
        });
    },
    openDrawerSheet: (drawerSheetName) => {
        set((state) => {
            const drawerSheets = { ...state.drawerSheets };
            drawerSheets[drawerSheetName].open = true;
            return { drawerSheets: drawerSheets };
        });
    },
    closeDrawerSheet: (drawerSheetName) => {
        set((state) => {
            const drawerSheets = { ...state.drawerSheets };
            drawerSheets[drawerSheetName].open = false;
            return { drawerSheets: drawerSheets };
        });
    },
    toggleDrawerSheet: (drawerSheetName) => {
        set((state) => {
            const drawerSheets = { ...state.drawerSheets };
            drawerSheets[drawerSheetName].open = !drawerSheets[drawerSheetName].open;
            return { drawerSheets: drawerSheets };
        });
    },
    updateDrawerSheetOpen: (drawerSheetName, open) => {
        set((state) => {
            const drawerSheets = { ...state.drawerSheets };
            drawerSheets[drawerSheetName].open = open;
            return { drawerSheets: drawerSheets };
        });
    },
    updateNavigationState: (navigationState) => {
        const currentRoute = getCurrentRouteFromNavigationState(navigationState);
        set((state) => ({ currentRoute: currentRoute, previousRoute: state.currentRoute }));
    }
}));

```
Eartho vs. Auth0 - Choosing the right access management solution
Published: 2024-03-01 17:39:18

I'm building a new application and I'm trying to decide between Eartho and Auth0 for user authentication and access management. I've been reading up on both platforms, but I'm still not sure which one is the better fit for my needs.

Here's what I'm looking for:

Ease of integration: I want a solution that's easy to integrate with my existing codebase.
Features: I need a platform that offers the features I need, such as user authentication, authorization, and gated content.
Pricing: I'm on a budget, so I need to find a solution that's affordable.
I've heard good things about Eartho's simplicity and free tier, but I'm also aware of Auth0's established reputation and wider range of features.

I'd love to hear from experienced developers who have used both Eartho and Auth0. What are your thoughts on each platform? Which one would you recommend and why?

Additionally, if there are any other access management solutions that you would recommend, please share your thoughts on those as well.

This question is designed to be neutral and objective, avoiding any bias towards either platform. It also clearly outlines the specific criteria you are looking for in a solution, which will help developers provide more relevant and informative responses.
Elevating SQL Server Database Management With System-Versioned Temporal Tables and dbForge Studio
Tags: sql, sqlserver, dbforge, devart
Published: 2024-03-01 17:34:43

Retrieving historical data from earlier times is frequently crucial in the field of data management, particularly when working with databases. On the other hand, database data is ever-changing due to the constant removal of old records, the addition of new ones, and the creation of new associations. Getting to old data, which might not be in its original form anymore, is a huge problem.

Applying strategies for managing historical data holds the key. The primary means by which this is accomplished in SQL Server are through temporal or system-versioned tables.

Understanding system-versioned tables is the focus of this article. We will take a look at what makes them unique, show you how to make these tables, and then show you some practical ways to query them efficiently.

Read more: https://blog.devart.com/system-versioned-temporal-tables-in-sql-server.html
Atlas
Published: 2024-03-01 17:25:31

```
import CountryFlagMappings from "./atlas-countryflags";
import CountryCitiesData from "./atlas-countrycity";
import CountryDialCodesMapping from "./atlas-countrydialcodes";
import CurrenciesData from "./atlas-currencies";

function CountryFlagEmoji(country) {
    try {
        const shortCode = CountryFlagMappings[country.trim()]; 
        return String.fromCodePoint(...[...shortCode.toUpperCase()].map(x=>0x1f1a5+x.charCodeAt(0)));
    }
    catch (error) {
        return '🌐';
    }
}

function GetCountries() {
    return Object.keys(CountryCitiesData);
}

function GetCountriesWithFlags() {
    const countries = Object.keys(CountryCitiesData);

    const countriesWithFlags = countries.map(country => {
        return {
            label: `${CountryFlagEmoji(country)} ${country}`,
            value: country
        }
    });

    return countriesWithFlags;
}

function GetCitiesByCountry(country) {
    return CountryCitiesData[country];
}

function GetCountryDialCodes() {
    return CountryDialCodesMapping;
}

function GetDialCodesByCountry(country) {
    return CountryDialCodesMapping[country];
}

function GetCountryByDialCode(dialCode) {
    const countries = GetCountries();
    const country = countries.find(country => CountryDialCodesMapping[country] === dialCode);
    return country;
}

function GetCurrencies() {
    return Object.keys(CurrenciesData);
}

function GetCurrenciesArray() {
    const currencies = GetCurrencies();

    const currenciesArray = Object.keys(currencies).map(currency => {
        return {
            label: `${currency} (${currencies[currency]})`,
            value: currencies[currency]
        }
    });

    return currenciesArray;
}

function GetCurrencyCodeByName(name) {
    return CurrenciesData[name];
}

function GetCurrencyNameByCode(code) {
    const currencies = GetCurrencies();
    const currency = currencies.find(currency => CurrenciesData[currency] === code);
    return currency;
}

export { CountryFlagEmoji, GetCountries, GetCountriesWithFlags, GetCitiesByCountry, GetCountryDialCodes, GetDialCodesByCountry, GetCountryByDialCode, GetCurrencies, GetCurrenciesArray, GetCurrencyCodeByName, GetCurrencyNameByCode };
```
JavaScript: Variables
Published: 2024-03-01 17:17:42

Welcome back to JavaScript programming, today we are going to discuss about the variables.

**What is a Varible?**
Variables are used to store the values in it.We can use those variables in every where we want and can change the value of that variable.
In JavaScript we can define variables in 3 types:
1. Using **Var **keyword
2. Using **let**keyword
3. Using **const**keyword
Now, we took deeper into these types with some examples:
1.**Var**: It is used to declare variables in javascript that are function-scoped. The **var** statement is also used to declare global-scope variables.

Note: Before ES6 introduction, all the keywords in JavaScript were declared with the **var** keyword.

2.**let**: JavaScript **let** keyword is used to declare variables that are block-scoped. Variables defined with the let keyword cannot be redeclared in the same scope and must be declared before use.

Note:**let** keyword was added in the ES6 or ES2015 version of javascript.

3.**const**:It was also introduced in ES62015(ES6) the const keyword to define a new variable. Variables declared using const keyword cannot be re-assigned.

Note:Variables specified using **const** cannot be redeclared and have block-scope.

We can discuss more about the scoping in the next lecture.

See you soon...🤠🤠🤠
Aphrodite
Published: 2024-03-01 17:16:37

```
class Aphrodite {
    static FormatToTwoDigits(number) {
        const parsed = parseInt(number);
        return parsed < 10 ? `0${parsed}` : parsed;
    }

    static FormatNumbers(number, localeCode = 'en-IN') {
        const parsed = parseInt(number);
        return parsed.toLocaleString(localeCode, { maximumFractionDigits: 2 });
    }

    static FormatSize(bytes) {
        const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];
        if (bytes === 0) return '0 Byte';

        const i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)));
        return `${Math.round(bytes / Math.pow(1024, i), 2)} ${sizes[i]}`;
    }

    static FormatCommaSeparatedString(...args) {
        return args.filter(arg => !!arg).join(', ');
    }
}

export default Aphrodite;
```
react-native-haptic-feedback
Published: 2024-03-01 17:10:26


```
import { trigger } from "react-native-haptic-feedback";

const FeedbackType = {
    ImpactLight: 'impactLight',
    ImpactMedium: 'impactMedium',
    ImpactHeavy: 'impactHeavy',

    Rigid: 'rigid',
    Soft: 'soft',

    NotificationSuccess: 'notificationSuccess',
    NotificationWarning: 'notificationWarning',
    NotificationError: 'notificationError',
}

class Pandora {
    static get FeedbackType() {
        return FeedbackType;
    }

    static TriggerFeedback(feedbackType = FeedbackType.ImpactMedium) {
        trigger(feedbackType);
    }
}

export default Pandora;
```