Snippets Collections
Sales-WTD = 

CALCULATE( [Total Sales], 
	FILTER( ALL('Calendar'),
		'Calendar'[Week Rank] = MAX( 'Calendar'[Week Rank] ) && 
		'Calendar'[Weekday] <= MAX( 'Date'[Weekday] ) 
		) 
	)
Sales-PW =

CALCULATE ( [Total Sales], 
	FILTER( ALL( 'Calendar' ),
	'Calendar'[Week Rank] = MAX ( 'Calendar'[Week Rank] ) -1 ) 
	)
Week End date = 

'Calendar'[Date] + 7-1 * WEEKDAY( 'Calendar'[Date], 2 )
Week Start date = 

'Calendar'[Date] + -1 * WEEKDAY( 'Calendar'[Date], 2 ) + 1
Sales-WTD = 

VAR CD =
    LASTDATE( 'Calendar'[Date] )

VAR CY =
    MAX( 'Calendar'[Year] )
    
VAR WeekDayNo =
    WEEKDAY( LASTDATE( 'Calendar'[Date] ), 3 )

RETURN
CALCULATE(
    [Total Sales],
    DATESBETWEEN(
        'Calendar'[Date],
        DATEADD(
            CD, 
            -1 * WeekDayNo, DAY ), 
            CD),
    'Calendar'[Year] = CY
)
Sales-WoW% = 

VAR WoW =
    [Sales-WoW]
    
VAR PW = 
    [Sales-PW]
    
RETURN
    IF (
        PW = BLANK (),
            BLANK (),
        DIVIDE ( WoW, PW )
        )
Sales-WoW = 

VAR WoW =
    IF ( [Sales-PW] = BLANK(),
        BLANK(),
    [Sales-CW] - [Sales-PW] )

RETURN
    WoW
Sales-PW = 

VAR CurrentWeek =
    SELECTEDVALUE( 'Calendar'[WeekNo] )

VAR CurrentYear =
    SELECTEDVALUE( 'Calendar'[Year] )

VAR MaxWeekNo =
    CALCULATE(
        MAX ( 'Calendar'[WeekNo] ), 
            ALL ( 'Calendar' )
            )

RETURN
SUMX(
    FILTER( ALL ( 'Calendar' ),
        IF ( CurrentWeek = 1,
            'Calendar'[WeekNo] = MaxWeekNo && 'Calendar'[Year] = CurrentYear -1,
            'Calendar'[WeekNo] = CurrentWeek -1 && 'Calendar'[Year] = CurrentYear )
        ),
    [Total Sales]
    )
Sales-CW = 

CALCULATE( [Total Sales], 
    FILTER(
        ALL('Calendar'),
        'Calendar'[Week Rank] = MAX( 'Calendar'[Week Rank])
            )
        )
import { plainToInstance } from 'class-transformer';
import { validate } from 'class-validator';
export * from 'class-validator';

export const validationPipe = async (schema: new () => {}, requestObject: object) => {
  const transformedClass: any = plainToInstance(schema, requestObject);
  const errors = await validate(transformedClass);
  if (errors.length > 0) {
    return errors;
  }
  return true;
};
Sales-DoD% = 

VAR DoD =
    [Sales-DoD]
    
VAR PD = 
    [Sales-PD]
    
RETURN
    IF (
        PD = BLANK (),
            BLANK (),
        DIVIDE ( DoD, PD )
        )
Sales-DoD = 

VAR DoD =
    IF ( [Sales-PD] = BLANK(),
        BLANK(),
    [Total Sales] - [Sales-PD] )

RETURN
    DoD
Sales-PD =

CALCULATE( 
    [Total Sales],
    DATEADD( 'Calendar'[Date], -1, DAY )
    )
const merlin = new Merlin({ apiKey:"<YOUR_OPENAI_KEY>", merlinConfig: {apiKey: "<YOUR_MERLIN_API_KEY>"} });`
import { Merlin } from "merlin-node";

const apiKey = "<YOUR_MERLIN_API_KEY>"; // Replace with your API key from Merlin
const merlin = new Merlin({ merlinConfig: { apiKey } });

async function createCompletion() {
  try {
    const completion = await merlin.chat.completions.create({
      messages: [
        { role: "system", content: "You are a helpful assistant." },
        {
          role: "user",
          content: [
            {
              type: "image_url",
              image_url:
                "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg",
            },
            {
              type: "text",
              text: "What’s in this image?",
            },
          ],
        },
      ],
      model: "gemini-pro-vision",
    });

    console.log(completion.choices[0].message.content);
  } catch (error) {
    console.error("Error creating completion:", error);
  }
}

createCompletion();
1. set these for the project (name accordingly)
for REACT, publish directory is "build"
Base directory = my-portfolio-frontend
Package directory = Not set
Build command = npm run build
Publish directory = my-portfolio-frontend/build


2.
To Fix babel... warning, write this command -
npm install --save-dev @babel/plugin-proposal-private-property-in-object

Next create a new file and paste this
// .babelrc
{
  "presets": [
    "react-app"
  ],
  "plugins": [
    "@babel/plugin-proposal-private-property-in-object"
    // Add any other plugins you may have here
  ]
}


3.
In the root folder add a new file and paste it
// netlify.toml
[[redirects]]
from = "/*"
to = "/index.html"
status = 200


4. Remove all the warnings from the project
# split()
# دالة تقوم بتقسيم السلسلة إلى قائمة من الكلمات باستخدام (المسافات أو أي نص آخر) كفاصل
# Syntax: string.split(sep=None, maxsplit=-1) -> list[LiteralString]
# sep => Separator    NOTE: By default any (whitespace) is a separator
# maxsplit => عايز التقسيم يكون في كام عنصر؟
# maxsplit => لو كتبت مثلا 2 ترجع 3عناصر وهكذا، يعني النتيجة بتكون +1 يعني التقسيم تم في 2 والباقي نزله في عنصر واحد الاخير

## أختها الوحيدة ##########################
# rsplit()  # Right Split
################################################################

txt1 = "welcome to the jungle"
txt2 = "welcome#to#the#jungle"

print("============(split)===================================")
x1 = txt1.split()           
x2 = txt1.split(" ",2)
x3 = txt2.split("#")
print(x1)                   # ['welcome', 'to', 'the', 'jungle']
print(x2)                   # ['welcome', 'to', 'the jungle']
print(x3)                   # ['welcome', 'to', 'the', 'jungle']

print("============(rsplit)===================================")
y1 = txt1.rsplit(None,2)
y2 = txt1.rsplit(" ",2)
print(y1)                    # ['welcome to', 'the', 'jungle']
print(y2)                    # ['welcome to', 'the', 'jungle']
% This is the RIPE Database query service.
% The objects are in RPSL format.
%
% The RIPE Database is subject to Terms and Conditions.
% See https://apps.db.ripe.net/docs/HTML-Terms-And-Conditions

% Note: this output has been filtered.
%       To receive output for a database update, use the "-B" flag.

% Information related to '::/0'

% No abuse contact registered for ::/0

inet6num:       ::/0
netname:        IANA-BLK
descr:          The whole IPv6 address space
country:        EU # Country is really world wide
org:            ORG-IANA1-RIPE
admin-c:        IANA1-RIPE
tech-c:         CREW-RIPE
tech-c:         OPS4-RIPE
mnt-by:         RIPE-NCC-HM-MNT
mnt-lower:      RIPE-NCC-HM-MNT
status:         ALLOCATED-BY-RIR
remarks:        This network is not allocated.
                This object is here for Database
                consistency and to allow hierarchical
                authorisation checks.
created:        2002-08-05T10:21:17Z
last-modified:  2022-05-23T14:49:16Z
source:         RIPE

organisation:   ORG-IANA1-RIPE
org-name:       Internet Assigned Numbers Authority
org-type:       IANA
address:        see http://www.iana.org
remarks:        The IANA allocates IP addresses and AS number blocks to RIRs
remarks:        see http://www.iana.org/numbers
admin-c:        IANA1-RIPE
tech-c:         IANA1-RIPE
mnt-ref:        RIPE-NCC-HM-MNT
mnt-by:         RIPE-NCC-HM-MNT
created:        2004-04-17T09:57:29Z
last-modified:  2013-07-22T12:03:42Z
source:         RIPE # Filtered

role:           RIPE NCC Registration Services Department
address:        RIPE Network Coordination Centre
address:        P.O. Box 10096
address:        1001 EB Amsterdam
address:        the Netherlands
phone:          +31 20 535 4444
fax-no:         +31 20 535 4445
org:            ORG-NCC1-RIPE
admin-c:        MSCH2-RIPE
tech-c:         KL1200-RIPE
tech-c:         XAV
tech-c:         MPRA-RIPE
tech-c:         EM12679-RIPE
tech-c:         KOOP-RIPE
tech-c:         RS23393-RIPE
tech-c:         SPEN
tech-c:         LH47-RIPE
tech-c:         TORL
tech-c:         ME3132-RIPE
tech-c:         JW1966
tech-c:         AD11
tech-c:         HUW
tech-c:         CP11558-RIPE
tech-c:         PH7311-RIPE
tech-c:         KW2814-RIPE
tech-c:         SF9489-RIPE
tech-c:         MK23135-RIPE
tech-c:         OE1366-RIPE
tech-c:         CBT18-RIPE
tech-c:         CG12576-RIPE
tech-c:         RS26744-RIPE
nic-hdl:        CREW-RIPE
abuse-mailbox:  abuse@ripe.net
mnt-by:         RIPE-NCC-HM-MNT
created:        2002-09-23T10:13:06Z
last-modified:  2023-08-29T11:33:21Z
source:         RIPE # Filtered

role:           Internet Assigned Numbers Authority
address:        see http://www.iana.org.
admin-c:        IANA1-RIPE
tech-c:         IANA1-RIPE
nic-hdl:        IANA1-RIPE
remarks:        For more information on IANA services
remarks:        go to IANA web site at http://www.iana.org.
mnt-by:         RIPE-NCC-MNT
created:        1970-01-01T00:00:00Z
last-modified:  2001-09-22T09:31:27Z
source:         RIPE # Filtered

role:           RIPE NCC Operations
address:        Stationsplein 11
address:        1012 AB Amsterdam
address:        The Netherlands
phone:          +31 20 535 4444
fax-no:         +31 20 535 4445
abuse-mailbox:  abuse@ripe.net
admin-c:        BRD-RIPE
tech-c:         GL7321-RIPE
tech-c:         MENN1-RIPE
tech-c:         RCO-RIPE
tech-c:         CNAG-RIPE
tech-c:         SO2011-RIPE
tech-c:         TOL666-RIPE
tech-c:         ADM6699-RIPE
tech-c:         TIB-RIPE
tech-c:         SG16480-RIPE
tech-c:         RDM397-RIPE
nic-hdl:        OPS4-RIPE
mnt-by:         RIPE-NCC-MNT
created:        2002-09-16T10:35:19Z
last-modified:  2019-06-05T11:01:30Z
source:         RIPE # Filtered

% This query was served by the RIPE Database Query Service version 1.109.1 (SHETLAND)

ns3.wlfdle.rnc.net.cable.rogers.com >> 64.71.246.28
ns3.wlfdle.rnc.net.cable.rogers.com >> 64.71.246.28
ns3.ym.rnc.net.cable.rogers.com >> 64.71.246.156
ns2.ym.rnc.net.cable.rogers.com >> 24.153.22.142
ns2.wlfdle.rnc.net.cable.rogers.com >> 24.153.22.14
ns3.wlfdle.rnc.net.cable  IN  A  64.71.246.28
Step 1 : Log Into Your WordPress
Step 2 : Access The Theme Directory
Step 3 : Add New Theme
Step 4 : Choose And Install

ssh username@server_ip_address
sudo apt update
sudo apt install nodejs
sudo apt install npm
node -v
npm -v
mkdir my-node-app
cd my-node-app
npm init -y
sudo npm install pm2 -g
pm2 start index.js

// other way
pm2 start {command} --name "APP NAME" -- {script}

//like
pm2 start npm --name "NODE APP" -- start
//css
<style>
.container {
  display: flex;
  width: 100%;
  padding: 0%;
  box-sizing: border-box;
  height: 50vh;
}

.box {
  flex: 1;
  overflow: hidden;
  transition: 0.5s;
  margin: 0 2%;
  box-shadow: 0 20px 30px rgba(0, 0, 0, 0.1);
  line-height: 0;
}

.box > img {
  width: 200%;
  height: calc(100% - 10vh);
  object-fit: cover;
  transition: 0.5s;
}

.box > span {
  font-size: 3.8vh;
  display: block;
  text-align: center;
  height: 10vh;
  line-height: 2.6;
}

.box:hover {
  flex: 1 1 50%;
}
.box:hover > img {
  width: 100%;
  height: 100%;
}
</style>



//Hmtl
   
  <div class="container">
  <div class="box">
    <img src="https://source.unsplash.com/1000x800">
    <span>Acceptance</span>
  </div>
  <div class="box">
    <img src="https://source.unsplash.com/1000x802">
    <span>Greatness</span>
  </div>
  <div class="box">
    <img src="https://source.unsplash.com/1000x804">
    <span>truth</span>
  </div>
  <div class="box">
    <img src="https://source.unsplash.com/1000x806">
    <span>self love</span>
  </div>
</div>


function setUrlParam(param, value) {
    const url = new URL(window.location.href);
    url.searchParams.set(param, value);
    window.history.pushState({}, "", url);
}

function deleteUrlParam(param) {
    const url = new URL(window.location.href);
    url.searchParams.delete(param);
    window.history.pushState({}, "", url);
}
from autogen import AssistantAgent, UserProxyAgent, config_list_from_json
# Load LLM inference endpoints from an env variable or a file
# See https://microsoft.github.io/autogen/docs/FAQ#set-your-api-endpoints
# and OAI_CONFIG_LIST_sample
config_list = config_list_from_json(env_or_file="OAI_CONFIG_LIST")
# You can also set config_list directly as a list, for example, config_list = [{'model': 'gpt-4', 'api_key': '<your OpenAI API key here>'},]
assistant = AssistantAgent("assistant", llm_config={"config_list": config_list})
user_proxy = UserProxyAgent("user_proxy", code_execution_config={"work_dir": "coding"})
user_proxy.initiate_chat(assistant, message="Plot a chart of NVDA and TESLA stock price change YTD.")
# This initiates an automated chat between the two agents to solve the task
$ wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
$ sudo apt install ./google-chrome-stable_current_amd64.deb
rows_to_display=app_tables.images.search()
for row in rows_to_display:
   L=LinearPanel()
   L.add_component(Image(source=row['Image']))
   L.add_component(Label(text=row['title']))
   L.add_component(Label(text=row['info']))
   self.flow_panel_1.add_component(L)
Dear Customer,

Please find the analyzed feedback form attached for your reference.

Please let us know in case you face any issues or if any additional information is required.

Thank you
star

Sat Dec 30 2023 07:12:45 GMT+0000 (Coordinated Universal Time)

@nikahafiz #ms.pbi #dax #dax.weekday

star

Sat Dec 30 2023 07:11:01 GMT+0000 (Coordinated Universal Time)

@nikahafiz #ms.pbi #dax #dax.weeknum

star

Sat Dec 30 2023 07:07:22 GMT+0000 (Coordinated Universal Time)

@nikahafiz #ms.pbi #dax #dax.weekday

star

Sat Dec 30 2023 07:06:37 GMT+0000 (Coordinated Universal Time)

@nikahafiz #ms.pbi #dax #dax.weekday

star

Sat Dec 30 2023 04:52:15 GMT+0000 (Coordinated Universal Time) https://dev.to/thesameeric/validating-requests-using-validation-pipes-in-typescript-496f

@daavib

star

Sat Dec 30 2023 04:43:03 GMT+0000 (Coordinated Universal Time)

@nikahafiz #ms.pbi #dax #previous.day #dax.calculate #dax.dateadd

star

Fri Dec 29 2023 23:36:27 GMT+0000 (Coordinated Universal Time) https://iplocation.io/ip-extractor

@etg1

star

Fri Dec 29 2023 20:02:37 GMT+0000 (Coordinated Universal Time) https://api.getmerlin.in/docs/gemini-models

@Spsypg #typescript

star

Fri Dec 29 2023 20:02:28 GMT+0000 (Coordinated Universal Time) https://api.getmerlin.in/docs/gemini-models

@Spsypg #typescript

star

Fri Dec 29 2023 20:02:12 GMT+0000 (Coordinated Universal Time) https://api.getmerlin.in/docs/gemini-models

@Spsypg #bash

star

Fri Dec 29 2023 19:24:22 GMT+0000 (Coordinated Universal Time) https://chat.openai.com/?__cf_chl_tk

@eziokittu

star

Fri Dec 29 2023 17:02:46 GMT+0000 (Coordinated Universal Time)

@rmdnhsn #python

star

Fri Dec 29 2023 13:32:54 GMT+0000 (Coordinated Universal Time) https://www.ip-tracker.org/lookup/whois.php?query

@etg1

star

Fri Dec 29 2023 13:26:58 GMT+0000 (Coordinated Universal Time) https://www.ip-tracker.org/lookup.php

@etg1

star

Fri Dec 29 2023 13:26:55 GMT+0000 (Coordinated Universal Time) https://www.ip-tracker.org/lookup.php

@etg1

star

Fri Dec 29 2023 13:26:53 GMT+0000 (Coordinated Universal Time) https://www.ip-tracker.org/lookup.php

@etg1

star

Fri Dec 29 2023 13:26:51 GMT+0000 (Coordinated Universal Time) https://www.ip-tracker.org/lookup.php

@etg1

star

Fri Dec 29 2023 13:26:47 GMT+0000 (Coordinated Universal Time) https://www.ip-tracker.org/lookup.php

@etg1

star

Fri Dec 29 2023 13:26:45 GMT+0000 (Coordinated Universal Time) https://www.ip-tracker.org/lookup.php

@etg1

star

Fri Dec 29 2023 13:26:42 GMT+0000 (Coordinated Universal Time) https://www.ip-tracker.org/lookup.php

@etg1

star

Fri Dec 29 2023 13:26:38 GMT+0000 (Coordinated Universal Time) https://www.ip-tracker.org/lookup.php

@etg1

star

Fri Dec 29 2023 13:26:36 GMT+0000 (Coordinated Universal Time) https://www.ip-tracker.org/lookup.php

@etg1

star

Fri Dec 29 2023 13:26:33 GMT+0000 (Coordinated Universal Time) https://www.ip-tracker.org/lookup.php

@etg1

star

Fri Dec 29 2023 13:26:31 GMT+0000 (Coordinated Universal Time) https://www.ip-tracker.org/lookup.php

@etg1

star

Fri Dec 29 2023 13:10:47 GMT+0000 (Coordinated Universal Time) https://sites.ipaddress.com/ns3.wlfdle.rnc.net.cable.rogers.com/

@etg1

star

Fri Dec 29 2023 12:21:11 GMT+0000 (Coordinated Universal Time) undefined

@hoperyougax

star

Fri Dec 29 2023 10:50:11 GMT+0000 (Coordinated Universal Time) https://www.ip2location.com/free/telegram-bot

@etg1 #html

star

Fri Dec 29 2023 10:49:57 GMT+0000 (Coordinated Universal Time) https://www.ip2location.com/free/telegram-bot

@etg1 #html

star

Fri Dec 29 2023 10:32:30 GMT+0000 (Coordinated Universal Time) https://codenestors.com/blog/how-to-install-wordpress-theme-template

@master4321

star

Fri Dec 29 2023 10:31:10 GMT+0000 (Coordinated Universal Time) https://codenestors.com/blog/how-to-install-pm2-on-ubuntu-server

@master4321

star

Fri Dec 29 2023 09:38:04 GMT+0000 (Coordinated Universal Time) https://dnevnik.kiasuo.ru/diary/s/389161/student_marks/1240000000337856864

@ZXC

star

Fri Dec 29 2023 09:35:05 GMT+0000 (Coordinated Universal Time) https://dnevnik.kiasuo.ru/diary/s/389161/student_marks/1240000000337856864

@ZXC

star

Fri Dec 29 2023 09:01:40 GMT+0000 (Coordinated Universal Time)

@Calideebynyc #expanding

star

Fri Dec 29 2023 08:52:38 GMT+0000 (Coordinated Universal Time)

@jeromew #javascript

star

Fri Dec 29 2023 07:58:32 GMT+0000 (Coordinated Universal Time) https://codepen.io/ItzaMi/pen/bGgaOEr

@mubashir_aziz

star

Fri Dec 29 2023 05:55:50 GMT+0000 (Coordinated Universal Time) https://github.com/microsoft/autogen

@spekz369

star

Fri Dec 29 2023 05:55:41 GMT+0000 (Coordinated Universal Time) https://github.com/microsoft/autogen

@spekz369

star

Fri Dec 29 2023 03:30:05 GMT+0000 (Coordinated Universal Time) https://linuxconfig.org/how-to-install-google-chrome-browser-on-linux

@malzzz

star

Fri Dec 29 2023 01:42:27 GMT+0000 (Coordinated Universal Time) https://anvil.works/forum/t/creating-an-image-gallery-in-anvil/11236

@webdeveloper_

star

Thu Dec 28 2023 23:30:14 GMT+0000 (Coordinated Universal Time) https://wiki.selfhtml.org/wiki/Typografie/Zeilenumbruch

@2late #html

star

Thu Dec 28 2023 18:44:19 GMT+0000 (Coordinated Universal Time)

@amanskum

Save snippets that work with our extensions

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