Snippets Collections
<script>
  let items = document.querySelector(".header__inline-menu").querySelectorAll("details");
  console.log(items)
  items.forEach(item => {
    item.addEventListener("mouseover", () => {
      item.setAttribute("open", true);
      item.querySelector("ul").addEventListener("mouseleave", () => {
        item.removeAttribute("open");
      });
    item.addEventListener("mouseleave", () => {
      item.removeAttribute("open");
    });
  });
  
  });
</script>                                   
javascript: (function () {
  const query = prompt("Search App Store", document.getSelection().toString());
  if (query) {
    window.open(
      `itms-apps://search.itunes.apple.com/WebObjects/MZSearch.woa/wa/search?media=software&term=${encodeURIComponent(query)}`,
    );
  }
})();
package pl.pp;

import java.util.Scanner;
public class mySecondApp {
    public static void main(String[] args) {

        //this is a line comment
        Scanner scanner = new Scanner(System.in);

            /*
             This is a block comment
             it can have multiple lines
             just like here
             */

        double x = 10; // creating a double type variable and assigning it a value of 10
        double y = 2;
        scanner = new Scanner(System.in);

        var result = x + y;
        System.out.println("x + y = " + result);

        result = x - y;
        System.out.println("x - y = " + result);

        result = x * y;
        System.out.println("x * y = " + result);

        result = x / y;
        System.out.println("x / y = " + result);

        result = x % y;
        System.out.println("x % y = " + result);

        System.out.println("Enter two numbers separated by the Enter key:");
        double first = scanner.nextDouble(); //reguest to enter a double value
        double second = scanner.nextDouble();

        System.out.println("x + y = " + (first + second));

        System.out.println("Please enter your name:");
        String forename = scanner.nextLine();
        System.out.println("Please enter your surname:");
        String surname = scanner.nextLine();

        scanner.close();
        System.out.println("Welcome " + forename + " " + surname);
    }
}
@bot.message_handler(commands=['start'])
def start_message(message):
    bot.send_message(message.chat.id, 'Выбирай что хочешь узнать', reply_markup=keyboard1)

@bot.message_handler(commands=['start'])
def start_message(message):
    bot.send_message(message.chat.id, 'Привет. Вводи город или страну для того, чтобы узнать погоду')





weath = ['На улице пипец, лучше сиди дома','Ну, и куда ты намылился в такую погоду?''','Доставай валенки, мы идём гулять']
weath2 = ['На улице норм, можешь выходить и особо не утепляться','Прохладно, надевай что-нибудь от ветра','Полёт нормальный, косуха в самый раз']
weath3 = ['На улице очень жарко, можешь выходить в трусах','Жарево, выходи в футболке', 'Солненчо и душно, как в Египте']





@bot.message_handler(content_types=['text'])
def send_text(message):
    observation = owm_ru.weather_at_place(message.text)
    w = observation.get_weather()
    temp = w.get_temperature('celsius')["temp"]
    answer = ' В городе / стране ' + message.text + ' сейчас ' + w.get_detailed_status() + "\n"
    answer += 'Температура составляет ' + str(temp) + "\n-------------------------------------------\n"
    if temp < 10:
        answer +=random.choice(weath)
    elif message.text == 'Привет':
        bot.send_message(message.chat.id, 'Привет. Хочешь узнать погоду? Введи страну или город. ')
    elif temp < 20:
        answer+=random.choice(weath2)
    else:
        answer+=random.choice(weath3)
    bot.send_message(message.chat.id, answer)

@bot.message_handler(content_types=['text'])
def send_text(message):
    if message.text == 'Привет':
        bot.send_message(message.chat.id, 'Привет. Хочешь узнать погоду? Введи страну или город. ')
    elif message.text == 'Пока':
        bot.send_message(message.chat.id, 'До скорого!')





keyboard1 = telebot.types.ReplyKeyboardMarkup()
keyboard1.row('Привет','Пока')
@bot.message_handler(content_types=['text'])
def send_text(message):
    if message.text == 'Привет':
        bot.send_message(message.chat.id, 'Привет. Хочешь узнать погоду? Введи страну или город. ')
    elif message.text == 'Пока':
        bot.send_message(message.chat.id, 'До скорого!')




bot.polling( none_stop = True )
#!venv/bin/python
import logging
from aiogram import Bot, Dispatcher, executor, types

# Объект бота
bot = Bot(token="12345678:AaBbCcDdEeFfGgHh")
# Диспетчер для бота
dp = Dispatcher(bot)
# Включаем логирование, чтобы не пропустить важные сообщения
logging.basicConfig(level=logging.INFO)


# Хэндлер на команду /test1
@dp.message_handler(commands="test1")
async def cmd_test1(message: types.Message):
    await message.reply("Test 1")


if __name__ == "__main__":
    # Запуск бота
    executor.start_polling(dp, skip_updates=True)
import math
import os
import random
import re
import sys

# Complete the 'timeConversion' function below.

# The function is expected to return a STRING.
# The function accepts STRING s as parameter.


def timeConversion(s):
    TS = s[-2:]
    if TS == "PM" and s[:2] != "12":
        s = str(12 + int(s[:2])) + s[2:]
    if TS == "AM" and s[:2] == "12":
        s = "00" + s[2:]
    return s[:-2]

if __name__ == '__main__':
    fptr = open(os.environ['OUTPUT_PATH'], 'w')

    s = input()

    result = timeConversion(s)

    fptr.write(result + '\n')

    fptr.close()
import math
import os
import random
import re
import sys

# Complete the 'miniMaxSum' function below.
# The function accepts INTEGER_ARRAY arr as parameter.

def miniMaxSum(arr):
    min_sum = sum(arr[1:])
    max_sum = sum(arr[1:])
    len_of_arr = len(arr)

    
    for i in range(len_of_arr):
        temp = 0
        for j in range(len_of_arr):
            if j==i:
                continue
            else:
                temp += arr[j]
        
        if temp < min_sum:
            min_sum = temp
        if temp > max_sum:
            max_sum = temp
            
    print(min_sum, max_sum)
            

if __name__ == '__main__':

    arr = list(map(int, input().rstrip().split()))

    miniMaxSum(arr)
char[] task = new char[]{'a', 'b', 'c', 'c', 'd', 'e'};
        Map<Character, Long> map = IntStream.range(0, task.length)
                .mapToObj(idx -> task[idx]).collect(Collectors.groupingBy(Function.identity(), Collectors.counting()));
<script crossorigin src="https://unpkg.com/react@18/umd/react.development.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@18/umd/react-dom.development.js"></script>
int minimumBoxes(int* apple, int appleSize, int* capacity, int capacitySize) {

    

}
import { useState } from "react";

function useGeolocation() {
  const [isLoading, setIsLoading] = useState(false);
  const [position, setPosition] = useState({});
  const [error, setError] = useState(null);

  function getPosition() {
    if (!navigator.geolocation)
      return setError("Your browser does not support geolocation");

    setIsLoading(true);
    navigator.geolocation.getCurrentPosition(
      (pos) => {
        setPosition({
          lat: pos.coords.latitude,
          lng: pos.coords.longitude
        });
        setIsLoading(false);
      },
      (error) => {
        setError(error.message);
        setIsLoading(false);
      }
    );
  }

  return { isLoading, position, error, getPosition };
}

export default function App() {
  const {
    isLoading,
    position: { lat, lng },
    error,
    getPosition
  } = useGeolocation();

  const [countClicks, setCountClicks] = useState(0);

  function handleClick() {
    setCountClicks((count) => count + 1);
    getPosition();
  }

  return (
    <div>
      <button onClick={handleClick} disabled={isLoading}>
        Get my position
      </button>

      {isLoading && <p>Loading position...</p>}
      {error && <p>{error}</p>}
      {!isLoading && !error && lat && lng && (
        <p>
          Your GPS position:{" "}
          <a
            target="_blank"
            rel="noreferrer"
            href={`https://www.openstreetmap.org/#map=16/${lat}/${lng}`}
          >
            {lat}, {lng}
          </a>
        </p>
      )}

      <p>You requested position {countClicks} times</p>
    </div>
  );
}
#include <stdio.h>
int main (void) {
    double AmountOfCement;
    int iTotalCost, NumberOfBags;
    scanf ("%lf", &AmountOfCement);
    NumberOfBags = (int) (AmountOfCement/120 + 1);
    iTotalCost = NumberOfBags * 45;
    printf ("%d", iTotalCost);
    return 0;
}
Add Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation NuGet package to the project

Add the following in Startup.cs/Program.cs:

services.AddControllersWithViews().AddRazorRuntimeCompilation();
List<Integer> al = new ArrayList<Integer>();
al.add(10);
al.add(20);
 
Integer[] arr = new Integer[al.size()];
arr = al.toArray(arr);
 
for (Integer x : arr)
   System.out.print(x + " ");
# import the module
import python_weather

import asyncio
import os

async def getweather():
  # declare the client. the measuring unit used defaults to the metric system (celcius, km/h, etc.)
  async with python_weather.Client(unit=python_weather.IMPERIAL) as client:
    # fetch a weather forecast from a city
    weather = await client.get('New York')
    
    # returns the current day's forecast temperature (int)
    print(weather.current.temperature)
    
    # get the weather forecast for a few days
    for forecast in weather.forecasts:
      print(forecast)
      
      # hourly forecasts
      for hourly in forecast.hourly:
        print(f' --> {hourly!r}')

if __name__ == '__main__':
  # see https://stackoverflow.com/questions/45600579/asyncio-event-loop-is-closed-when-getting-loop
  # for more details
  if os.name == 'nt':
    asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
  
  asyncio.run(getweather())
$ pip install python-weather
# import the module
import python_weather

import asyncio
import os

async def getweather():
  # declare the client. the measuring unit used defaults to the metric system (celcius, km/h, etc.)
  async with python_weather.Client(unit=python_weather.IMPERIAL) as client:
    # fetch a weather forecast from a city
    weather = await client.get('New York')
    
    # returns the current day's forecast temperature (int)
    print(weather.current.temperature)
    
    # get the weather forecast for a few days
    for forecast in weather.forecasts:
      print(forecast)
      
      # hourly forecasts
      for hourly in forecast.hourly:
        print(f' --> {hourly!r}')

if __name__ == '__main__':
  # see https://stackoverflow.com/questions/45600579/asyncio-event-loop-is-closed-when-getting-loop
  # for more details
  if os.name == 'nt':
    asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
  
  asyncio.run(getweather())
const genDTO = (className, id) => {
  var fields = [
    'package com.voltcash.integrations.opencp.common.dto; ',
    '\n',
    'import com.voltcash.integrations.common.dto.BaseJsonEntity; ',
    'import lombok.Data;',
     '\n',
    '@Data ',
    'public class '+ className +' extends BaseJsonEntity{ ' 
  ];
 var declarations = $('#' + id).parentNode.querySelectorAll('td:first-child strong').forEach(e => fields.push('private String ' + e.innerHTML + ';'));
  
  fields.push('}');
  
  console.log(fields.join('\n'));
}
pip uninstall pyinstaller

pip install https://github.com/pyinstaller/pyinstaller/archive/develop.zip
pip uninstall pyinstaller

pip install https://github.com/pyinstaller/pyinstaller/archive/develop.zip
sudo apt update # Update the Package
sudo apt-get install docker.io # Install Docker on Ubuntu
String arr[] = { "ABC", "DEF", "GHI", "JKL" }; 
ArrayList<String> array_list = new ArrayList<String>();
Collections.addAll(array_list, arr);
add_shortcode('whatsapp_message_url', 'gerar_link_whatsapp_produto2');

function gerar_link_whatsapp_produto2() {
    global $product;
    if (!$product) {
        return 'Produto não disponível.';
    }

    $whatsapp_number = get_option('site-config')['whatsapp_number'];
    $sku_exibe = get_option('site-config')['sku_exibe'];

    if (empty($whatsapp_number)) {
        return 'Número do WhatsApp não configurado.';
    }

    $post_id = $product->get_id();
    $post_title = get_the_title($post_id);
    $post_url = get_permalink($post_id);

    $message = "Olá, gostaria de saber mais sobre este produto:\n\n";
    $message .= "*Produto:* {$post_title}\n";
    $message = htmlentities($message);

    $message_id = uniqid('msg_');

    ob_start();
    ?>
    <script>
    (function($) {
        $(document).ready(function() {
            var messageSelector = '#<?php echo $message_id; ?>';
            var variationForm = $('.variations_form');
            
            variationForm.on('found_variation', function(event, variation) {
                var variationDetails = '';

                <?php if ($sku_exibe === 'true'): ?>
                var productSku = variation.sku ? "*SKU:* " + variation.sku + '\n' : '';
                variationDetails += productSku;
                <?php endif; ?>
                
                var productVariationPrice = variation.display_price ? "*Preço:* R$ " + variation.display_price.toFixed(2).replace('.', ',') + '\n' : '';
                variationDetails += productVariationPrice;

                $.each(variation.attributes, function(key, value) {
                    if (value) {
                        var attribute_name = key.replace('attribute_', '');
                        var normalized_name = attribute_name.replace(/pa_/, '').replace(/_/g, ' ');
                        var cleanValue = value.replace(/-/g, ' ').replace(/^pa_/, '');
                        variationDetails += "*" + normalized_name.capitalize() + ":* " + cleanValue + '\n';
                    }
                });

                variationDetails += "*Link do Produto:* " + "<?php echo $post_url; ?>\n\n";
                var fullMessage = $(messageSelector).data('base-message') + variationDetails + "Obrigado.";
                $(messageSelector).attr('href', function() {
                    return $(this).data('base-url') + '&text=' + encodeURIComponent(fullMessage);
                });
            }).trigger('update_variation_values');
        });

        // Função para capitalizar a primeira letra de cada palavra
        String.prototype.capitalize = function() {
            return this.replace(/(?:^|\s)\S/g, function(a) { return a.toUpperCase(); });
        };
    })(jQuery);
    </script>
    <?php
    $script = ob_get_clean();

    $whatsapp_base_url = "https://api.whatsapp.com/send?phone={$whatsapp_number}";
    $encoded_message = urlencode($message);
    $link = "{$whatsapp_base_url}&text={$encoded_message}";

    return "<a href='{$link}' target='_blank' class='whatsapp-link' id='{$message_id}' data-base-message='{$message}' data-base-url='{$whatsapp_base_url}'>
        <i class='fab fa-whatsapp icon'></i>Pedir via WhatsApp</a>{$script}";
}
SELECT SubscriberKey, EmailAddress,Consent_Level_Summary__c, Region
FROM EP_Standard_Seedlist
SELECT mst.SubscriberKey,mst.EmailAddress, mst.Consent_Level_Summary__c, mst.FirstName, mst.LastName, mst.CreatedDate, 
mst.Mailing_Country__c, mst.SegmentRegion, mst.LanguageCode, mst.AMC_Status__c,mst.Job_Role__c,mst.AMC_Last_Activity_Date__c, mst.Region,mst.Industry_Level_2_Master__c, mst.Industry__c

FROM [ep_mr_en_us_w170049_MASTER] mst
LEFT JOIN [ep_mr_en_us_w170049_Exclusions_Dealers_Agency_Competitor] e ON LOWER(mst.EmailAddress) = LOWER(e.EmailAddress)
WHERE e.EmailAddress IS NULL
  @mixin respond($breakpoint) {
    @if($breakpoint == medium)  {
      @media (max-width: 900px) { @content }
    }
    @if($breakpoint == small)  {
      @media (max-width: 600px) { @content }
    }
  }
 @mixin respond-medium {
    @media (max-width: 900px) { @content }
  }
<?php
function remove_title_tag_on_blog_posts($title_parts)
{
    global $template;
    $templateName =  basename($template);
    if ($templateName === 'single-post.php') {
        $title_tag_blog_post = get_field('title_tag_blog_post');
        if ($title_tag_blog_post) {
            $title_parts['title'] = $title_tag_blog_post;
        }
    }
    return $title_parts;
}

add_filter('document_title_parts', 'remove_title_tag_on_blog_posts', 10);
new PerformanceObserver((entryList) => {
  for (const entry of entryList.getEntriesByName('first-contentful-paint')) {
    console.log('FCP candidate:', entry.startTime, entry);
  }
}).observe({type: 'paint', buffered: true});
[
    {
        $group: {
            _id: "$participantId",
            documents: { $push: "$$ROOT" },
            count: { $sum: 1 }
        }
    },
    {
        $match: {
            count: { $gt: 1 }
        }
    },
    {
        $unwind: "$documents"
    },
    {
        $match: {
            "documents.programCode": { $ne: "" }
        }
    },
    {
        $group: {
            _id: {
                participantId: "$_id",
                programCode: "$documents.programCode",
                programStartDate: "$documents.programStartDate"
            },
            documents: { $push: "$documents" },
            count: { $sum: 1 }
        }
    },
    {
        $match: {
            count: { $gt: 1 }
        }
    },
    {
        $project: {
            _id: 0,
            participantId: "$_id.participantId",
            programCode: "$_id.programCode",
            programStartDate: "$_id.programStartDate"
        }
    },
    {
        $lookup: {
            "from": "participant",
            "localField": "participantId",
            "foreignField": "_id",
            "as": "temp"
        }
    },
    {
        $match: {
            "temp.userStatus": { $ne: "TEST" }
        }
    },
    {
        $project: {
            "id":{ $arrayElemAt: ["$temp._id", 0] }
            "email": { $arrayElemAt: ["$temp.email", 0] }
        }
    }
]
query SubmissionPeriod {
  submissionPeriods(
    limit: 10
    offset: 0
    sort: {
      numberOfFiles:{
        order:1,
        direction:ASC
      }
    }
    filters: {
    status:{
      operator:EQUAL,
      value:"On-time"
    },
      submissionSchedule:{
        reportingPartner:{
          partnerOverlayView:{
            name:{
              operator:CONTAINS,
              value:"%WAV RISE%"
            }
          }
        }
      }
      
      
    }
  ) {
    sid
    createDate
    updateDate
    customerSid
    expectedDay
    expectedDate
    isInPeriodReporter
    noData
    noDataCreateDate
    noDataReason
    onTimeOverride
    periodEndDate
    periodStartDate
    reportedFlag
    status
    trackingLevel
    workingDays
    numberOfFiles
    dataFileSummaryInfo {
      numberOfPOSLines
      numberOfInventoryLines
      receivedDate
      dataFile {
        id
        createDate
        fileName
        dataType
        __typename
      }
      __typename
    }
    noDataServiceUser {
      sid
      firstName
      lastName
      email
      __typename
    }
    submissionPeriodLineItemView {
      salesLineItemCount
      invLineItemCount
      earliestFileSubmissionDate
      __typename
    }
    submissionSchedule {
      sid
      name
      periodRule
      dataType {
        type
        __typename
      }
      reportingPartner {
        id
        partnerOverlayView {
          name
          street1
          street2
          city
          stateprovince
          postalcode
          country
          __typename
        }
        __typename
      }
      __typename
    }
    __typename
  }
}
(select
      count(df.id) as number_of_files
      from SUBMISSION_SCHEDULE ss1
      left join DATA_FILE_SUMMARY_INFO dfsi on 
                                       dfsi.SUBMISSION_PERIOD_SID =  :sid
                                       AND dfsi.CUSTOMER_SID = :cs
      left join DATA_TYPE dt1 on ss1.DATA_TYPE_SID = dt1.SID
      left join DATA_FILE df on dfsi.CUSTOMER_SID = df.CUSTOMER_SID
                          AND dfsi.DATA_FILE_SID = df.SID
                          AND df.DELETED = 0
                          --AND df.DATA_TYPE = dt1.TYPE
      where ss1.SID = :spssd
      AND ss1.CUSTOMER_SID= :cs);
/* In this case, we're creating a new object and spreading properties of the restaurant object, so we're not copying a reference to the same object, but we actually create a new object */

const restaurantCopy = { ...restaurant };
/*Note that the name property of the restaurant object is a string (primitive), and not a reference type. That's why it was copied "by value", and not "by reference".
However, if the name property would store an object, it would copy a reference to that object, instead of copying the object itself. Here's an example:*/
 
const restaurant = {name: {value: 'Classico Italiano'}};
 
const restaurantCopy = { ...restaurant };
restaurantCopy.name.value = 'Ristorante Roma';
 
console.log(restaurantCopy.name.value); // Ristorante Roma
console.log(restaurant.name.value); // Ristorante Roma

/*Now, the name property stores an object. Copying this property copies a reference to that object, and not the object itself. That's why modifying it through the copied restaurant object also changes it in the original restaurant object.*/
        let item = "coffee";
        let price = 15;
        console.log(`One ${item} costs $${price}.`);

        let price = 100;
        let message = price > 50 ? "Expensive" : "Cheap";

Improving Code Using Middleware

Optional Video
In the previous lessons, we created routes inside of our Express application, and we wrote code to process user requests:

router.get('/users/:id', (req, res) => {
  // request processing begins here
  const { id } = req.params;

  if (!users[id]) {
    res.send({ error: `This user doesn't exist` });
    return;
  }

  const { name, age } = users[req.params.id];
  // the request is sent. request processing ends here
  res.send(`User ${name}, ${age} years old`);
});
The code above is perfect for a simple task like this. However, we will often find ourselves faced with much more complex tasks. For example, we might need to implement error logging or a user authentication system. If we try to describe all our logic inside of routers, our code will get longer, and eventually it will become impossible to manage.

Middleware functions are the perfect solution when dealing with these types of problems. Middleware functions execute during the lifecycle of a server request. These functions allow us to write our request processing code inside a separate module, which in turn allows for shorter code in the router itself.

Additionally, middleware is a great place to move code that will be repeatedly executed. For example, let's imagine a scenario where we need to repeatedly query a database. For each request, the server must check whether or not the requested data exists in the database. Instead of writing the code to do this inside of each router inside the application, we can simply describe this logic inside our middleware functions.

Creating a Middleware Function
Let's split our router code into separate functions. The first function will check whether or not the user actually exists in the database. If this user does exist, the second function will send back that user's ID token.

Let's start off with a response:

// move the code for the server's response into a separate function
const sendUser = (req, res) => {
  const { name, age } = users[req.params.id];
  res.send(`User ${name}, ${age} years old`);
};
Now let's move on to the next function, our middleware. This function should:

Check whether the user exists
Send an error message if the user doesn't exist
Call the function that sends the user's name and age, if the user is found. This will be the sendUser() function that was coded earlier.
Let's translate this list into actual JavaScript:

// check whether the user exists
const doesUserExist = (req, res, next) => {
  if (!users[req.params.id]) {
    res.send(`This user doesn't exist`);
    return;
  }

  next(); // call the next function
};

const sendUser = (req, res) => {
  const { name, age } = users[req.params.id];
  res.send(`User ${name}, ${age} years old`);
};
If the user exists, we'll call whichever function was passed to doesUserExist() as the third argument. Let's create a request handler where we can call this function:

router.get('/users/:id', doesUserExist); // here it is
router.get('/users/:id', sendUser);
In the example above, we have two requests that both share the same path, '/users/:id'. Let's imagine that a user navigates to /users/2. First, the doesUserExist() middleware will be executed. Inside of this middleware function, we call next() and the code inside of the second handler, sendUser() will begin to execute. This allows us to chain together as many middleware functions as we need. Without calling next() we would be limited to one middleware for that path.

Let's take a look at this code one more time. Here's the doesUserExist() function:

const doesUserExist = (req, res, next) => {
  if (!users[req.params.id]) {
    res.send(`This user doesn't exist`);
    return; // if no user, we'll exit the function and nothing else will happen
  }

  next(); // if the engine reaches next(), it'll look for the next handler of the same request
};
Let's suppose we need yet another middleware to check a user's access level. We can write this function and execute the next() callback inside its body. After doing that, we'll insert our new handler in between the previously existing middleware functions:

// a middleware function already in use
router.get('/users/:id', doesUserExist);
// a new independent middleware function
router.get('/users/:id', doesUserHavePermission); 
// another middleware function already in use
router.get('/users/:id', sendUser);
It's really important to remember that the callback in our middleware functions should be named next(). In theory, it could be named anything, but in order to make your code easy for other engineers to read, we recommend following this convention.

Also, we can add a series of middleware functions to one request handler for the same path. So, the example above can be rewritten like this:

router.get('/users/:id', doesUserExist, doesUserHavePermission, sendUser);
Connecting Middleware
In the examples above, we passed middleware functions as the second argument inside of router.get(). However, sometimes we want to implement some middleware globally throughout the app. In order to do this, we'll use the use() method. We'll just pass one parameter, which will be the middleware itself, like so:

app.use(middleware);
This is how it looks inside of index.js:

// index.js

const express = require('express');
const routes = require('./routes.js');

const { PORT = 3000 } = process.env;
const app = express();

const logger = (req, res, next) => {
  console.log('The request has been logged!');
  next();
};

app.use(logger);
app.use('/', routes);

app.listen(PORT, () => {
  console.log(`App listening on port ${PORT}`);
});
if(app.documents.length > 0){

  var myDoc = app.activeDocument;

  var myVariables = myDoc.textVariables;

  var myVariablesTable = ["Index","Name","Type"];

  var rowCount = 1;

  for(var i = 0; i < myVariables.length; i++){

    myVariablesTable.push(String(myVariables.index));

    myVariablesTable.push(String(myVariables.name));

    myVariablesTable.push(String(myVariables.variableType));

    rowCount++;

  }

  var myTextFrame = myDoc.pages[0].textFrames.add();

  myTextFrame.geometricBounds = [20,20,250,300];

  var myVariablesTbl = myTextFrame.insertionPoints[0].tables.add();

  myVariablesTbl.columnCount = 3;

  myVariablesTbl.columns.item(0).width="15mm";

  myVariablesTbl.columns.item(2).width="90mm";

  myVariablesTbl.bodyRowCount = rowCount;

  myVariablesTbl.contents = myVariablesTable;

  myTextFrame.fit(FitOptions.FRAME_TO_CONTENT);

}
// Sample for adding a tile to a Launchpad group
sap.ushell.Container.getService("LaunchPage").addTile(oTile, oGroup)
   .done(function () {
      console.log("Tile added successfully");
   })
   .fail(function (sError) {
      console.log("Failed to add tile:", sError);
   });
<!--START theFinancials.com Content-->
<!--copyright theFinancials.com - All Rights Reserved-->
<!--Get Help by Calling 1.843.886.3635-->
<!--specify the width of this Widget by changing '&width=0' at the end of the installation code. -->
<!--Use '&width=100%' to force the Widget to fill its parent container or leave it as 0 for default width-->
<script type='text/javascript' src='https://www.thefinancials.com/ShowPanel.aspx?pid=FREE&mode=js&id=585&bgcolor=003366&fontcolor=ffffff&fontsize=13&bordercolor=c0c0c0&scrollSpeedFromZeroToTen=5'></script>
<!--END theFinancials.com Content-->
/* Example of a Fiori-specific style class */
.myFioriObject {
   background-color: var(--sapBrandColor);
   font-size: var(--sapFontSize);
}
GET /sap/opu/odata/sap/YOUR_SERVICE_SRV/YourEntitySet
POST /sap/opu/odata/sap/YOUR_SERVICE_SRV/YourEntitySet
sap.ui.define([
   "sap/m/MessageBox",
   "sap/ui/core/mvc/Controller"
], function (MessageBox, Controller) {
   "use strict";

   return Controller.extend("your.namespace.controller.App", {
      onInit: function () {
         // Initialization code here
      },

      onShowAlert: function () {
         MessageBox.alert("This is a Fiori alert!");
      }
   });
});
star

Sun Mar 10 2024 20:42:11 GMT+0000 (Coordinated Universal Time)

@VinMinichiello #html

star

Sun Mar 10 2024 20:37:40 GMT+0000 (Coordinated Universal Time)

@VinMinichiello

star

Sun Mar 10 2024 17:04:23 GMT+0000 (Coordinated Universal Time) https://darkwebmarketbuyer.com/product/oxycodone-80-mg/

@darkwebmarket

star

Sun Mar 10 2024 17:03:48 GMT+0000 (Coordinated Universal Time) https://darkwebmarketbuyer.com/product/fake-e10-euro-banknotes-x-50/

@darkwebmarket

star

Sun Mar 10 2024 16:41:26 GMT+0000 (Coordinated Universal Time)

@agedofujpn #javascript

star

Sun Mar 10 2024 15:54:33 GMT+0000 (Coordinated Universal Time)

@brhm_lifter

star

Sun Mar 10 2024 14:06:22 GMT+0000 (Coordinated Universal Time) https://www.cyberforum.ru/python-api/thread2602746.html

@qwdixq

star

Sun Mar 10 2024 12:23:06 GMT+0000 (Coordinated Universal Time) https://mastergroosha.github.io/aiogram-2-guide/quickstart/

@qwdixq

star

Sun Mar 10 2024 12:20:35 GMT+0000 (Coordinated Universal Time) https://github.com/karthiksalapu/python_code/blob/main/time_conversion_basic

@karthiksalapu

star

Sun Mar 10 2024 12:10:48 GMT+0000 (Coordinated Universal Time) https://github.com/karthiksalapu/python_code/blob/main/min_max_of_4digits_in_any_array

@karthiksalapu

star

Sun Mar 10 2024 05:46:54 GMT+0000 (Coordinated Universal Time) https://legacy.reactjs.org/docs/cdn-links.html

@rahulk

star

Sun Mar 10 2024 02:54:38 GMT+0000 (Coordinated Universal Time) https://leetcode.com/contest/weekly-contest-388/problems/apple-redistribution-into-boxes/

@hepzz03 #undefined

star

Sat Mar 09 2024 22:48:13 GMT+0000 (Coordinated Universal Time)

@davidmchale #geolocation #react

star

Sat Mar 09 2024 18:51:19 GMT+0000 (Coordinated Universal Time)

@NoobAl

star

Sat Mar 09 2024 15:09:44 GMT+0000 (Coordinated Universal Time) https://ayudawp.com/omitir-cache-optimizaciones-wp-rocket/

@rstringa

star

Sat Mar 09 2024 13:41:45 GMT+0000 (Coordinated Universal Time)

@abhikash01

star

Sat Mar 09 2024 08:41:02 GMT+0000 (Coordinated Universal Time)

@hiimsa

star

Sat Mar 09 2024 07:07:00 GMT+0000 (Coordinated Universal Time) https://pypi.org/project/python-weather/

@qwdixq

star

Sat Mar 09 2024 07:06:50 GMT+0000 (Coordinated Universal Time) https://pypi.org/project/python-weather/

@qwdixq

star

Sat Mar 09 2024 07:06:34 GMT+0000 (Coordinated Universal Time) https://pypi.org/project/python-weather/

@qwdixq

star

Sat Mar 09 2024 02:43:16 GMT+0000 (Coordinated Universal Time)

@titorobe #javascript

star

Fri Mar 08 2024 20:06:14 GMT+0000 (Coordinated Universal Time) https://coderslegacy.com/solving-common-problems-and-errors-pyinstaller/

@qwdixq

star

Fri Mar 08 2024 20:04:26 GMT+0000 (Coordinated Universal Time) https://coderslegacy.com/solving-common-problems-and-errors-pyinstaller/

@qwdixq

star

Fri Mar 08 2024 20:01:24 GMT+0000 (Coordinated Universal Time) https://pyinstaller.org/en/stable/

@qwdixq

star

Fri Mar 08 2024 19:00:55 GMT+0000 (Coordinated Universal Time)

@Ridias

star

Fri Mar 08 2024 18:38:22 GMT+0000 (Coordinated Universal Time)

@hiimsa

star

Fri Mar 08 2024 17:08:06 GMT+0000 (Coordinated Universal Time) https://pedidoswoo.optatemplates.com.br/wp-admin/admin.php?page

@carlaherrera #undefined

star

Fri Mar 08 2024 16:22:22 GMT+0000 (Coordinated Universal Time)

@shirnunn

star

Fri Mar 08 2024 16:21:39 GMT+0000 (Coordinated Universal Time)

@shirnunn

star

Fri Mar 08 2024 15:54:02 GMT+0000 (Coordinated Universal Time) https://dev.to/paul_duvall/sass-and-media-queries-hb2

@ClairLalune

star

Fri Mar 08 2024 15:53:29 GMT+0000 (Coordinated Universal Time) https://dev.to/paul_duvall/sass-and-media-queries-hb2

@ClairLalune

star

Fri Mar 08 2024 12:45:12 GMT+0000 (Coordinated Universal Time)

@KickstartWeb #php

star

Fri Mar 08 2024 11:11:08 GMT+0000 (Coordinated Universal Time)

@developerjindal

star

Fri Mar 08 2024 10:24:18 GMT+0000 (Coordinated Universal Time) http://34.74.16.180:3000/question#eyJkYXRhc2V0X3F1ZXJ5Ijp7ImRhdGFiYXNlIjoyLCJuYXRpdmUiOnsidGVtcGxhdGUtdGFncyI6e30sInF1ZXJ5IjoiW1xyXG4gICAge1xyXG4gICAgICAgIFwiJG1hdGNoXCI6IHtcclxuICAgICAgICAgICAgXCJlbWFpbFwiOiBcInByb2R1Y3RAc21pdC5maXRcIlxyXG4gICAgICAgIH1cclxuICAgIH0sXHJcbiAgICB7XHJcbiAgICAgICAgXCIkbG9va3VwXCI6IHtcclxuICAgICAgICAgICAgXCJmcm9tXCI6IFwidXNlcnNcIixcclxuICAgICAgICAgICAgXCJsb2NhbEZpZWxkXCI6IFwiZW1haWxcIixcclxuICAgICAgICAgICAgXCJmb3JlaWduRmllbGRcIjogXCJlbWFpbFwiLFxyXG4gICAgICAgICAgICBcImFzXCI6IFwidXNlckxrcFwiXHJcbiAgICAgICAgfVxyXG4gICAgfSxcclxuICAgIHtcclxuICAgICAgICBcIiR1bndpbmRcIjoge1xyXG4gICAgICAgICAgICBcInBhdGhcIjogXCIkdXNlckxrcFwiLFxyXG4gICAgICAgICAgICBcInByZXNlcnZlTnVsbEFuZEVtcHR5QXJyYXlzXCI6IHRydWVcclxuICAgICAgICB9XHJcbiAgICB9LFxyXG4gICAge1xyXG4gICAgICAgIFwiJG1hdGNoXCI6IHtcclxuICAgICAgICAgICAgXCJ1c2VyTGtwLnBvcnRhbFBhc3N3b3JkXCI6IFwic21pdEBwcm9kdWN0I0AxMjFcIlxyXG4gICAgICAgIH1cclxuICAgIH0sXHJcbiAgICB7XHJcbiAgICAgICAgXCIkcHJvamVjdFwiOiB7XHJcbiAgICAgICAgICAgIFwiZmlyc3ROYW1lXCI6IDEsXHJcbiAgICAgICAgICAgIFwibWlkZGxlTmFtZVwiOiAxLFxyXG4gICAgICAgICAgICBcImxhc3ROYW1lXCI6IDEsXHJcbiAgICAgICAgICAgIFwiZW1haWxcIjogMSxcclxuICAgICAgICAgICAgXCJtb2JpbGVcIjogMSxcclxuICAgICAgICAgICAgXCJyb2xlXCI6IDEsXHJcbiAgICAgICAgICAgIFwicGFydG5lclNob3J0Q29kZVwiOiAxLFxyXG4gICAgICAgICAgICBcInVzZXJHcm91cHNcIjogXCIkdXNlckxrcC51c2VyR3JvdXBzXCIsXHJcbiAgICAgICAgICAgIFwicHJvZmlsZVBpY3R1cmVVUkxcIjogMSxcclxuICAgICAgICAgICAgXCJwb3J0YWxQYXNzd29yZFwiOiBcIiR1c2VyTGtwLnBvcnRhbFBhc3N3b3JkXCIsXHJcbiAgICAgICAgICAgIFwiYXV0aG9yaXphdGlvblwiOiBcIiR1c2VyTGtwLmF1dGhvcml6YXRpb25cIlxyXG4gICAgICAgIH1cclxuICAgIH1cclxuXSIsImNvbGxlY3Rpb24iOiJ1c2VycyJ9LCJ0eXBlIjoibmF0aXZlIn0sImRpc3BsYXkiOiJ0YWJsZSIsInZpc3VhbGl6YXRpb25fc2V0dGluZ3MiOnt9fQ==

@CodeWithSachin ##jupyter #aggregation #mongodb

star

Fri Mar 08 2024 10:14:28 GMT+0000 (Coordinated Universal Time)

@thanuj #sql

star

Fri Mar 08 2024 10:14:06 GMT+0000 (Coordinated Universal Time)

@thanuj #sql

star

Fri Mar 08 2024 09:42:45 GMT+0000 (Coordinated Universal Time)

@manami_13

star

Fri Mar 08 2024 06:58:03 GMT+0000 (Coordinated Universal Time) https://dev.to/mmainulhasan/30-javascript-tricky-hacks-gfc

@leninzapata

star

Fri Mar 08 2024 06:57:02 GMT+0000 (Coordinated Universal Time) https://dev.to/mmainulhasan/30-javascript-tricky-hacks-gfc

@leninzapata

star

Fri Mar 08 2024 06:55:08 GMT+0000 (Coordinated Universal Time) https://tradingqna.com/c/taxation-when-trading/12

@prakhar

star

Fri Mar 08 2024 06:07:08 GMT+0000 (Coordinated Universal Time) https://tripleten.com/trainer/web/lesson/4b5486c8-4d5a-425f-b7bf-8d9af7e84c9f/task/c2f63f67-a42e-4614-bfaf-1a29192f8ff1/?from

@Marcelluki

star

Fri Mar 08 2024 05:30:34 GMT+0000 (Coordinated Universal Time) https://prnt.sc/h-UJOyfLoeFh

@Ria

star

Fri Mar 08 2024 04:56:06 GMT+0000 (Coordinated Universal Time) https://community.adobe.com/t5/indesign-discussions/load-import-text-variables/td-p/9587858

@gowhiskey

star

Thu Mar 07 2024 21:56:51 GMT+0000 (Coordinated Universal Time)

@Gavslee

star

Thu Mar 07 2024 21:56:42 GMT+0000 (Coordinated Universal Time) https://thefinancials.com/widgets/view/?marketID

@sync_800

star

Thu Mar 07 2024 21:55:08 GMT+0000 (Coordinated Universal Time)

@Gavslee

star

Thu Mar 07 2024 21:52:02 GMT+0000 (Coordinated Universal Time)

@Gavslee

star

Thu Mar 07 2024 21:49:22 GMT+0000 (Coordinated Universal Time)

@Gavslee

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension