Snippets Collections
-- RISK009
DROP TABLE team_kingkong.tpap_risk009_breaches;

-- CREATE TABLE team_kingkong.tpap_risk009_breaches AS
INSERT INTO team_kingkong.tpap_risk009_breaches
with tpap_base as
(
SELECT DISTINCT B.*, C.category, C.txn_type
, IF(D.upi_subtype IS NOT NULL, D.upi_subtype, IF(C.category = 'LITE_MANDATE', 'UPI_LITE_MANDATE', '')) AS upi_subtype
, D.payerType, D.payeeType
FROM
    (SELECT txn_id,
    MAX(CASE WHEN participant_type = 'PAYER' THEN vpa END) AS payer_vpa,
    MAX(CASE WHEN participant_type = 'PAYEE' THEN vpa END) AS payee_vpa,
    MAX(DATE(created_on)) as txn_date,
    MAX(amount) AS txn_amount,
    MAX(created_on) AS txn_time
    FROM switch.txn_participants_snapshot_v3
    WHERE DATE(dl_last_updated) BETWEEN DATE(DATE'2025-01-01' - INTERVAL '1' DAY) AND DATE'2025-01-31'
    AND DATE(created_on) BETWEEN DATE(DATE'2025-01-01' - INTERVAL '1' DAY) AND DATE'2025-01-31'
    GROUP BY 1)B
INNER join
    (select txn_id, category, "type" AS txn_type
    from switch.txn_info_snapshot_v3
    where DATE(dl_last_updated) BETWEEN DATE(DATE'2025-01-01' - INTERVAL '1' DAY) AND DATE'2025-01-31'
    and DATE(created_on) BETWEEN DATE(DATE'2025-01-01' - INTERVAL '1' DAY) AND  DATE'2025-01-31'
    and upper(status) = 'SUCCESS' AND "type" = 'COLLECT' AND category = 'VPA2VPA') C
on B.txn_id = C.txn_id
INNER JOIN
    (SELECT txnid
    , regexp_replace(cast(json_extract(request, '$.evaluationType') as varchar), '"', '') AS upi_subtype
    , regexp_replace(cast(json_extract(request, '$.requestPayload.payerType') AS varchar),'"','') as payerType
    , regexp_replace(cast(json_extract(request, '$.requestPayload.payeeType') AS varchar),'"','') as payeeType
    FROM tpap_hss.upi_switchv2_dwh_risk_data_snapshot_v3
    WHERE DATE(dl_last_updated) BETWEEN DATE(DATE'2025-01-01' - INTERVAL '1' DAY) AND DATE'2025-01-31'
    AND (lower(regexp_replace(cast(json_extract(request, '$.requestPayload.payerVpa') as varchar), '"', '')) LIKE '%@paytm%'
    or lower(regexp_replace(cast(json_extract(request, '$.requestPayload.payerVpa') as varchar), '"', '')) like '%@pt%'
    OR lower(regexp_replace(cast(json_extract(request, '$.requestPayload.payeeVpa') as varchar), '"', '')) LIKE '%@paytm%'
    or lower(regexp_replace(cast(json_extract(request, '$.requestPayload.payeeVpa') as varchar), '"', '')) like '%@pt%')
    AND regexp_replace(cast(json_extract(request, '$.requestPayload.payeeVpa') as varchar), '"', '') IS NOT NULL
    AND regexp_replace(cast(json_extract(request, '$.requestPayload.payerVpa') as varchar), '"', '') IS NOT NULL
    AND regexp_replace(cast(json_extract(request, '$.requestPayload.payeeVpa') as varchar), '"', '') <> ''
    AND regexp_replace(cast(json_extract(request, '$.requestPayload.payerVpa') as varchar), '"', '') <> ''
    AND json_extract_scalar(response, '$.action_recommended') <> 'BLOCK'
    AND regexp_replace(cast(json_extract(request, '$.requestPayload.payerType') AS varchar),'"','') = 'PERSON'
    AND regexp_replace(cast(json_extract(request, '$.requestPayload.payeeType') AS varchar),'"','') = 'PERSON'
    AND regexp_replace(cast(json_extract(request, '$.evaluationType') as varchar), '"', '') = 'UPI_TRANSACTION')D
ON B.txn_id = D.txnid
WHERE payer_vpa IS NOT NULL AND payee_vpa IS NOT NULL
)
 
SELECT *, 'upi_collect_request_p2p_vpa_v1' as rule_name, CASE
  WHEN txn_succ_24hr >= threshold_24hr AND txn_succ_week >= threshold_week THEN '24hr & week breach'
  WHEN txn_succ_24hr >= threshold_24hr THEN '24hr breach'
  WHEN txn_succ_week >= threshold_week THEN 'week breach'
  ELSE NULL END AS breach_reason FROM
    (SELECT t1.payer_vpa,
      t1.payee_vpa,
      t1.txn_id,
      t1.txn_amount,
      t1.category,
      t1.upi_subtype,
      t1.txn_time,
      DATE(t1.txn_time) AS txn_date
      , COUNT(DISTINCT IF(DATE(t2.txn_time) BETWEEN DATE(DATE(t1.txn_time) - INTERVAL '86400' SECOND) AND DATE(t1.txn_time), t2.txn_id, NULL)) AS txn_succ_24hr
      , 10 as threshold_24hr
      , COUNT(DISTINCT IF(DATE(t2.txn_time) BETWEEN DATE(DATE(t1.txn_time) - INTERVAL '604800' SECOND) AND DATE(t1.txn_time), t2.txn_id, NULL)) AS txn_succ_week
      , 25 as threshold_week
    FROM tpap_base t1
    INNER JOIN tpap_base t2
    ON t1.payee_vpa = t2.payee_vpa AND t1.payer_vpa = t2.payer_vpa
      AND t2.txn_time BETWEEN (t1.txn_time - INTERVAL '604800' SECOND) AND t1.txn_time 
      AND t1.txn_id <> t2.txn_id AND t1.txn_date BETWEEN DATE'2025-01-01' AND DATE'2025-01-31'
    GROUP BY t1.payer_vpa, t1.payee_vpa, t1.txn_id, t1.txn_amount, t1.category, t1.upi_subtype, t1.txn_time, t1.txn_date)
WHERE (txn_succ_24hr >= threshold_24hr) OR (txn_succ_week >= threshold_week)
;
-- RISK_151
-- if in previous 20 minutes distinct(payer vpa)>=35 and txn amt > 1500 then block
DROP TABLE team_kingkong.tpap_risk151_breaches;

-- CREATE TABLE team_kingkong.tpap_risk151_breaches AS
INSERT INTO team_kingkong.tpap_risk151_breaches
with tpap_base as
(SELECT DISTINCT B.*, C.category
, IF(D.upi_subtype IS NOT NULL, D.upi_subtype, IF(C.category = 'LITE_MANDATE', 'UPI_LITE_MANDATE', '')) AS upi_subtype
FROM
    (SELECT txn_id,
    MAX(CASE WHEN participant_type = 'PAYER' THEN vpa END) AS payer_vpa,
    MAX(CASE WHEN participant_type = 'PAYEE' THEN vpa END) AS payee_vpa,
    MAX(DATE(created_on)) as txn_date,
    MAX(amount) AS txn_amount,
    MAX(created_on) AS txn_time
    FROM switch.txn_participants_snapshot_v3
    WHERE DATE(dl_last_updated) BETWEEN DATE(DATE'2025-01-01' - INTERVAL '1' DAY) AND DATE'2025-01-31'
    AND DATE(created_on) BETWEEN DATE(DATE'2025-01-01' - INTERVAL '1' DAY) AND DATE'2025-01-31'
    GROUP BY 1)B
inner join
    (select txn_id, category
    from switch.txn_info_snapshot_v3
    where DATE(dl_last_updated) BETWEEN DATE(DATE'2025-01-01' - INTERVAL '1' DAY) AND DATE'2025-01-31'
    and DATE(created_on) BETWEEN DATE(DATE'2025-01-01' - INTERVAL '1' DAY) AND DATE'2025-01-31'
    and upper(status) = 'SUCCESS' AND category = 'VPA2VPA') C
on B.txn_id = C.txn_id
INNER JOIN
    (SELECT txnid
    , regexp_replace(cast(json_extract(request, '$.evaluationType') as varchar), '"', '') AS upi_subtype
    FROM tpap_hss.upi_switchv2_dwh_risk_data_snapshot_v3
    WHERE DATE(dl_last_updated) BETWEEN DATE(DATE'2025-01-01' - INTERVAL '1' DAY) AND DATE'2025-01-31'
    AND (lower(regexp_replace(cast(json_extract(request, '$.requestPayload.payerVpa') as varchar), '"', '')) LIKE '%@paytm%'
    or lower(regexp_replace(cast(json_extract(request, '$.requestPayload.payerVpa') as varchar), '"', '')) like '%@pt%'
    or lower(regexp_replace(cast(json_extract(request, '$.requestPayload.payeeVpa') as varchar), '"', '')) LIKE '%@paytm%'
    or lower(regexp_replace(cast(json_extract(request, '$.requestPayload.payeeVpa') as varchar), '"', '')) like '%@pt%')
    -- AND regexp_replace(cast(json_extract(request, '$.requestPayload.payeeVpa') as varchar), '"', '') IS NOT NULL
    -- AND regexp_replace(cast(json_extract(request, '$.requestPayload.payerVpa') as varchar), '"', '') IS NOT NULL
    -- AND regexp_replace(cast(json_extract(request, '$.requestPayload.payeeVpa') as varchar), '"', '') <> ''
    -- AND regexp_replace(cast(json_extract(request, '$.requestPayload.payerVpa') as varchar), '"', '') <> ''
    AND json_extract_scalar(response, '$.action_recommended') <> 'BLOCK'
    AND regexp_replace(cast(json_extract(request, '$.requestPayload.payerType') AS varchar),'"','') = 'PERSON'
    AND regexp_replace(cast(json_extract(request, '$.requestPayload.payeeType') AS varchar),'"','') = 'PERSON'
    AND regexp_replace(cast(json_extract(request, '$.evaluationType') as varchar), '"', '') = 'UPI_TRANSACTION')D
ON B.txn_id = D.txnid
WHERE payee_vpa <> 'jio@citibank' AND payer_vpa IS NOT NULL
)
 
SELECT * FROM
    (SELECT t1.payer_vpa,
      t1.payee_vpa,
      t1.txn_id,
      t1.txn_amount,
      t1.category,
      t1.upi_subtype,
      t1.txn_time,
      t1.txn_date AS txn_date,
      COUNT(DISTINCT t2.payer_vpa) AS distinct_payer_vpa,
      50 AS payer_vpa_threshold
    FROM tpap_base t1
    INNER JOIN tpap_base t2
    ON t1.payee_vpa = t2.payee_vpa
      AND t2.txn_time BETWEEN (t1.txn_time - INTERVAL '1800' SECOND) AND t1.txn_time -- 30 MINS
      AND t1.txn_id <> t2.txn_id AND t1.payer_vpa <> t1.payer_vpa
      AND t1.txn_amount > 1500 AND t1.txn_date BETWEEN DATE'2025-07-01' AND DATE'2025-07-27'
    GROUP BY t1.payer_vpa, t1.payee_vpa, t1.txn_id, t1.txn_amount, t1.category, t1.upi_subtype, t1.txn_time, t1.txn_date)
WHERE distinct_payer_vpa >= payer_vpa_threshold
;
-- RISK_239
-- if in previous 20 minutes distinct(payer vpa)>=35 and txn amt > 1500 then block

DROP TABLE team_kingkong.tpap_risk239_breaches;

-- CREATE TABLE team_kingkong.tpap_risk239_breaches AS
INSERT INTO team_kingkong.tpap_risk239_breaches
with tpap_base as
(
SELECT DISTINCT B.*, C.category
, IF(D.upi_subtype IS NOT NULL, D.upi_subtype, IF(C.category = 'LITE_MANDATE', 'UPI_LITE_MANDATE', '')) AS upi_subtype
FROM
    (SELECT txn_id,
    MAX(CASE WHEN participant_type = 'PAYER' THEN vpa END) AS payer_vpa,
    MAX(CASE WHEN participant_type = 'PAYEE' THEN vpa END) AS payee_vpa,
    MAX(DATE(created_on)) as txn_date,
    MAX(amount) AS txn_amount,
    MAX(created_on) AS txn_time
    FROM switch.txn_participants_snapshot_v3
    WHERE DATE(dl_last_updated) BETWEEN DATE(DATE'2025-05-01' - INTERVAL '1' DAY) AND DATE'2025-05-31'
    AND DATE(created_on) BETWEEN DATE(DATE'2025-05-01' - INTERVAL '1' DAY) AND DATE'2025-05-31'
    GROUP BY 1)B
inner join
    (select txn_id, category
    from switch.txn_info_snapshot_v3
    where DATE(dl_last_updated) BETWEEN DATE(DATE'2025-05-01' - INTERVAL '1' DAY) AND DATE'2025-05-31'
    and DATE(created_on) BETWEEN DATE(DATE'2025-05-01' - INTERVAL '1' DAY) AND DATE'2025-05-31'
    and upper(status) = 'SUCCESS' AND category = 'VPA2VPA') C
on B.txn_id = C.txn_id
INNER JOIN
    (SELECT txnid
    , regexp_replace(cast(json_extract(request, '$.evaluationType') as varchar), '"', '') AS upi_subtype
    FROM tpap_hss.upi_switchv2_dwh_risk_data_snapshot_v3
    WHERE DATE(dl_last_updated) BETWEEN DATE(DATE'2025-05-01' - INTERVAL '1' DAY) AND DATE'2025-05-31'
    AND (lower(regexp_replace(cast(json_extract(request, '$.requestPayload.payerVpa') as varchar), '"', '')) LIKE '%@paytm%'
    or lower(regexp_replace(cast(json_extract(request, '$.requestPayload.payerVpa') as varchar), '"', '')) like '%@pt%')
    AND json_extract_scalar(response, '$.action_recommended') <> 'BLOCK'
    AND regexp_replace(cast(json_extract(request, '$.requestPayload.payerType') AS varchar),'"','') = 'PERSON'
    AND regexp_replace(cast(json_extract(request, '$.requestPayload.payeeType') AS varchar),'"','') = 'PERSON'
    AND regexp_replace(cast(json_extract(request, '$.evaluationType') as varchar), '"', '') =  'UPI_TRANSACTION')D
ON B.txn_id = D.txnid
WHERE ((payer_vpa LIKE '%@paytm%') OR (payer_vpa LIKE '%@pt%') OR (payee_vpa LIKE '%@paytm%') OR (payee_vpa LIKE '%@pt%'))
AND payee_vpa LIKE '%@%' AND payee_vpa <> 'jio@citibank'
)
 
SELECT *, 'upi_p2p_multiple_senders_20min' as rule_name FROM
    (SELECT t1.payer_vpa,
      t1.payee_vpa,
      t1.txn_id,
      t1.txn_amount,
      t1.category,
      t1.upi_subtype,
      t1.txn_time,
      t1.txn_date,
      COUNT(DISTINCT t2.payer_vpa) AS distinct_payer_vpa,
      35 AS payer_vpa_threshold
    FROM tpap_base t1
    INNER JOIN tpap_base t2
    ON t1.payee_vpa = t2.payee_vpa AND t1.payer_vpa <> t2.payer_vpa
      AND t2.txn_time BETWEEN (t1.txn_time - INTERVAL '1200' SECOND) AND t1.txn_time -- 20 MINS
      AND t1.txn_id <> t2.txn_id AND t1.payer_vpa <> t1.payer_vpa
      AND t1.txn_amount > 1500
    GROUP BY t1.payer_vpa, t1.payee_vpa, t1.txn_id, t1.txn_amount, t1.category, t1.upi_subtype, t1.txn_time, t1.txn_date)
WHERE distinct_payer_vpa >= payer_vpa_threshold
;
-- RISK510
DROP TABLE team_kingkong.tpap_risk510_breaches;

-- CREATE TABLE team_kingkong.tpap_risk510_breaches AS
INSERT INTO team_kingkong.tpap_risk510_breaches
with tpap_base as
(
SELECT DISTINCT B.*, C.category
, IF(D.upi_subtype IS NOT NULL, D.upi_subtype, IF(C.category = 'LITE_MANDATE', 'UPI_LITE_MANDATE', '')) AS upi_subtype
, D.latitude, D.longitude
, 'upi_p2p_multiple_locations_mcc_7407_v2Description' as rule_name
, 'p2m Txns from >50 locations in 24 hrs' as breach_reason
FROM
    (SELECT txn_id,
    MAX(CASE WHEN participant_type = 'PAYER' THEN vpa END) AS payer_vpa,
    MAX(CASE WHEN participant_type = 'PAYEE' THEN vpa END) AS payee_vpa,
    MAX(CASE WHEN participant_type = 'PAYEE' THEN mcc END) AS payee_mcc,
    MAX(DATE(created_on)) as txn_date,
    MAX(amount) AS txn_amount,
    MAX(created_on) AS txn_time
    FROM switch.txn_participants_snapshot_v3
    WHERE DATE(dl_last_updated) BETWEEN DATE(DATE'2025-01-01' - INTERVAL '1' DAY) AND DATE'2025-01-31'
    AND DATE(created_on) BETWEEN DATE(DATE'2025-01-01' - INTERVAL '1' DAY) AND DATE'2025-01-31'
    GROUP BY 1)B
inner join
    (select txn_id, category
    from switch.txn_info_snapshot_v3
    where DATE(dl_last_updated) BETWEEN DATE(DATE'2025-01-01' - INTERVAL '1' DAY) AND DATE'2025-01-31'
    and DATE(created_on) BETWEEN DATE(DATE'2025-01-01' - INTERVAL '1' DAY) AND DATE'2025-01-31'
    and upper(status) = 'SUCCESS' AND category = 'VPA2MERCHANT') C
on B.txn_id = C.txn_id
INNER JOIN
    (SELECT txnid
    , regexp_replace(cast(json_extract(request, '$.evaluationType') as varchar), '"', '') AS upi_subtype
    , regexp_replace(cast(json_extract(request, '$.requestPayload.latitude') as varchar), '"', '') as latitude
    , regexp_replace(cast(json_extract(request, '$.requestPayload.longitude') as varchar), '"', '') as longitude
    FROM tpap_hss.upi_switchv2_dwh_risk_data_snapshot_v3
    WHERE DATE(dl_last_updated) BETWEEN DATE(DATE'2025-01-01' - INTERVAL '1' DAY) AND DATE'2025-01-31'
    AND (lower(regexp_replace(cast(json_extract(request, '$.requestPayload.payerVpa') as varchar), '"', '')) LIKE '%@paytm%'
    or lower(regexp_replace(cast(json_extract(request, '$.requestPayload.payerVpa') as varchar), '"', '')) like '%@pt%')
    AND json_extract_scalar(response, '$.action_recommended') <> 'BLOCK'
    AND regexp_replace(cast(json_extract(request, '$.requestPayload.payerType') AS varchar),'"','') = 'PERSON'
    AND regexp_replace(cast(json_extract(request, '$.requestPayload.payeeType') AS varchar),'"','') = 'PERSON'
    AND regexp_replace(cast(json_extract(request, '$.evaluationType') as varchar), '"', '') = 'UPI_TRANSACTION')D
ON B.txn_id = D.txnid
WHERE ((payer_vpa LIKE '%@paytm%') OR (payer_vpa LIKE '%@pt%'))
AND payee_vpa LIKE '%@%'
)
 
SELECT * FROM
    (SELECT t1.payer_vpa,
      t1.payee_vpa,
      t1.payee_mcc,
      t1.txn_id,
      t1.txn_amount,
      t1.category,
      t1.upi_subtype,
      t1.txn_time,
      t1.latitude,
      t1.longitude,
      DATE(t1.txn_time) AS txn_date,
      COUNT(DISTINCT CONCAT(t2.latitude, '_', t2.longitude)) AS distinct_lat_lon_count,
      50 AS lat_long_cnt_threshold
    FROM tpap_base t1
    INNER JOIN tpap_base t2
    ON t1.payee_vpa = t2.payee_vpa
      AND t2.txn_time BETWEEN (t1.txn_time - INTERVAL '86400' SECOND) AND t1.txn_time -- 24 hrs
      AND t1.txn_id <> t2.txn_id AND t1.payee_mcc = '7407'
      AND NOT (t1.latitude = t2.latitude AND t1.longitude = t2.longitude)
    GROUP BY t1.payer_vpa, t1.payee_vpa, t1.payee_mcc, t1.txn_id, t1.txn_amount, t1.category, t1.upi_subtype, t1.txn_time, t1.txn_date, t1.latitude, t1.longitude)
WHERE distinct_lat_lon_count >= lat_long_cnt_threshold
;
Unlock the potential of automated crypto trading with our professional crypto trading bot development solutions. From flash loan arbitrage bots to smart grid strategies, we build tailored bots that monitor markets, execute trades, and generate consistent results.
 Explore the future of automated trading today.
{
  "DFIntTaskSchedulerTargetFps": 5588562,
  "FFlagDebugSkyGray": true,
  "FFlagDebugDisplayFPS": false,
  "DFFlagDebugRenderForceTechnologyVoxel": true,
  "DFFlagDebugPauseVoxelizer": true,
  "FFlagNewLightAttenuation": true,
  "FIntRenderShadowIntensity": 0,
  "FFlagDisablePostFx": true,
  "DFFlagTextureQualityOverrideEnabled": true,
  "DFIntTextureQualityOverride": 0,
  "FIntRenderShadowmapBias": 0,
  "FFlagLuaAppSystemBar": false,
  "FIntFontSizePadding": 3,
  "FFlagAdServiceEnabled": false,
  "FFlagDebugDisableTelemetryEphemeralCounter": true,
  "FFlagDebugDisableTelemetryEphemeralStat": true,
  "FFlagDebugDisableTelemetryEventIngest": true,
  "FFlagDebugDisableTelemetryPoint": true,
  "FFlagDebugDisableTelemetryV2Counter": true,
  "FFlagDebugDisableTelemetryV2Event": true,
  "FFlagDebugDisableTelemetryV2Stat": true,
  "DFIntCSGLevelOfDetailSwitchingDistance": 1
}
Videos:
Länge (= Dauer in h:m:s) 
Bildbreite (Höhe in px)
Bildhöhe (Breite in px)
Videoausrichtung (Gradzahl zeigt Hoch oder Quer)
```dataviewjs
class PersistentData {
	static #constructKey = Symbol()
	static #instance
	static _dataFilePath
	static _defaultData
	_dataFilePath
	_defaultData
	_data
	constructor(constructKey, dataFilePath, defaultData) {
		if (constructKey !== PersistentData.#constructKey)
			throw new Error('constructor is private')
		this._dataFilePath = dataFilePath
		this._defaultData = defaultData
	}
	static setConfig(dataFilePath, dafaultData){
		this._dataFilePath = dataFilePath
		this._defaultData = dafaultData
	}
	static async getInstance(){
		if (!this.#instance){
			this.#instance = new PersistentData(
				this.#constructKey,
				this._dataFilePath,
				this._defaultData
			)
			await this.#instance.initialize()
		}
		return this.#instance
	}
	async initialize(){
		const exists = await app.vault.adapter.exists(this._dataFilePath)
		if (exists) {
			const str = await app.vault.adapter.read(this._dataFilePath)
			const data = JSON.parse(str)
			// 保存されているデータとdefaultDataのキーが不一致の場合、データの仕様が変わったと判断し、保存データをdefaultDataにリセットする
			if (this._haveSameKeys(data, this._defaultData)){
				this._data = data
				return
			}
		}
		this._data = this._defaultData
		await this.saveData()
	}
	getData(key){
		return this._data[key]
	}
	async setData(key, value){
		this._data[key] = value
		await this.saveData()
	}
	async saveData(){
		await app.vault.adapter.write(this._dataFilePath, this._toJSON(this._data))
	}
	_haveSameKeys(obj1, obj2) {
		const keys1 = Object.keys(obj1).sort()
		const keys2 = Object.keys(obj2).sort()
		return keys1.length === keys2.length && keys1.every((key, index) => key === keys2[index])
	}
	_toJSON(obj){
		return JSON.stringify(obj, null, 2)
	}
}

function debounce(func, wait) {
	let timeout = null
	return function(...args) {
		if (timeout)
			clearTimeout(timeout)
		timeout = setTimeout(() => {
			func(...args)
			timeout = null
		}, wait)
	}
}

function escapeHtml(str) {
	return str
		.replace(/&/g, "&amp;")
		.replace(/</g, "&lt;")
		.replace(/>/g, "&gt;")
		.replace(/"/g, "&quot;")
		.replace(/'/g, "&#039;")
}

async function updateList() {
	const daysBack = selectDays.value
	const now = dv.date('now')
	let pages

	const startDate = now.minus({ days: parseInt(daysBack) - 1 }).startOf('day')
	pages = dv.pages()
		.where(p => {
			const mtime = dv.date(p.file.mtime)
			return mtime >= startDate && mtime <= now
		})

    if (searchString)
		pages = pages.where(p => p.file.name.toLowerCase().includes(searchString.toLowerCase()))

	const folderCounts = {}
	pages.forEach(page => {
		const folder = page.file.folder || ''
		folderCounts[folder] = (folderCounts[folder] || 0) + 1
	})

	const folders = Array.from(pages.file.folder.distinct()).sort()
	folders.unshift('すべてのフォルダ')

	if (!folders.includes(currentFolder)){
		currentFolder = 'すべてのフォルダ'
		await persistentData.setData('currentFolder', currentFolder)
	}

	selectFolder.innerHTML = ''
	folders.forEach(folder => {
		const count = folder === 'すべてのフォルダ' ? pages.length : (folderCounts[folder] || 0)
		const displayText = folder === 'すべてのフォルダ' ? `${folder} (${count})` : `${folder} (${count})`
		const option = dv.el('option', displayText, { container: selectFolder })
		option.value = folder
		if (folder === currentFolder)
			option.selected = true
	})

    let filteredPages = pages
    if (currentFolder !== 'すべてのフォルダ')
        filteredPages = pages.where(p => p.file.folder === currentFolder)

	const liList = []
	filteredPages
		.sort(p => p.file.mtime, 'desc')
		.forEach((page) => {
			liList.push('<li><a data-url="' + escapeHtml(page.file.path) + '">' + escapeHtml(page.file.name) + '</a></li>')
		})
	listContainer.innerHTML = '<ul>' + liList.join('') + '</ul>'
}

const config = {
	persistentData: {
		// 永続データ保存ファイルのVault内パス
		// 親ディレクトリは前もって作成しておく
		dataFilePath: '/Scripts/Dataview/PersistentData/touchSort.json',

		// 永続データのデフォルト値
		defaultData: {selectDaysValue: 10, currentFolder: 'すべてのフォルダ', searchString: ''}
	},
	// 日数の選択肢
	selectDaysOptions: [1, 2, 3, 5, 7, 10, 14, 20, 30, 60]
}

PersistentData.setConfig(
	config.persistentData.dataFilePath,
	config.persistentData.defaultData
)
const persistentData = await PersistentData.getInstance()

let currentFolder = persistentData.getData('currentFolder')
let searchString = persistentData.getData('searchString')

const selectDays = dv.el('select', '')
const options = config.selectDaysOptions
options.forEach(option => {
    const opt = dv.el('option', `${option}日`, { container: selectDays })
    opt.value = option
})

const selectFolder = dv.el('select', '')
const searchInput = dv.el('input', '', { attr: { type: 'text', placeholder: '検索', value: searchString} })
const listContainer = dv.el('div', '')

listContainer.addEventListener('click',(e)=>{
	if (e.target.tagName === 'A')
		app.workspace.openLinkText(e.target.dataset.url, '', true)
})

selectDays.addEventListener('change', async () => {
	updateList()
	await persistentData.setData('selectDaysValue', selectDays.value)
})

selectFolder.addEventListener('change', async () => {
    currentFolder = selectFolder.value
    updateList()
	await persistentData.setData('currentFolder', currentFolder)
})

searchInput.addEventListener('input', debounce(async () => {
    searchString = searchInput.value.trim()
    updateList()
	await persistentData.setData('searchString', searchString)
}, 1000))

selectDays.value = persistentData.getData('selectDaysValue')
selectFolder.value = currentFolder
updateList()

```
<?php

function findFirstDuplicate($arr) {
    $seen = [];
    foreach ($arr as $num) {
        if (isset($seen[$num])) {
            return $num;
        }
        $seen[$num] = true;
    }
    return null;
}

$fn = fn($arr) => findFirstDuplicate($arr);

echo $fn([2, 5, 1, 2, 3, 5]); // Output: 2
```dataviewjs
class PersistentData {
	static #constructKey = Symbol()
	static #instance
	static _dataFilePath
	static _defaultData
	_dataFilePath
	_defaultData
	_data
	constructor(constructKey, dataFilePath, defaultData) {
		if (constructKey !== PersistentData.#constructKey)
			throw new Error('constructor is private')
		this._dataFilePath = dataFilePath
		this._defaultData = defaultData
	}
	static setConfig(dataFilePath, dafaultData){
		this._dataFilePath = dataFilePath
		this._defaultData = dafaultData
	}
	static async getInstance(){
		if (!this.#instance){
			this.#instance = new PersistentData(
				this.#constructKey,
				this._dataFilePath,
				this._defaultData
			)
			await this.#instance.initialize()
		}
		return this.#instance
	}
	async initialize(){
		const exists = await app.vault.adapter.exists(this._dataFilePath)
		if (exists) {
			const str = await app.vault.adapter.read(this._dataFilePath)
			const data = JSON.parse(str)
			// 保存されているデータとdefaultDataのキーが不一致の場合、データの仕様が変わったと判断し、保存データをdefaultDataにリセットする
			if (this._haveSameKeys(data, this._defaultData)){
				this._data = data
				return
			}
		}
		this._data = this._defaultData
		await this.saveData()
	}
	getData(key){
		return this._data[key]
	}
	async setData(key, value){
		this._data[key] = value
		await this.saveData()
	}
	async saveData(){
		await app.vault.adapter.write(this._dataFilePath, this._toJSON(this._data))
	}
	_haveSameKeys(obj1, obj2) {
		const keys1 = Object.keys(obj1).sort()
		const keys2 = Object.keys(obj2).sort()
		return keys1.length === keys2.length && keys1.every((key, index) => key === keys2[index])
	}
	_toJSON(obj){
		return JSON.stringify(obj, null, 2)
	}
}

function debounce(func, wait) {
	let timeout = null
	return function(...args) {
		if (timeout)
			clearTimeout(timeout)
		timeout = setTimeout(() => {
			func(...args)
			timeout = null
		}, wait)
	}
}

function escapeHtml(str) {
	return str
		.replace(/&/g, "&amp;")
		.replace(/</g, "&lt;")
		.replace(/>/g, "&gt;")
		.replace(/"/g, "&quot;")
		.replace(/'/g, "&#039;")
}

async function updateList() {
	const daysBack = selectDays.value
	const now = dv.date('now')
	let pages

	const startDate = now.minus({ days: parseInt(daysBack) - 1 }).startOf('day')
	pages = dv.pages()
		.where(p => {
			const mtime = dv.date(p.file.mtime)
			return mtime >= startDate && mtime <= now
		})

    if (searchString)
		pages = pages.where(p => p.file.name.toLowerCase().includes(searchString.toLowerCase()))

	const folderCounts = {}
	pages.forEach(page => {
		const folder = page.file.folder || ''
		folderCounts[folder] = (folderCounts[folder] || 0) + 1
	})

	const folders = Array.from(pages.file.folder.distinct()).sort()
	folders.unshift('すべてのフォルダ')

	if (!folders.includes(currentFolder)){
		currentFolder = 'すべてのフォルダ'
		await persistentData.setData('currentFolder', currentFolder)
	}

	selectFolder.innerHTML = ''
	folders.forEach(folder => {
		const count = folder === 'すべてのフォルダ' ? pages.length : (folderCounts[folder] || 0)
		const displayText = folder === 'すべてのフォルダ' ? `${folder} (${count})` : `${folder} (${count})`
		const option = dv.el('option', displayText, { container: selectFolder })
		option.value = folder
		if (folder === currentFolder)
			option.selected = true
	})

    let filteredPages = pages
    if (currentFolder !== 'すべてのフォルダ')
        filteredPages = pages.where(p => p.file.folder === currentFolder)

	const liList = []
	filteredPages
		.sort(p => p.file.mtime, 'desc')
		.forEach((page) => {
			liList.push('<li><a data-url="' + escapeHtml(page.file.path) + '">' + escapeHtml(page.file.name) + '</a></li>')
		})
	listContainer.innerHTML = '<ul>' + liList.join('') + '</ul>'
}

const config = {
	persistentData: {
		// 永続データ保存ファイルのVault内パス
		// 親ディレクトリは前もって作成しておく
		dataFilePath: '/Scripts/Dataview/PersistentData/touchSort.json',

		// 永続データのデフォルト値
		defaultData: {selectDaysValue: 10, currentFolder: 'すべてのフォルダ', searchString: ''}
	},
	// 日数の選択肢
	selectDaysOptions: [1, 2, 3, 5, 7, 10, 14, 20, 30, 60]
}

PersistentData.setConfig(
	config.persistentData.dataFilePath,
	config.persistentData.defaultData
)
const persistentData = await PersistentData.getInstance()

let currentFolder = persistentData.getData('currentFolder')
let searchString = persistentData.getData('searchString')

const selectDays = dv.el('select', '')
const options = config.selectDaysOptions
options.forEach(option => {
    const opt = dv.el('option', `${option}日`, { container: selectDays })
    opt.value = option
})

const selectFolder = dv.el('select', '')
const searchInput = dv.el('input', '', { attr: { type: 'text', placeholder: '検索', value: searchString} })
const listContainer = dv.el('div', '')

listContainer.addEventListener('click',(e)=>{
	app.workspace.openLinkText(e.target.dataset.url, '', true)
})

selectDays.addEventListener('change', async () => {
	updateList()
	await persistentData.setData('selectDaysValue', selectDays.value)
})

selectFolder.addEventListener('change', async () => {
    currentFolder = selectFolder.value
    updateList()
	await persistentData.setData('currentFolder', currentFolder)
})

searchInput.addEventListener('input', debounce(async () => {
    searchString = searchInput.value.trim()
    updateList()
	await persistentData.setData('searchString', searchString)
}, 1000))

selectDays.value = persistentData.getData('selectDaysValue')
selectFolder.value = currentFolder
updateList()

```
Develop a safe NFT Digital Horse Racing Platform with Addustechnologies.  Our White-Label Zed Run Clone Software enables you to access the growing NFT gaming business.  Develop your own Zed Run Clone Script now, utilising advanced blockchain, smart contracts, and immersive gameplay.  Join the NFT Horse Racing Game Revolution.  Scale quicker with our advanced Zed Run Clone Script solution.
1. Instalar el servidor OpenSSH
Abre la terminal y asegúrate de que el paquete de servidor SSH esté instalado:
bash
sudo apt update
sudo apt install openssh-server

Verifica que el servicio esté activo:
bash
sudo systemctl status ssh

Si no está activo, inícialo con:
bash
sudo systemctl start ssh

2. Crear un usuario para acceso SFTP (opcional)
Si quieres un usuario específico para SFTP, créalo así:
bash
sudo adduser nombreusuario
Asigna la contraseña y los datos que te pida.

3. Configurar acceso SFTP restringido (opcional, para mayor seguridad)
Si quieres que el usuario solo acceda a un directorio específico (jaula/chroot), edita la configuración SSH:
bash
sudo nano /etc/ssh/sshd_config

Al final del archivo agrega algo así para restringir el usuario a su carpeta SFTP:
text
Match User nombreusuario
    ChrootDirectory /home/nombreusuario/ftp
    ForceCommand internal-sftp
    AllowTcpForwarding no
    X11Forwarding no

Luego crea la carpeta y asigna permisos apropiados:
bash
sudo mkdir -p /home/nombreusuario/ftp
sudo chown root:root /home/nombreusuario
sudo chown nombreusuario:nombreusuario /home/nombreusuario/ftp
Esto asegura que el usuario solo pueda acceder a /home/nombreusuario/ftp vía SFTP.

4. Reiniciar el servidor SSH para aplicar cambios
bash
sudo systemctl restart ssh
Te pedirá la contraseña y luego podrás usar comandos como ls, cd, put o get para subir y bajar archivos.

6. Acceso gráfico (opcional)
En el gestor de archivos, ve a "Conectar al servidor" y escribe:
text
sftp://nombreusuario@ip_del_servidor
Ingresa la contraseña y podrás acceder como si fuera una carpeta local.
Esta es la manera estándar de configurar un servidor SFTP seguro en Linux Mint, usando OpenSSH que ofrece cifrado y autenticación robusta sin necesidad de configurar servidores FTP separados.

configurar el acceso SFTP con claves SSH en lugar de contraseña o a crear un entorno SFTP aún más seguro.

1. Generar un par de claves SSH en tu equipo cliente
Abre una terminal en la máquina desde donde te conectarás (puede ser la misma Linux Mint o tu PC cliente) y genera las claves SSH con:
ssh-keygen -t ed25519
Si prefieres RSA (también válido), usa -t rsa.
Cuando te pregunte dónde guardarlas, puedes aceptar la ruta predeterminada (~/.ssh/id_ed25519).
Opcionalmente, asigna una frase de contraseña (passphrase) para mayor seguridad o déjalo vacío para acceso sin contraseña.
Esto generará dos archivos: la clave privada (id_ed25519) y la clave pública (id_ed25519.pub).

2. Copiar la clave pública al servidor Linux Mint (donde está el servidor SSH)
Para permitir el acceso sin contraseña, copia la clave pública al servidor en el archivo authorized_keys del usuario al que quieres conectarte:
bash
ssh-copy-id nombreusuario@ip_del_servidor
Sustituye nombreusuario por el usuario del servidor y ip_del_servidor por la IP real o dominio.

Si no tienes la herramienta ssh-copy-id, puedes hacerlo manualmente:
Conecta al servidor con contraseña:
bash
ssh nombreusuario@ip_del_servidor

Luego en cliente local:
bash
cat ~/.ssh/id_ed25519.pub | ssh nombreusuario@ip_del_servidor "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys && chmod 700 ~/.ssh && chmod 600 ~/.ssh/authorized_keys"

3. Configurar el servidor SSH para usar solo autenticación por clave (opcional y seguro)
Edita la configuración SSH en el servidor:
bash
sudo nano /etc/ssh/sshd_config

Busca o agrega las siguientes líneas para permitir la autenticación mediante claves y deshabilitar la contraseña si quieres máxima seguridad:
text
PubkeyAuthentication yes
PasswordAuthentication no
ChallengeResponseAuthentication no
Nota: No apagues la autenticación por contraseña hasta que hayas confirmado que la autenticación por clave funciona correctamente, para evitar quedarte sin acceso.

Guarda el archivo y reinicia el servidor SSH:
bash
sudo systemctl restart ssh

4. (Opcional) Configurar un entorno SFTP restringido (jaula/chroot)
Si quieres limitar al usuario a solo un directorio específico cuando use SFTP (por ejemplo /home/nombreusuario/ftp), agrega estas líneas al final del archivo /etc/ssh/sshd_config:
text
Match User nombreusuario
    ChrootDirectory /home/nombreusuario/ftp
    ForceCommand internal-sftp
    AllowTcpForwarding no
    X11Forwarding no

Luego ajusta permisos del directorio principal (chroot):
bash
sudo chown root:root /home/nombreusuario
sudo chmod 755 /home/nombreusuario
sudo mkdir -p /home/nombreusuario/ftp
sudo chown nombreusuario:nombreusuario /home/nombreusuario/ftp

Y reinicia el servicio SSH nuevamente:
bash
sudo systemctl restart ssh

5. Conectarte al servidor desde cliente usando SFTP con clave SSH
Usa el siguiente comando para conectar:
bash
sftp nombreusuario@ip_del_servidor
Ahora la conexión no debe pedir contraseña, sino que usará la clave privada para autenticar.
Si la clave privada tiene passphrase, te la pedirá para desbloquear la clave.

6. (Opcional) Usar agente SSH para gestionar la clave privada
Para no tener que ingresar la passphrase cada vez, puedes agregar la clave al agente SSH:
bash
ssh-add ~/.ssh/id_ed25519

7. Acceso gráfico al SFTP con clave SSH
En gestores de archivo modernos (Nautilus, Caja):
Ve a "Conectar al servidor"
Escribe:
text
sftp://nombreusuario@ip_del_servidor
Si configuraste clave sin passphrase o tienes la clave "cargada" en el agente SSH, te conectará sin pedir contraseña.
Con esto tienes configurado un acceso SFTP seguro mediante claves SSH, muy superior a usar contraseña, y opcionalmente protegido con un entorno restringido (chroot). Si quieres, puedo ayudarte a preparar scripts automatizados o detalles para gestionar varias claves o usuarios.






Actualizar repositorios e instalar vsftpd:
Abre una terminal y ejecuta:

bash
sudo apt update
sudo apt install vsftpd
Esto instalará el servidor FTP vsftpd.

Configurar vsftpd:
Edita el archivo de configuración con:

bash
sudo nano /etc/vsftpd.conf

Algunos ajustes importantes que puedes incluir o modificar en ese archivo son:

anonymous_enable=NO (desactiva acceso anónimo)

local_enable=YES (permite acceso a usuarios locales)

write_enable=YES (permite subir archivos)

chroot_local_user=YES (limita al usuario a su carpeta raíz)

Puedes configurar local_root=/ruta/a/tu/carpeta si quieres que los usuarios vean una carpeta específica
Guarda y cierra con Ctrl+O y Ctrl+X.

Reiniciar el servicio para aplicar cambios:
bash
sudo systemctl restart vsftpd

Crear un usuario FTP para acceder:
sudo adduser nombreusuario

Define su contraseña y detalles. Este usuario podrá acceder al servidor FTP con esa cuenta.
Crear la carpeta que quieres compartir y asignar permisos:
Por ejemplo:
mkdir -p /home/nombreusuario/ftp
chmod 755 /home/nombreusuario/ftp

Ajusta permisos según tus necesidades.
Comprobar que el servidor está activo:
sudo systemctl status vsftpd

Asegúrate que el servidor vsftpd esté activo:
bash
sudo systemctl status vsftpd
Debe aparecer como activo (running). Si no, inícialo con:

inícialo con:
bash
sudo systemctl start vsftpd

reiniciar vsftpd:
bash
sudo systemctl restart vsftpd

Conéctate al servidor FTP desde otro equipo o desde tu mismo Linux Mint:

Desde la terminal, usa:
bash
ftp dirección_ip_o_nombre_del_servidor

Acceso gráfico (opcional):

En el gestor de archivos (Caja o Nautilus), ve a "Otras ubicaciones".
En "Conectar al servidor", ingresa:
ftp://dirección_ip_o_nombre_del_servidor

También asegúrate que el usuario esté "enjaulado" (chroot) para evitar que salga de ese directorio, con:
chroot_local_user=YES
<%{
	CompanyLogo = "https://carrierwheels.com/images/CW_Logo.png";
	get_comp = Company_Details[ID != null];
	stk = get_comp.Calibration_Sticker;
	img_name = stk.getSuffix("image/").getPrefix("border").replaceAll("\"","").getPrefix("lowqual").trim();
	qrurl = "https://previewengine-accl.zoho.in/image/WD/75us6336db819bd5547e8abb2aedb299e71f8?version=1.0&width=2046&height=1536";
	log = get_comp.Calibration_Sticker.getSuffix("image/").getPrefix("border").replaceAll("\"","").trim();
	comp_logo = "https://creatorapp.zohopublic.in/carrierwheels/erp/Company_Details_Report/" + get_comp.ID + "/Calibration_Sticker/image-download/j6hYk3Aydznp76py4dSap5JAORMuJxeEjMAb2Vdsteh0Cg35dYySwyzXFY2Fz1KFhjwJttt5ka7nn5jbvnnxGJD1Hh8BeJMJ6qZN/" + log;
	test_lis = List();
	text = input.var_text.toList();
	%>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<style>


.table2
   {
   width : 10%;
   border :1px solid black;
   text-align : center;
   border-collapse : collapse;
   font-family: Times New Roman;
   margin-left:auto;
   margin-right:auto;
   }
   html{
    height: 100%;
}
.column {
  float: left;
  width: 20%;
  padding: 9px;
  height: 200px;
}

.row:after {
  content: "";
  display: table;
  width: 100%;
  clear: both;
}
@media print {
     body {margin: 0mm}
}
</style>
<div class="row" style="padding:7%">
<%
	for each  rec in text
	{
		fetcal = Calibration_History[ID == rec];
		calmast = Calibration_Master[Gauge_No == fetcal.Gauge_No.Gauge_No];
		%>
<div class="column">
			<img src=<%=comp_logo%> width="110px" height ="18px">
			<h4 style="font-size:7.5px">Gauge No:<%=ifnull(fetcal.Gauge_No.Gauge_No,"")%></h4>
			<h4 style="font-size:7.5px">Cal Done Date:<%=ifnull(fetcal.Cal_Done_Date,"")%></h4>
			<h4 style="font-size:7.5px">Cal Due Date:<%=ifnull(calmast.Cal_Due_Date,"")%></h4>
			<h4 style="font-size:7.5px">Checked By:<%=ifnull(fetcal.Calibration_By.Employee_Name,"")%></h4>
			</div>
<%
	}
	%>
</div>
<%

}%>
Meme coins combine humor, community, and blockchain to create new ways of engagement. These tokens often start as internet jokes but can quickly turn into powerful tools for building online communities, boosting visibility, and even raising funds. With features such as limited supply, reward mechanisms, and community voting, meme coins offer more than just entertainment; they drive interaction and loyalty. Many startups and creators are now exploring meme coin development to connect with their audience freshly and engagingly. Beleaf Technologies supports the development of such coins by offering technical guidance, secure blockchain integration, and thoughtful design. Whether used for branding, online communities, or community-building, meme coins have opened a new space in digital culture where creativity meets technology.
Get a free Demo and Consultation >>> https://www.beleaftechnologies.com/meme-coin-development-company

WhatsApp: +91 8056786622

Mail to: business@beleaftechnologies.com 
-- RISK292
-- if in previous 24 hours distinct( lat,long)>=50 then block. Lat long in round 1
DROP TABLE team_kingkong.tpap_risk292_breaches;

-- CREATE TABLE team_kingkong.tpap_risk292_breaches AS
INSERT INTO team_kingkong.tpap_risk292_breaches
with tpap_base as
(
SELECT DISTINCT B.*, C.category
, IF(D.upi_subtype IS NOT NULL, D.upi_subtype, IF(C.category = 'LITE_MANDATE', 'UPI_LITE_MANDATE', '')) AS upi_subtype
, D.latitude, D.longitude
FROM
    (SELECT txn_id,
    MAX(CASE WHEN participant_type = 'PAYER' THEN vpa END) AS payer_vpa,
    MAX(CASE WHEN participant_type = 'PAYEE' THEN vpa END) AS payee_vpa,
    MAX(DATE(created_on)) as txn_date,
    MAX(amount) AS txn_amount,
    MAX(created_on) AS txn_time
    FROM switch.txn_participants_snapshot_v3
    WHERE DATE(dl_last_updated) BETWEEN DATE(DATE'2025-01-01'- INTERVAL '2' DAY) AND DATE'2025-01-31'
    AND DATE(created_on) BETWEEN DATE(DATE'2025-01-01'- INTERVAL '2' DAY) AND DATE'2025-01-31'
    GROUP BY 1)B
inner join
    (select txn_id, category
    from switch.txn_info_snapshot_v3
    where DATE(dl_last_updated) BETWEEN DATE(DATE'2025-01-01'- INTERVAL '2' DAY) AND DATE'2025-01-31'
    and DATE(created_on) BETWEEN DATE(DATE'2025-01-01'- INTERVAL '2' DAY) AND DATE'2025-01-31'
    and upper(status) = 'SUCCESS' AND category = 'VPA2VPA') C
on B.txn_id = C.txn_id
INNER JOIN
    (SELECT txnid
    , regexp_replace(cast(json_extract(request, '$.evaluationType') as varchar), '"', '') AS upi_subtype
    , regexp_replace(cast(json_extract(request, '$.requestPayload.latitude') as varchar), '"', '') as latitude
    , regexp_replace(cast(json_extract(request, '$.requestPayload.longitude') as varchar), '"', '') as longitude
    FROM tpap_hss.upi_switchv2_dwh_risk_data_snapshot_v3
    WHERE DATE(dl_last_updated) BETWEEN DATE(DATE'2025-01-01'- INTERVAL '2' DAY) AND DATE'2025-01-31'
    AND (lower(regexp_replace(cast(json_extract(request, '$.requestPayload.payerVpa') as varchar), '"', '')) LIKE '%@paytm%'
    or lower(regexp_replace(cast(json_extract(request, '$.requestPayload.payerVpa') as varchar), '"', '')) like '%@pt%')
    AND json_extract_scalar(response, '$.action_recommended') <> 'BLOCK'
    AND regexp_replace(cast(json_extract(request, '$.requestPayload.payerType') AS varchar),'"','') = 'PERSON'
    AND regexp_replace(cast(json_extract(request, '$.requestPayload.payeeType') AS varchar),'"','') = 'PERSON'
    AND regexp_replace(cast(json_extract(request, '$.evaluationType') as varchar), '"', '') = 'UPI_TRANSACTION')D
ON B.txn_id = D.txnid
WHERE ((payer_vpa LIKE '%@paytm%') OR (payer_vpa LIKE '%@pt%'))
AND payee_vpa LIKE '%@%' AND payee_vpa <> 'jio@citibank'
)
 
SELECT *, 'upi_p2p_multiple_locations_rnd_1' as rule_name, 'Multiple sender locations for payee' as breach_reason FROM
    (SELECT t1.payer_vpa,
      t1.payee_vpa,
      t1.txn_id,
      t1.txn_amount,
      t1.category,
      t1.upi_subtype,
      t1.txn_time,
      t1.latitude,
      t1.longitude,
      t1.txn_date,
      COUNT(DISTINCT CONCAT(t2.latitude, '_', t2.longitude)) AS distinct_lat_lon_count,
      50 AS lat_long_cnt_threshold
    FROM tpap_base t1
    INNER JOIN tpap_base t2
    ON t1.payee_vpa = t2.payee_vpa
      AND t2.txn_time BETWEEN (t1.txn_time - INTERVAL '86400' SECOND) AND t1.txn_time -- 24 hrs
      AND t1.txn_id <> t2.txn_id AND t1.txn_date BETWEEN DATE'2025-01-01' AND DATE'2025-01-31'
      AND NOT (t1.latitude = t2.latitude AND t1.longitude = t2.longitude)
    GROUP BY t1.payer_vpa, t1.payee_vpa, t1.txn_id, t1.txn_amount, t1.category, t1.upi_subtype, t1.txn_time, t1.txn_date, t1.latitude, t1.longitude)
WHERE distinct_lat_lon_count >= lat_long_cnt_threshold;
-- RISK_292
-- if in previous 24 hours distinct( lat,long)>=50 then block. Lat long in round 1

-- CREATE TABLE team_kingkong.tpap_risk292_breaches AS
INSERT INTO team_kingkong.tpap_risk292_breaches
with tpap_base as
(
SELECT DISTINCT B.*, C.category
, IF(D.upi_subtype IS NOT NULL, D.upi_subtype, IF(C.category = 'LITE_MANDATE', 'UPI_LITE_MANDATE', '')) AS upi_subtype
, D.latitude, D.longitude
FROM
    (SELECT txn_id, scope_cust_id,
    MAX(CASE WHEN participant_type = 'PAYER' THEN vpa END) AS payer_vpa,
    MAX(CASE WHEN participant_type = 'PAYEE' THEN vpa END) AS payee_vpa,
    MAX(created_on) as txn_date,
    MAX(amount) AS txn_amount,
    created_on AS txn_time
    FROM switch.txn_participants_snapshot_v3
    WHERE DATE(dl_last_updated) BETWEEN DATE(DATE'2025-01-01' - INTERVAL '1' DAY) AND DATE'2025-01-31'
    AND DATE(created_on) BETWEEN DATE(DATE'2025-01-01' - INTERVAL '1' DAY) AND DATE'2025-01-31'
    AND vpa IS NOT NULL
    GROUP BY 1,2,7)B
inner join
    (select txn_id, category
    from switch.txn_info_snapshot_v3
    where DATE(dl_last_updated) BETWEEN DATE(DATE'2025-01-01' - INTERVAL '1' DAY) AND DATE'2025-01-31'
    and DATE(created_on) BETWEEN DATE(DATE'2025-01-01' - INTERVAL '1' DAY) AND DATE'2025-01-31'
    and upper(status) in ('SUCCESS')) C
on B.txn_id = C.txn_id
INNER JOIN
    (SELECT txnid
    , regexp_replace(cast(json_extract(request, '$.evaluationType') as varchar), '"', '') AS upi_subtype
    , regexp_replace(cast(json_extract(request, '$.requestPayload.latitude') as varchar), '"', '') as latitude
    , regexp_replace(cast(json_extract(request, '$.requestPayload.longitude') as varchar), '"', '') as longitude
    FROM tpap_hss.upi_switchv2_dwh_risk_data_snapshot_v3
    WHERE DATE(dl_last_updated) BETWEEN DATE(DATE'2025-01-01' - INTERVAL '1' DAY) AND DATE'2025-01-31'
    AND (lower(regexp_replace(cast(json_extract(request, '$.requestPayload.payerVpa') as varchar), '"', '')) LIKE '%@paytm%'
    or lower(regexp_replace(cast(json_extract(request, '$.requestPayload.payerVpa') as varchar), '"', '')) like '%@pt%')
    AND json_extract_scalar(response, '$.action_recommended') <> 'BLOCK'
    AND regexp_replace(cast(json_extract(request, '$.requestPayload.payerType') AS varchar),'"','') = 'PERSON'
    AND regexp_replace(cast(json_extract(request, '$.requestPayload.payeeType') AS varchar),'"','') = 'PERSON')D
ON B.txn_id = D.txnid
WHERE ((payer_vpa LIKE '%@paytm%') OR (payer_vpa LIKE '%@pt%'))
AND payee_vpa LIKE '%@%' AND payee_vpa <> 'jio@citibank'
AND upi_subtype = 'UPI_TRANSACTION'
)
 
SELECT * FROM
    (SELECT t1.payer_vpa,
      t1.payee_vpa,
      t1.txn_id,
      t1.txn_amount,
      t1.category,
      t1.upi_subtype,
      t1.txn_time,
      t1.latitude,
      t1.longitude,
      DATE(t1.txn_time) AS txn_date,
      COUNT(DISTINCT CONCAT(t2.latitude, '_', t2.longitude)) AS distinct_lat_lon_count,
      50 AS lat_long_cnt_threshold
    FROM tpap_base t1
    INNER JOIN tpap_base t2
    ON t1.payee_vpa = t2.payee_vpa
      AND t2.txn_time BETWEEN (t1.txn_time - INTERVAL '86400' SECOND) AND t1.txn_time -- 24 hrs
      AND t1.txn_id <> t2.txn_id
      AND NOT (t1.latitude = t2.latitude AND t1.longitude = t2.longitude)
    GROUP BY t1.payer_vpa, t1.payee_vpa, t1.txn_id, t1.txn_amount, t1.category, t1.upi_subtype, t1.txn_time, DATE(t1.txn_time), t1.latitude, t1.longitude)
WHERE distinct_lat_lon_count >= lat_long_cnt_threshold
;
PORT=1000
PROXY_ENABLED=false
See_Chane_Web_DB=mongodb://192.168.13.83/See_Chane_Web
MrRight_DB=mongodb://192.168.13.83/MrRight
Rcyc_DB=mongodb://192.168.13.83/Rcyc
See360_DB=mongodb://192.168.13.83/See360
SeeChange_DB=mongodb://192.168.13.83/SeeChange
# MONGODB_URI=mongodb+srv://rishirri108:1234567890@cluster0.qpi4j.mongodb.net/?retryWrites=true&w=majority&appName=Cluster0
MONGODB_MrRight=mongodb+srv://rishirri108:1234567890@cluster0.qpi4j.mongodb.net/MrRight?retryWrites=true&w=majority&appName=Cluster0
MONGODB_Rcyc=mongodb+srv://rishirri108:1234567890@cluster0.qpi4j.mongodb.net/Rcyc?retryWrites=true&w=majority&appName=Cluster0
MONGODB_See360=mongodb+srv://rishirri108:1234567890@cluster0.qpi4j.mongodb.net/See360?retryWrites=true&w=majority&appName=Cluster0
MONGODB_SeeChange=mongodb+srv://rishirri108:1234567890@cluster0.qpi4j.mongodb.net/SeeChange?retryWrites=true&w=majority&appName=Cluster0

JWT_SECRET=Consoul@123
JWT_EXPIRES=1y

#RRI Test
# RAZORPAY_KEY_ID=rzp_test_u85r2jwM23xKlY
# RAZORPAY_KEY_SECRET=0q84vUiUDgL7ikOtM6q8mj8i

# SC
RAZORPAY_KEY_ID=rzp_live_fC8chfUhTHOaxJ
RAZORPAY_KEY_SECRET=TaMjK6BWGR7F9Tn5iE8H5gpx

# ACCESS_TOKEN_SECRET=ghfjbdnsfmaddnbjhdsdgfnadivsbeaiwfagshshagfdwGHTJ
# ACCESS_TOKEN_EXPIRATION=3600s

# REFRESH_TOKEN_SECRET=rtrtffjrteyrjfgncvbxdshrdjhfdggsethfethdgsdssfggzb
# REFRESH_TOKEN_EXPIRATION=1y

# MONGO_URI=mongodb+srv://software:Consoul%401234@appbd.hifbevu.mongodb.net/auth

# FRONTEND_URL=http://localhost:8080

# RECOVER_CODE_EXPIRATION=86400

# REDIS_ENABLED=false
# REDIS_HOST=localhost
# REDIS_PORT=6379




// Disable all core updates
add_filter( 'automatic_updater_disabled', '__return_true' );

// Disable theme updates
remove_action( 'load-update-core.php', 'wp_update_themes' );
add_filter( 'pre_site_transient_update_themes', '__return_null' );

// Disable plugin updates
remove_action( 'load-update-core.php', 'wp_update_plugins' );
add_filter( 'pre_site_transient_update_plugins', '__return_null' );

// Disable automatic updates for plugins
add_filter( 'auto_update_plugin', '__return_false' );

// Disable automatic updates for themes
add_filter( 'auto_update_theme', '__return_false' );

// Disable automatic updates for WordPress core
add_filter( 'auto_update_core', '__return_false' );
{
	"blocks": [
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":star: What's on in Melbourne this week! :star:"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "\n\n Hey Melbourne, happy Monday and hope you all had a Fabulous weekend! Please see below for what's on this week. "
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": "Xero Café :coffee:",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "\n :new-thing: *This week we are offering:* \n\n :caramel-slice: *Sweet Treats*: Cookies \n\n :coffee: *Weekly Café Special*: Maple Latte"
			}
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": " Wednesday, 30th July :calendar-date-30:",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "\n\n:lunch: :flag-de: Join us fora German lunch From *12pm* in the L3 kitchen + Wominjeka breakout space! Menu in the:thread:"
			}
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": "Thursday, 31st July :calendar-date-31:",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": ":breakfast: *Breakfast*: Join us for our Breakfast Buffet from *8:30am - 10:30am* in the Wominjeka Breakout Space. Menu in the :thread: \n\n\n *What Else? :green_heart:*"
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": " Feedback on our Boost Offerings? We want to hear more. Let us know what you love by filling out our form <https://docs.google.com/forms/d/e/1FAIpQLScGOSeS5zUI8WXEl0K4WGoQUkmpIHzAjLlEKWBob4sMPhDXmA/viewform|here.>  \n\n Stay tuned to this channel, and make sure you're subscribed to the <https://calendar.google.com/calendar/u/0?cid=Y19xczkyMjk5ZGlsODJzMjA4aGt1b3RnM2t1MEBncm91cC5jYWxlbmRhci5nb29nbGUuY29t|*Melbourne Social Calendar*> :party-wx:"
			}
		}
	]
}
ZDK.Page.getField("Payment_Plan").setCriteria("((Project:equals:"+projectID+")and(Status:equals:Active))",{ filterOnSearch: true });
 
AddColumns(
    ForAll(
        Sequence(CountRows(colPlaylist)),
        {
            id: ThisRecord.Value,
            name: Last(FirstN(colPlaylist,  ThisRecord.Value)).name,
            blow: Last(FirstN(colPlaylist,  ThisRecord.Value)).blow
        }
    ),
    ID,
    ThisRecord.name
)
```dataviewjs

class PersistentData {
	static #constructKey = Symbol()
	static #instance
	static _dataFilePath
	static _defaultData
	_dataFilePath
	_defaultData
	_data
	constructor(constructKey, dataFilePath, defaultData) {
		if (constructKey !== PersistentData.#constructKey)
			throw new Error('constructor is private')
		this._dataFilePath = dataFilePath
		this._defaultData = defaultData
	}
	static setConfig(dataFilePath, dafaultData){
		this._dataFilePath = dataFilePath
		this._defaultData = dafaultData
	}
	static async getInstance(){
		if (!this.#instance){
			this.#instance = new PersistentData(
				this.#constructKey,
				this._dataFilePath,
				this._defaultData
			)
			await this.#instance.initialize()
		}
		return this.#instance
	}
	async initialize(){
		const exists = await app.vault.adapter.exists(this._dataFilePath)
		if (exists) {
			const str = await app.vault.adapter.read(this._dataFilePath)
			const data = JSON.parse(str)
			// 保存されているデータとdefaultDataのキーが不一致の場合、データの仕様が変わったと判断し、保存データをdefaultDataにリセットする
			if (this._haveSameKeys(data, this._defaultData)){
				this._data = data
				return
			}
		}
		this._data = this._defaultData
		await this.saveData()
	}
	getData(key){
		return this._data[key]
	}
	async setData(key, value){
		this._data[key] = value
		await this.saveData()
	}
	async saveData(){
		await app.vault.adapter.write(this._dataFilePath, this._toJSON(this._data))
	}
	_haveSameKeys(obj1, obj2) {
		const keys1 = Object.keys(obj1).sort()
		const keys2 = Object.keys(obj2).sort()
		return keys1.length === keys2.length && keys1.every((key, index) => key === keys2[index])
	}
	_toJSON(obj){
		return JSON.stringify(obj, null, 2)
	}
}

function debounce(func, wait) {
	let timeout = null
	return function(...args) {
		if (timeout)
			clearTimeout(timeout)
		timeout = setTimeout(() => {
			func(...args)
			timeout = null
		}, wait)
	}
}

async function updateList() {
	listContainer.innerHTML = ''
	const daysBack = selectDays.value
	const now = dv.date('now')
	let pages

	const startDate = now.minus({ days: parseInt(daysBack) - 1 }).startOf('day')
	pages = dv.pages()
		.where(p => {
			const mtime = dv.date(p.file.mtime)
			return mtime >= startDate && mtime <= now
		})

    if (searchString)
		pages = pages.where(p => p.file.name.toLowerCase().includes(searchString.toLowerCase()))

	const folderCounts = {}
	pages.forEach(page => {
		const folder = page.file.folder || ''
		folderCounts[folder] = (folderCounts[folder] || 0) + 1
	})

	const folders = Array.from(pages.file.folder.distinct()).sort()
	folders.unshift('すべてのフォルダ')

	if (!folders.includes(currentFolder)){
		currentFolder = 'すべてのフォルダ'
		await persistentData.setData('currentFolder', currentFolder)
	}

	selectFolder.innerHTML = ''
	folders.forEach(folder => {
		const count = folder === 'すべてのフォルダ' ? pages.length : (folderCounts[folder] || 0)
		const displayText = folder === 'すべてのフォルダ' ? `${folder} (${count})` : `${folder} (${count})`
		const option = dv.el('option', displayText, { container: selectFolder })
		option.value = folder
		if (folder === currentFolder)
			option.selected = true
	})

    let filteredPages = pages
    if (currentFolder !== 'すべてのフォルダ')
        filteredPages = pages.where(p => p.file.folder === currentFolder)

	const ul = dv.el('ul', '', { container: listContainer })
	filteredPages
		.sort(p => p.file.mtime, 'desc')
		.forEach((page) => {
			const li = dv.el('li', '', { container: ul })
			const a = dv.el('a', page.file.name, { container: li })
			a.addEventListener('click', () => {
				app.workspace.openLinkText(page.file.path, '', true)
			})
		})
}

const config = {
	persistentData: {
		// 永続データ保存ファイルのVault内パス
		// 親ディレクトリは前もって作成しておく
		dataFilePath: '/Scripts/Dataview/PersistentData/touchSort.json',

		// 永続データのデフォルト値
		defaultData: {selectDaysValue: 10, currentFolder: 'すべてのフォルダ', searchString: ''}
	},
	// 日数の選択肢
	selectDaysOptions: [1, 2, 3, 5, 7, 10, 14, 20, 30, 60]
}

PersistentData.setConfig(
	config.persistentData.dataFilePath,
	config.persistentData.defaultData
)
const persistentData = await PersistentData.getInstance()

let currentFolder = persistentData.getData('currentFolder')
let searchString = persistentData.getData('searchString')

const selectDays = dv.el('select', '')
const options = config.selectDaysOptions
options.forEach(option => {
    const opt = dv.el('option', `${option}日`, { container: selectDays })
    opt.value = option
})

const selectFolder = dv.el('select', '')
const searchInput = dv.el('input', '', { attr: { type: 'text', placeholder: '検索', value: searchString} })
const listContainer = dv.el('div', '')

selectDays.addEventListener('change', async () => {
	updateList()
	await persistentData.setData('selectDaysValue', selectDays.value)
})

selectFolder.addEventListener('change', async () => {
    currentFolder = selectFolder.value
    updateList()
	await persistentData.setData('currentFolder', currentFolder)
})

searchInput.addEventListener('input', debounce(async () => {
    searchString = searchInput.value.trim()
    updateList()
	await persistentData.setData('searchString', searchString)
}, 1000))

selectDays.value = persistentData.getData('selectDaysValue')
selectFolder.value = currentFolder
updateList()

```
.toString("yyyy-MM-dd'T'HH:mm:ss","Asia/Dubai")
 
import React, { useState, useRef, useEffect } from 'react';
import { Loader2, Video, LogOut } from 'lucide-react';
import clsx from 'clsx';

/* ------------------------------------------------------------------ */
/*  TYPES & GLOBALS                                                   */
/* ------------------------------------------------------------------ */
declare global {
  interface Window {
    ZoomMtgEmbedded?: any;
  }
}

/* ------------------------------------------------------------------ */
/*  CONSTANTS                                                         */
/* ------------------------------------------------------------------ */
const ZOOM_SDK_VERSION = '3.11.2'; // keep in one place for easy upgrades
const ZOOM_SDK_LIBS = [
  `https://source.zoom.us/${ZOOM_SDK_VERSION}/lib/vendor/react.min.js`,
  `https://source.zoom.us/${ZOOM_SDK_VERSION}/lib/vendor/react-dom.min.js`,
  `https://source.zoom.us/${ZOOM_SDK_VERSION}/lib/vendor/redux.min.js`,
  `https://source.zoom.us/${ZOOM_SDK_VERSION}/lib/vendor/redux-thunk.min.js`,
  `https://source.zoom.us/${ZOOM_SDK_VERSION}/lib/vendor/lodash.min.js`,
  `https://source.zoom.us/${ZOOM_SDK_VERSION}/zoom-meeting-embedded-${ZOOM_SDK_VERSION}.min.js`,
];

/* ------------------------------------------------------------------ */
/*  COMPONENT                                                         */
/* ------------------------------------------------------------------ */
const Zoom: React.FC = () => {
  /* form state ----------------------------------------------------- */
  const [meetingNumber, setMeetingNumber] = useState('');
  const [userName, setUserName] = useState('React User');
  const [meetingPassword, setMeetingPassword] = useState('');
  const [role, setRole] = useState<number>(0); // 0 attendee | 1 host

  /* ui state ------------------------------------------------------- */
  const [loading, setLoading] = useState(false);
  const [error, setError] = useState<string | null>(null);
  const [meetingStarted, setMeetingStarted] = useState(false);

  /* refs ----------------------------------------------------------- */
  const meetingSDKElementRef = useRef<HTMLDivElement>(null);
  const clientRef = useRef<any>(null); // Zoom client instance

  /* ------------------------------------------------------------------ */
  /*  SIDE-EFFECT: Load Zoom SDK once on mount                          */
  /* ------------------------------------------------------------------ */
  useEffect(() => {
    if (window.ZoomMtgEmbedded) {
      console.log('[Zoom] SDK already present');
      return;
    }

    console.log('[Zoom] Loading Zoom SDK…');
    const loadScript = (src: string) =>
      new Promise<void>((resolve, reject) => {
        const s = document.createElement('script');
        s.src = src;
        s.async = false;          // load in order
        s.onload = () => {
          console.log(`[Zoom] ✓ loaded ${src}`);
          resolve();
        };
        s.onerror = () => {
          console.error(`[Zoom] ✗ failed to load ${src}`);
          reject();
        };
        document.body.appendChild(s);
      });

    (async () => {
      try {
        for (const lib of ZOOM_SDK_LIBS) await loadScript(lib);
        console.log('[Zoom] All SDK scripts loaded');
      } catch {
        setError('Failed to load Zoom SDK. Check console for details.');
      }
    })();
  }, []);

  /* ------------------------------------------------------------------ */
  /*  HELPERS                                                           */
  /* ------------------------------------------------------------------ */
  const getSignature = async () => {
    console.log('[Zoom] Fetching signature…');
    setLoading(true);
    setError(null);
    try {
      const res = await fetch(
        `http://localhost:80/api/zoom/signature?meetingNumber=${meetingNumber}&role=${role}`,
      );
      if (!res.ok) throw new Error((await res.json())?.message);
      const data = await res.json();
      console.log('[Zoom] Signature fetched:', data);
      return data;
    } catch (err: any) {
      console.error('[Zoom] Signature error:', err);
      setError(err?.message ?? 'Failed to get signature');
      return null;
    } finally {
      setLoading(false);
    }
  };

  const startMeeting = async () => {
    console.log('[Zoom] startMeeting() called');
    if (!meetingNumber.trim() || !userName.trim()) {
      setError('Meeting Number & Name required.');
      return;
    }
    if (!meetingSDKElementRef.current) {
      setError('SDK mount element not found.');
      return;
    }
    if (!window.ZoomMtgEmbedded) {
      setError('Zoom SDK still loading, please try again in a moment.');
      return;
    }

    const sigData = await getSignature();
    if (!sigData) return;

    const { signature, sdkKey } = sigData;
    clientRef.current = window.ZoomMtgEmbedded.createClient();

    try {
      console.log('[Zoom] Initializing client…');
      await clientRef.current.init({
        zoomAppRoot: meetingSDKElementRef.current,
        language: 'en-US',
        patchJsMedia: true,
      });
      console.log('[Zoom] Client initialized, joining…');
      await clientRef.current.join({
        sdkKey,
        signature,
        meetingNumber,
        userName,
        password: meetingPassword,
        role,
      });
      console.log('[Zoom] Joined meeting');
      setMeetingStarted(true);
    } catch (err: any) {
      console.error('[Zoom] Unable to start meeting:', err);
      setError(err?.message ?? 'Unable to start meeting');
    }
  };

  const leaveMeeting = async () => {
    console.log('[Zoom] leaveMeeting() called');
    if (!meetingStarted || !clientRef.current) return;
    try {
      await clientRef.current.leave();
      console.log('[Zoom] Left meeting');
      setMeetingStarted(false);
    } catch (err: any) {
      console.error('[Zoom] Failed to leave:', err);
      setError(err?.message ?? 'Failed to leave');
    }
  };

  /* ------------------------------------------------------------------ */
  /*  RENDER                                                            */
  /* ------------------------------------------------------------------ */
  return (
    <main className="min-h-screen relative flex items-center justify-center bg-gradient-to-br from-blue-950 via-indigo-900 to-fuchsia-900 overflow-hidden">
      {/* floating blur blobs */}
      <div className="absolute inset-0">
        {Array.from({ length: 10 }).map((_, i) => (
          <div
            // purely decorative blobs
            key={i}
            className={clsx(
              'absolute rounded-full blur-2xl opacity-25',
              i % 2 ? 'bg-blue-600' : 'bg-violet-700',
            )}
            style={{
              width: `${Math.random() * 18 + 12}rem`,
              height: `${Math.random() * 18 + 12}rem`,
              top: `${Math.random() * 100}%`,
              left: `${Math.random() * 100}%`,
              animation: `pulse ${Math.random() * 12 + 8}s ease-in-out infinite`,
            }}
          />
        ))}
      </div>

      <section className="relative z-10 w-full max-w-3xl mx-auto p-6">
        <h1 className="text-center text-4xl font-bold text-white mb-8 flex items-center justify-center gap-2">
          <Video className="w-8 h-8 text-blue-400" />
          Zoom Meeting
        </h1>

        {/* CARD ---------------------------------------------------- */}
        <div className="backdrop-blur-xl bg-white/5 border border-white/[0.08] rounded-2xl shadow-2xl overflow-hidden">
          {!meetingStarted ? (
            <form
              onSubmit={(e) => {
                e.preventDefault();
                startMeeting();
              }}
              className="grid gap-6 p-8"
            >
              {/* inputs */}
              <Input
                label="Meeting Number"
                value={meetingNumber}
                onChange={setMeetingNumber}
                placeholder="e.g. 123456789"
                autoFocus
              />
              <Input
                label="Your Name"
                value={userName}
                onChange={setUserName}
                placeholder="Enter display name"
              />
              <Input
                label="Password (optional)"
                type="password"
                value={meetingPassword}
                onChange={setMeetingPassword}
                placeholder="Meeting passcode"
              />

              <div>
                <label className="block text-sm font-medium text-white/80 mb-1">
                  Role
                </label>
                <select
                  value={role}
                  onChange={(e) => setRole(parseInt(e.target.value, 10))}
                  className="w-full rounded-lg bg-white/10 border border-white/20 px-3 py-2 text-white focus:ring-2 focus:ring-blue-500 focus:outline-none"
                >
                  <option value={0}>Attendee</option>
                  <option value={1}>Host</option>
                </select>
              </div>

              {error && (
                <p className="text-center text-sm text-red-400 -mt-3">
                  {error}
                </p>
              )}

              <button
                type="submit"
                disabled={loading}
                className={clsx(
                  'w-full flex items-center justify-center gap-2 rounded-lg py-3 font-semibold transition',
                  loading
                    ? 'bg-blue-400 cursor-not-allowed'
                    : 'bg-gradient-to-r from-blue-600 to-violet-600 hover:brightness-110',
                )}
              >
                {loading ? (
                  <>
                    <Loader2 className="w-5 h-5 animate-spin" /> Starting…
                  </>
                ) : (
                  'Join Meeting'
                )}
              </button>
            </form>
          ) : (
            <div className="p-10 flex flex-col items-center gap-6 text-white">
              <p className="text-lg">
                🎉 Connected as <span className="font-semibold">{userName}</span>
              </p>
              <button
                onClick={leaveMeeting}
                className="flex items-center gap-2 bg-gradient-to-r from-red-600 to-red-700 hover:brightness-110 px-6 py-3 rounded-lg font-semibold"
              >
                <LogOut className="w-5 h-5" /> Leave
              </button>
            </div>
          )}

          {/* Zoom SDK mount */}
          <div
            id="meetingSDKElement"
            ref={meetingSDKElementRef}
            className={clsx(
              'w-full overflow-hidden transition-all duration-500',
              meetingStarted ? 'h-[70vh]' : 'h-0',
            )}
          />
        </div>
      </section>
    </main>
  );
};

/* ------------------------------------------------------------------ */
/*  REUSABLE INPUT                                                   */
/* ------------------------------------------------------------------ */
interface InputProps {
  label: string;
  value: string;
  onChange: (v: string) => void;
  type?: React.HTMLInputTypeAttribute;
  placeholder?: string;
  autoFocus?: boolean;
}

const Input: React.FC<InputProps> = ({
  label,
  value,
  onChange,
  type = 'text',
  placeholder,
  autoFocus,
}) => (
  <div className="space-y-1">
    <label className="block text-sm font-medium text-white/80">
      {label}:
    </label>
    <input
      type={type}
      value={value}
      onChange={(e) => onChange(e.target.value)}
      placeholder={placeholder}
      autoFocus={autoFocus}
      className="w-full rounded-lg bg-white/10 border border-white/20 px-3 py-2 text-white placeholder-white/50 focus:ring-2 focus:ring-blue-500 focus:outline-none"
    />
  </div>
);

export default Zoom;
const formattedPrice = new Intl.NumberFormat('en-US', {
  style: 'currency',
  currency: 'USD',
  minimumFractionDigits: 0,
}).format(price);
List<object> itemsToDelete = [
    SELECT Id FROM object LIMIT 10000
];
delete itemsToDelete;
https://github.com/login
Hamza-Khan123
hamzakhan.123
Git Token: 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
https://github.com/login
Hamza-Khan123
hamzakhan.123
Git Token: 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
//ruta a la carpeta de los snipets en el archivo:
//~/.config/Code/User/profiles/
//-54d2ca4b/snippets/
//Configure User Snippets este es el comando el de abajo es atajos rapidos de teclado
//y con Con Ctrl + Shift + P se abre la paleta de comandos, donde puedes escribir "Open Keyboard Shortcuts (JSON)"
// --- INICIO SNIPPETS PHP ---
{
  // --- SNIPPETS PHP ---
  "Hola Mundo PHP": {
    "prefix": "phphola",
    "body": [
      "// Imprime Hola Mundo en PHP",
      "echo \"Hola, ${1:mundo}!\";"
    ],
    "description": "Imprime un saludo básico en PHP",
    "scope": "php"
  },
  "Echo Variable": {
    "prefix": "echo",
    "body": [
      "// Imprime una variable",
      "echo ${1:variable};"
    ],
    "description": "Imprime una variable con echo",
    "scope": "php"
  },
  "If Statement": {
    "prefix": "if",
    "body": [
      "// Estructura if con sintaxis alternativa",
      "if (${1:condition}):",
      "\t$0",
      "endif;"
    ],
    "description": "Estructura if con sintaxis alternativa",
    "scope": "php"
  },
  "If-Else Statement": {
    "prefix": "ifelse",
    "body": [
      "// Estructura if-else con sintaxis alternativa",
      "if (${1:condition}):",
      "\t${2:código si verdadero}",
      "else:",
      "\t${3:código si falso}",
      "endif;"
    ],
    "description": "Estructura if-else con sintaxis alternativa",
    "scope": "php"
  },
  "Foreach Loop": {
    "prefix": "foreach",
    "body": [
      "// Bucle foreach con sintaxis alternativa",
      "foreach (${1:array} as ${2:key} => ${3:value}):",
      "\t$0",
      "endforeach;"
    ],
    "description": "Bucle foreach con sintaxis alternativa",
    "scope": "php"
  },
  "For Loop": {
    "prefix": "for",
    "body": [
      "// Bucle for con sintaxis alternativa",
      "for (${1:i} = 0; ${1:i} < ${2:count(array)}; ${1:i}++):",
      "\t$0",
      "endfor;"
    ],
    "description": "Bucle for con sintaxis alternativa",
    "scope": "php"
  },
  "Function Declaration": {
    "prefix": "function",
    "body": [
      "// Declarar función en PHP",
      "function ${1:nombreFuncion}(${2:parametros}) {",
      "\t$0",
      "}"
    ],
    "description": "Declarar una función en PHP",
    "scope": "php"
  },
  "Class Constructor": {
    "prefix": "classconstructor",
    "body": [
      "// Crear clase con constructor",
      "class ${1:NombreClase} {",
      "\tpublic function __construct(${2:parametros}) {",
      "\t\t$0",
      "\t}",
      "}"
    ],
    "description": "Clase PHP con constructor",
    "scope": "php"
  },
  "Class con Propiedades y Métodos": {
    "prefix": "classfull",
    "body": [
      "// Clase con propiedad, constructor, getter y setter",
      "class ${1:NombreClase} {",
      "\t/**",
      "\t * @var ${2:string} Descripción de la propiedad",
      "\t */",
      "\tprivate \\${3:nombre};",
      "",
      "\t/**",
      "\t * Constructor",
      "\t *",
      "\t * @param ${2:string} \\${3:nombre} Descripción",
      "\t * @throws InvalidArgumentException",
      "\t */",
      "\tpublic function __construct(${2:string} \\${3:nombre} = '') {",
      "\t$this->set${4/(.+)/${1:/capitalize}/}(\\${3:nombre});",
      "\t}",
      "",
      "\t/**",
      "\t * Setter para ${3:nombre}",
      "\t *",
      "\t * @param ${2:string} \\${3:nombre}",
      "\t * @return void",
      "\t * @throws InvalidArgumentException",
      "\t */",
      "\tpublic function set${4/(.+)/${1:/capitalize}/}(${2:string} \\${3:nombre}): void {",
      "\tif (empty(\\${3:nombre})) {",
      "\tthrow new InvalidArgumentException('El ${3:nombre} no puede estar vacío.');",
      "\t}",
      "\t$this->${3:nombre} = \\${3:nombre};",
      "\t}",
      "",
      "\t/**",
      "\t * Getter para ${3:nombre}",
      "\t *",
      "\t * @return ${2:string}",
      "\t */",
      "\tpublic function get${4/(.+)/${1:/capitalize}/}(): ${2:string} {",
      "\treturn \\$this->${3:nombre};",
      "\t}",
      "}"
    ],
    "description": "Clase con propiedades, constructor, getter y setter con validación",
    "scope": "php"
  },
  "Try Catch": {
    "prefix": "trycatch",
    "body": [
      "// Bloque try-catch",
      "try {",
      "\t$0",
      "} catch (${1:Exception} ${2:e}) {",
      "\techo ${2}->getMessage();",
      "}"
    ],
    "description": "Bloque try-catch en PHP",
    "scope": "php"
  },
  "Variable Dump": {
    "prefix": "vardump",
    "body": [
      "// Mostrar variable legible",
      "echo '<pre>';",
      "var_dump(${1:variable});",
      "echo '</pre>';"
    ],
    "description": "Mostrar variable con var_dump formateado",
    "scope": "php"
  },
  "PHP Array": {
    "prefix": "array",
    "body": [
      "// Crear array asociativo",
      "${1:arrayName} = [",
      "\t${2:'key' => 'value'},",
      "\t$0",
      "];"
    ],
    "description": "Crear array asociativo en PHP",
    "scope": "php"
  },

  // --- SNIPPETS POSTGRES ---
  "Postgres Select": {
    "prefix": "pgSelect",
    "body": [
      "-- Consulta SELECT básica",
      "SELECT ${1:*} FROM ${2:tabla} WHERE ${3:condicion};"
    ],
    "description": "Consulta SELECT en Postgres",
    "scope": "sql"
  },
  "Postgres Insert": {
    "prefix": "pgInsert",
    "body": [
      "-- Consulta INSERT básica",
      "INSERT INTO ${1:tabla} (${2:columna1}, ${3:columna2}) VALUES (${4:valor1}, ${5:valor2});"
    ],
    "description": "Consulta INSERT en Postgres",
    "scope": "sql"
  },
  "Postgres Update": {
    "prefix": "pgUpdate",
    "body": [
      "-- Consulta UPDATE básica",
      "UPDATE ${1:tabla} SET ${2:columna} = ${3:nuevo_valor} WHERE ${4:condicion};"
    ],
    "description": "Consulta UPDATE en Postgres",
    "scope": "sql"
  },
  "Postgres Delete": {
    "prefix": "pgDelete",
    "body": [
      "-- Consulta DELETE básica",
      "DELETE FROM ${1:tabla} WHERE ${2:condicion};"
    ],
    "description": "Consulta DELETE en Postgres",
    "scope": "sql"
  },
  "Postgres Create Table": {
    "prefix": "pgCreateTable",
    "body": [
      "-- Crear tabla",
      "CREATE TABLE ${1:tabla} (",
      "\t${2:id} SERIAL PRIMARY KEY,",
      "\t${3:columna} ${4:tipo},",
      "\t$0",
      ");"
    ],
    "description": "Crear tabla en Postgres",
    "scope": "sql"
  },
  "Postgres Connect": {
    "prefix": "pgConnect",
    "body": [
      "-- Conectar a base de datos Postgres",
      "\\c ${1:nombre_base_de_datos};"
    ],
    "description": "Conectar a base de datos Postgres",
    "scope": "sql"
  },
  "Postgres Drop Database": {
    "prefix": "pgDropDb",
    "body": [
      "-- Borrar base de datos",
      "DROP DATABASE ${1:nombre_base_de_datos};"
    ],
    "description": "Borrar base de datos en Postgres",
    "scope": "sql"
  },
  "Postgres Create Database": {
    "prefix": "pgCreateDb",
    "body": [
      "-- Crear base de datos",
      "CREATE DATABASE ${1:nombre_base_de_datos};"
    ],
    "description": "Crear base de datos en Postgres",
    "scope": "sql"
  },
  "Postgres Import Database": {
    "prefix": "pgImportDb",
    "body": [
      "-- Importar archivo .sql",
      "psql -U ${1:usuario} -d ${2:base_de_datos} -f ${3:archivo.sql}"
    ],
    "description": "Importar archivo .sql a Postgres",
    "scope": "sql"
  },
  "Postgres Export Database": {
    "prefix": "pgExportDb",
    "body": [
      "-- Exportar base de datos a archivo .sql",
      "pg_dump -U ${1:usuario} -d ${2:base_de_datos} -f ${3:archivo.sql}"
    ],
    "description": "Exportar base de datos Postgres",
    "scope": "sql"
  },
  "Postgres Create User": {
    "prefix": "pgCreateUser",
    "body": [
      "-- Crear usuario",
      "CREATE USER ${1:nombre_usuario} WITH PASSWORD '${2:contraseña}';"
    ],
    "description": "Crear usuario en Postgres",
    "scope": "sql"
  },
  "Postgres Grant Privileges": {
    "prefix": "pgGrant",
    "body": [
      "-- Otorgar privilegios",
      "GRANT ${1:ALL} PRIVILEGES ON DATABASE ${2:base_de_datos} TO ${3:usuario};"
    ],
    "description": "Otorgar privilegios en Postgres",
    "scope": "sql"
  },

  // --- SNIPPETS LARAVEL ---
  "Laravel Route": {
    "prefix": "laravelRoute",
    "body": [
      "// Definir ruta en Laravel",
      "Route::${1:get}('${2:/ruta}', [${3:Controller}::class, '${4:metodo}']);"
    ],
    "description": "Definir ruta en Laravel",
    "scope": "php"
  },
  "Laravel Controller": {
    "prefix": "laravelController",
    "body": [
      "// Controlador básico en Laravel",
      "namespace App\\Http\\Controllers;",
      "",
      "use Illuminate\\Http\\Request;",
      "",
      "class ${1:NombreController} extends Controller",
      "{",
      "\tpublic function ${2:index}()",
      "\t{",
      "\t\t$0",
      "\t}",
      "}"
    ],
    "description": "Controlador básico en Laravel",
    "scope": "php"
  },
  "Laravel Migration": {
    "prefix": "laravelMigration",
    "body": [
      "// Crear migración en Laravel",
      "Schema::create('${1:tabla}', function (Blueprint $table) {",
      "\t$table->id();",
      "\t$table->string('${2:nombre}');",
      "\t$table->timestamps();",
      "\t$0",
      "});"
    ],
    "description": "Migración básica en Laravel",
    "scope": "php"
  },
  "Laravel Model": {
    "prefix": "laravelModel",
    "body": [
      "// Crear modelo en Laravel",
      "namespace App\\Models;",
      "",
      "use Illuminate\\Database\\Eloquent\\Model;",
      "",
      "class ${1:NombreModelo} extends Model",
      "{",
      "\tprotected $fillable = [",
      "\t\t'${2:campo}',",
      "\t];",
      "\t$0",
      "}"
    ],
    "description": "Modelo básico en Laravel",
    "scope": "php"
  },
  "Laravel Blade Foreach": {
    "prefix": "laravelForeach",
    "body": [
      "{{-- Bucle foreach en Blade --}}",
      "@foreach (${1:items} as ${2:item})",
      "\t{{ ${2:item} }}",
      "@endforeach"
    ],
    "description": "Bucle foreach en Blade",
    "scope": "php"
  },
  "Laravel Validation": {
    "prefix": "laravelValidate",
    "body": [
      "// Validar datos en controlador",
      "$validated = $request->validate([",
      "\t'${1:campo}' => '${2:required|string}',",
      "\t$0",
      "]);"
    ],
    "description": "Validación de datos en Laravel",
    "scope": "php"
  },
  "Laravel Seeder": {
    "prefix": "laravelSeeder",
    "body": [
      "// Crear seeder en Laravel",
      "use Illuminate\\Database\\Seeder;",
      "",
      "class ${1:NombreSeeder} extends Seeder",
      "{",
      "\tpublic function run()",
      "\t{",
      "\t\t$0",
      "\t}",
      "}"
    ],
    "description": "Seeder básico en Laravel",
    "scope": "php"
  },
  "Laravel Request": {
    "prefix": "laravelRequest",
    "body": [
      "// Obtener datos de petición",
      "${1:variable} = $request->input('${2:campo}');"
    ],
    "description": "Obtener datos de petición en Laravel",
    "scope": "php"
  },
  "Laravel Middleware": {
    "prefix": "laravelMiddleware",
    "body": [
      "// Crear middleware en Laravel",
      "namespace App\\Http\\Middleware;",
      "",
      "use Closure;",
      "",
      "class ${1:NombreMiddleware}",
      "{",
      "\tpublic function handle($request, Closure $next)",
      "\t{",
      "\t\t$0",
      "\t\treturn $next($request);",
      "\t}",
      "}"
    ],
    "description": "Middleware básico en Laravel",
    "scope": "php"
  },
  "Laravel Blade If": {
    "prefix": "laravelBladeIf",
    "body": [
      "{{-- Estructura if en Blade --}}",
      "@if (${1:condicion})",
      "\t${2:contenido}",
      "@endif"
    ],
    "description": "Estructura if en Blade",
    "scope": "php"
  },
  "Laravel Blade Include": {
    "prefix": "laravelBladeInclude",
    "body": [
      "{{-- Incluir vista en Blade --}}",
      "@include('${1:vista}')"
    ],
    "description": "Incluir vista en Blade",
    "scope": "php"
  },
  "Laravel Blade Layout": {
    "prefix": "laravelBladeLayout",
    "body": [
      "{{-- Extender layout en Blade --}}",
      "@extends('${1:layouts.app}')",
      "",
      "@section('${2:content}')",
      "\t$0",
      "@endsection"
    ],
    "description": "Extender layout en Blade",
    "scope": "php"
  }
}
ruta a la carpeta de los snipets:
~/.config/Code/User/profiles/
-54d2ca4b/snippets/
  
Presiona el atajo de teclado Ctrl + 8 para guardar el código seleccionado en tu colección thiscodeWorks en la nube

Presiona Ctrl + Shift + 8 para abrir el panel con todos tus snippets guardados.

Abre la paleta de comandos con Ctrl + Shift + P

Escribe y selecciona "Preferences: Configure User Snippets"

Elige crear un nuevo archivo de snippets global o para un lenguaje específico. También puedes crear un archivo JSON con nombre personalizado para agrupar snippets (es decir, funcionaría como tu "carpeta" local para snippets).

Dentro del archivo JSON, agrega tus snippets siguiendo esta estructura:

esta es la estructura de un snipet: 

Name: Esto es algo obvio, pero aquí vamos a nombrar a nuestro snippe,
Prefix: Este va a ser nuestro atajo. Dentro de nuestro código, cuando escribamos el atajo, va a aparecer de forma automática la opción de poder llamar a nuestro snippet. Por ejemplo: “forEach”.
Body: Aquí vamos a tener que crear el cuerpo del mismo. El contenido de esta sección va ser el mismo que luego se verá reflejado en el código. Esto incluye a cada tag, espacio, tabulación, etc.
Description: También podemos agregar una descripción explicando lo que hace o intenta hacer el snippet.
Scope: Por último, tenemos la posibilidad de setear el scope, es decir que podemos especificar a que lenguaje pertenece el snippet. Esto va a impedir que nos aparezca el snippet en un archivo de otro lenguaje que no sea el que previamente hayamos definido.

{
  "Nombre snippet": {
    "prefix": "atajo",
    "body": [
      "línea 1 del snippet",
      "línea 2 del snippet"
    ],
    "description": "Descripción del snippet"
  }
}

ejemplo real: 
"Hola Mundo": {
		"prefix": "hola",
		"body": [
			"// Imprime Hola Mundo",
			"echo \"Hola, ${1:mundo}!\";"
		],
		"description": "Un atajo para crear un script PHP básico",
		"scope": "php"
	},
var NSSRUtilV2 = Class.create();
NSSRUtilV2.prototype = Object.extendsObject(global.AbstractAjaxProcessor, {
   isMember: function() {
       var groupId = this.getParameter('sysparm_group_id');
       var userId = gs.getUserID();
       if (!groupId || !userId) {
           gs.info('Membership Check: Missing parameters');
           return 'false';
       }
       var gr = new GlideRecord('sys_user_grmember');
       gr.addQuery('user', userId);
       gr.addQuery('group', groupId);
       gr.query();
       var isMember = gr.hasNext();
       gs.info('Membership Check: User ' + userId + ' in group ' + groupId + ': ' + isMember);
       return isMember.toString();
   },
    type: 'NSSRUtilV2'
});
# for name, child in list(model.named_children()):
        #     if required_layers and name not in required_layers:
        #         continue
        #     if len(list(child.children())) > 1:
        #         self.replace_module_with_wrapper(child, required_layers)
        #         continue
        #     if (
        #         not isinstance(child, torch.nn.Sequential)
        #         and len(list(child.children())) == 0
        #     ):
        #         wrapped = ModuleReplacements.get_replacement(child)
        #         if not wrapped:
        #             self.logger.info(f"Please register {type(child)}")
        #             continue

        #         setattr(child, "activation_dtype", global_activation_dtype)
        #         setattr(child, "parameter_dtype", global_param_dtype)
        #         setattr(child, "parameter_observer", global_weight_observer)
        #         setattr(child, "activation_observer", global_activation_observer)

        #         set_nested_attr(model, name, wrapped(old_module=child))
var AutopopulateNSSRUserDetails = Class.create();
AutopopulateNSSRUserDetails.prototype = Object.extendsObject(global.AbstractAjaxProcessor, {

    populateDepartment: function() {
        var user = this.getParameter('sysparm_user');
        var grUser = new GlideRecord('sys_user');
        grUser.addQuery('sys_id', user);
        grUser.query();
        if (grUser.next()) {
            var department = grUser.department.getDisplayValue();
            return department.toString();
        }
    },

    type: 'AutopopulateNSSRUserDetails'
});
add_filter( 'sp_pcp_the_content', function($post_content){
	if (preg_match('/\[smart_post_show id="\d+"\]/', $post_content)) {
		$post_content = preg_replace( '/\[smart_post_show id="\d+"\]/', '', $post_content );
	}
	return $post_content;
} );
var getNSSRFlowContext = Class.create();
getNSSRFlowContext.prototype = Object.extendsObject(AbstractAjaxProcessor, {

	getFlowContext: function(){
		var id = this.getParameter('sysparm_id');
		var ctx = new GlideRecord("sys_flow_context");
		ctx.addEncodedQuery("source_table=x_hclda_nssr_request^source_record="+id);
		ctx.query();
		if(ctx.next()){
			var results = {
				"success":"true",
				"id":ctx.getUniqueValue()
			};
			return JSON.stringify(results);
		}
		gs.addErrorMessage("Flow Context does not exist for this record.");
		var result = {
			"success":"false"
		};
		return JSON.stringify(result);
	},
   

    type: 'getNSSRFlowContext'
});
<link rel="stylesheet" href="https://unpkg.com/lenis@1.1.13/dist/lenis.css">
27
<script src="https://unpkg.com/lenis@1.1.13/dist/lenis.min.js"></script> 
28
<script>
29
const lenis = new Lenis()
30
​
31
lenis.on('scroll', (e) => {
32
  console.log(e)
33
})
34
​
35
function raf(time) {
36
  lenis.raf(time)
37
  requestAnimationFrame(raf)
38
}
39
​
40
requestAnimationFrame(raf)
41
</script>
Guía paso a paso para PostgreSQL
I. Linux
1. Instalación and configuración inicial

Nota importante: Por defecto PostgreSQL crea un usuario postgres sin contraseña en Linux, autenticado vía sistema.

sudo su - postgres o sudo -i -u postgres

Acceder al intérprete de comandos de PostgreSQL:
psql
Si no conoces la contraseña de postgres:
ALTER USER postgres WITH PASSWORD 'tu_password';

Para crear usuarios, considera usar el comando createuser desde consola Linux para creación interactiva:
sudo -u postgres createuser --interactive

Para listar usuarios/roles existentes en psql:
\du

# Instalar PostgreSQL y herramientas adicionales
sudo apt update
sudo apt install postgresql postgresql-contrib libpq-dev

# Inicializar clúster de base de datos (opcional - solo si necesitas nuevo directorio)
sudo -u postgres initdb -D /ruta/del/directorio


# Manipular el servicio PostgreSQL
sudo systemctl start postgresql      # Iniciar servicio
sudo systemctl restart postgresql    # Reiniciar servicio
sudo systemctl stop postgresql       # Detener servicio

2. Crear roles (usuarios) y bases de datos
# Acceder como usuario postgres en bash
sudo -u postgres psql

# Crear nuevo usuario con contraseña
CREATE USER nombre_usuario WITH PASSWORD 'tu_contraseña';

# Crear una base de datos nueva (opcional asignar propietario)
CREATE DATABASE nombre_base_de_datos OWNER nombre_usuario;

# Otorgar todos los privilegios sobre la base a un usuario
GRANT ALL PRIVILEGES ON DATABASE nombre_base_de_datos TO nombre_usuario;

# Eliminar usuario cuando ya no se necesite
DROP USER nombre_usuario;

3. Conectarse y administrar con psql
# Conectarse a postgres como superusuario (te pedirá contraseña si la tiene)
psql -h localhost -U postgres -W

# Mostrar bases de datos
\l

# Conectarse a una base de datos existente
\c nombre_base_de_datos

# Importar archivo SQL en una base
\i /ruta/del/archivo.sql

# Salir de psql
\q

II. Termux (Android Linux Shell)
1. Apertura y acceso al usuario postgres
# Abrir consola con Ctrl + Alt + T

# Cambiar a usuario root
sudo su

# Ingresar contraseña root si se solicita

# Cambiar a usuario postgres
su - postgres

# Ingresar a shell psql
psql

# Conectarse a la base postgres
\c postgres

# Luego ingresar la contraseña que configuraste

# Para salir de psql
\q o exit

III. Windows
1. Inicialización y manejo del servicio PostgreSQL

# Inicializar base de datos (solo si creas nuevo clúster)
initdb -D "C:\directorio\postgresql\data"

# Iniciar el servidor
pg_ctl -D "C:\directorio\postgresql\data" start

# Reiniciar el servidor
pg_ctl -D "C:\directorio\postgresql\data" restart

# Detener el servidor
pg_ctl -D "C:\directorio\postgresql\data" stop


star

Tue Jul 29 2025 11:03:53 GMT+0000 (Coordinated Universal Time) https://maticz.com/how-much-does-crypto-wallet-development-cost

@austinparker

star

Tue Jul 29 2025 10:46:33 GMT+0000 (Coordinated Universal Time)

@shubhangi.b

star

Tue Jul 29 2025 10:27:13 GMT+0000 (Coordinated Universal Time) https://cyberspace.in/services/responsive-website/

@cyberspace #web #design

star

Tue Jul 29 2025 09:14:25 GMT+0000 (Coordinated Universal Time) https://www.newassignmenthelpaus.expert/sql-assignment-help

@henryjones0116

star

Tue Jul 29 2025 06:57:24 GMT+0000 (Coordinated Universal Time)

@shubhangi.b

star

Tue Jul 29 2025 06:11:45 GMT+0000 (Coordinated Universal Time)

@shubhangi.b

star

Tue Jul 29 2025 05:52:40 GMT+0000 (Coordinated Universal Time)

@shubhangi.b

star

Mon Jul 28 2025 12:38:03 GMT+0000 (Coordinated Universal Time) https://www.fourchain.com/services/cryptocurrency-trading-bot-development

@zainabegum #cryptotrading #bot

star

Mon Jul 28 2025 12:21:18 GMT+0000 (Coordinated Universal Time) https://www.firebeetechnoservices.com/crypto-trading-bot-development

@aanaethan ##crypto ##cryptocurrency ##blockchain

star

Mon Jul 28 2025 09:00:03 GMT+0000 (Coordinated Universal Time)

@enojiro7

star

Mon Jul 28 2025 07:02:13 GMT+0000 (Coordinated Universal Time) https://www.dappfort.com/white-label-crypto-wallet/

@catelyn #whitelabelcryptowallet

star

Mon Jul 28 2025 06:53:24 GMT+0000 (Coordinated Universal Time) https://ae.assignmenthelppro.com/

@anyanovak #assignmenthelp #assignmenthelper #onlineassignmenthelper #assignmenthelpservices

star

Sun Jul 27 2025 17:03:55 GMT+0000 (Coordinated Universal Time)

@2late #windows

star

Sat Jul 26 2025 17:03:49 GMT+0000 (Coordinated Universal Time)

@touchSort

star

Sat Jul 26 2025 16:56:35 GMT+0000 (Coordinated Universal Time) https://flatcoding.com/tutorials/php/arrow-functions/

@Samuel88 #php

star

Sat Jul 26 2025 12:14:28 GMT+0000 (Coordinated Universal Time)

@touchSort

star

Sat Jul 26 2025 11:04:04 GMT+0000 (Coordinated Universal Time) https://www.addustechnologies.com/zed-run-clone-script

@Seraphina

star

Fri Jul 25 2025 19:03:04 GMT+0000 (Coordinated Universal Time)

@jrg_300i #undefined

star

Fri Jul 25 2025 19:02:32 GMT+0000 (Coordinated Universal Time)

@jrg_300i #undefined

star

Fri Jul 25 2025 10:50:05 GMT+0000 (Coordinated Universal Time)

@Pooja

star

Fri Jul 25 2025 10:22:29 GMT+0000 (Coordinated Universal Time)

@ShellyJackson

star

Fri Jul 25 2025 09:53:10 GMT+0000 (Coordinated Universal Time)

@shubhangi.b

star

Fri Jul 25 2025 09:53:09 GMT+0000 (Coordinated Universal Time)

@shubhangi.b

star

Fri Jul 25 2025 09:25:57 GMT+0000 (Coordinated Universal Time) https://www.coinsclone.com/binance-nft-marketplace-clone-script/

@LilianAnderson #binancenftclone #nftmarketplacedevelopment #binanceclonescript #nftbusinesssolutions #launchnftmarketplace

star

Fri Jul 25 2025 05:44:18 GMT+0000 (Coordinated Universal Time)

@Rishi1808

star

Fri Jul 25 2025 02:06:13 GMT+0000 (Coordinated Universal Time)

@DawoodRaza #disable_auto_update_wp

star

Fri Jul 25 2025 00:48:29 GMT+0000 (Coordinated Universal Time)

@FOHWellington

star

Thu Jul 24 2025 12:16:47 GMT+0000 (Coordinated Universal Time)

@usman13

star

Thu Jul 24 2025 04:49:22 GMT+0000 (Coordinated Universal Time) https://stake.bet/casino/home

@meetmangukiya

star

Wed Jul 23 2025 22:37:49 GMT+0000 (Coordinated Universal Time)

@ismaelnovo

star

Wed Jul 23 2025 17:00:31 GMT+0000 (Coordinated Universal Time)

@touchSort

star

Wed Jul 23 2025 11:08:40 GMT+0000 (Coordinated Universal Time)

@usman13

star

Wed Jul 23 2025 09:00:10 GMT+0000 (Coordinated Universal Time)

@Rishi1808

star

Wed Jul 23 2025 07:35:26 GMT+0000 (Coordinated Universal Time)

@bojandeveloper #js #function

star

Wed Jul 23 2025 06:11:21 GMT+0000 (Coordinated Universal Time) https://www.coinsclone.com/what-is-nft-marketplace-how-it-works/

@LilianAnderson #nftmarketplacetips #runninganftmarketplace #nfttransactionfees #valuingnfts #nftmarketplacetypes

star

Tue Jul 22 2025 22:02:49 GMT+0000 (Coordinated Universal Time)

@selmo

star

Tue Jul 22 2025 21:25:21 GMT+0000 (Coordinated Universal Time)

@hamzakhan123

star

Tue Jul 22 2025 20:40:51 GMT+0000 (Coordinated Universal Time)

@hamzakhan123

star

Tue Jul 22 2025 18:15:32 GMT+0000 (Coordinated Universal Time)

@jrg_300i #undefined

star

Tue Jul 22 2025 17:13:51 GMT+0000 (Coordinated Universal Time)

@jrg_300i #undefined

star

Tue Jul 22 2025 13:34:59 GMT+0000 (Coordinated Universal Time)

@amritabajpai

star

Tue Jul 22 2025 12:57:47 GMT+0000 (Coordinated Universal Time) https://maticz.com/rarible-clone-script

@carolinemax #maticz #rarible-clone

star

Tue Jul 22 2025 12:54:36 GMT+0000 (Coordinated Universal Time)

@reiddd #javascript

star

Tue Jul 22 2025 11:26:53 GMT+0000 (Coordinated Universal Time)

@amritabajpai

star

Tue Jul 22 2025 09:53:16 GMT+0000 (Coordinated Universal Time) https://www.fourchain.com/nfts/opensea-clone

@zainabegum #openseaclone #openseaclonescript #nftmarketplace

star

Tue Jul 22 2025 09:26:41 GMT+0000 (Coordinated Universal Time)

@Pulak

star

Tue Jul 22 2025 07:18:58 GMT+0000 (Coordinated Universal Time)

@amritabajpai

star

Tue Jul 22 2025 07:06:00 GMT+0000 (Coordinated Universal Time) https://www.addustechnologies.com/agi-development-company

@Seraphina

star

Mon Jul 21 2025 15:10:45 GMT+0000 (Coordinated Universal Time)

@Bh@e_LoG

star

Mon Jul 21 2025 14:33:23 GMT+0000 (Coordinated Universal Time)

@jrg_300i #undefined

Save snippets that work with our extensions

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