Skip to content

Instantly share code, notes, and snippets.

View Ghepes's full-sized avatar

Studio Wromo Marketplace Ghepes

View GitHub Profile
@Ghepes
Ghepes / Country code html
Created June 11, 2025 15:07
Country code html
Country code SPEC.code ENGLISH NAME
--------------------------------------------------------------
Invariant Language (Invariant Country)
af af-ZA Afrikaans
af-ZA af-ZA Afrikaans (South Africa)
ar ar-SA Arabic
ar-AE ar-AE Arabic (U.A.E.)
ar-BH ar-BH Arabic (Bahrain)
ar-DZ ar-DZ Arabic (Algeria)
ar-EG ar-EG Arabic (Egypt)
@Ghepes
Ghepes / Concatenation JS method start with ;
Last active May 27, 2025 20:18
Dynamic concatenation of JavaScript files
To change the method to comment out any files before starting the JS script ...
and to also have the hash file name + reading *.*.js and special characters : the following method applies
---
### index.js
const express = require('express');
const fs = require('fs');
ssh user@ip_vm
# Importă cheia GPG
curl -fsSL https://pgp.mongodb.com/server-6.0.asc | \
sudo gpg -o /usr/share/keyrings/mongodb-server-6.0.gpg \
--dearmor
# Adaugă repository-ul
echo "deb [ signed-by=/usr/share/keyrings/mongodb-server-6.0.gpg ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/6.0 multiverse" | \
sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list
Connect with socat: Local port 127.0.0.1:11434 to extern IPv4:11434
test of debian:
1. Install:
sudo apt update
sudo apt install socat
2. Test connect IPv4 extern:
sudo socat TCP-LISTEN:11434,bind=83.xxx.xxx.118,fork TCP:127.0.0.1:11434
@Ghepes
Ghepes / TAX ID TYPES
Created March 11, 2025 10:59
TAX ID TYPES
const TAX_ID_TYPES = [
{ value: "ae_trn", label: "United Arab Emirates TRN" },
{ value: "au_abn", label: "Australian ABN" },
{ value: "au_arn", label: "Australian ARN" },
{ value: "br_cnpj", label: "Brazilian CNPJ" },
{ value: "br_cpf", label: "Brazilian CPF" },
{ value: "ca_bn", label: "Canadian BN" },
{ value: "es_cif", label: "Spanish CIF" },
{ value: "no_vat", label: "Norwegian VAT" },
{ value: "nz_gst", label: "New Zealand GST" },
@Ghepes
Ghepes / Country code app
Created March 11, 2025 10:17
Country code app
const COUNTRIES = [
{ code: "US", name: "United States" },
{ code: "CA", name: "Canada" },
{ code: "GB", name: "United Kingdom" },
{ code: "AU", name: "Australia" },
{ code: "DE", name: "Germany" },
{ code: "FR", name: "France" },
{ code: "ES", name: "Spain" },
{ code: "IT", name: "Italy" },
{ code: "JP", name: "Japan" },
@Ghepes
Ghepes / Network persistent
Last active February 22, 2025 13:26
Network vm ubuntu 22.04
If you are running **Ubuntu 22.04.5 LTS** in a virtual machine and want to ensure that your IPv4 network settings are not lost across reboots or configuration changes, follow these steps:
---
## **1. Saving Current Configuration**
Before making any changes, save your current network settings:
```bash
mkdir -p ~/network_backup
ip a > ~/network_backup/current_ip.txt
@Ghepes
Ghepes / Add pm2 to app nextjs
Last active December 25, 2024 20:16
Add pm2 to app nextjs
1. cd to /Project
### install pm2
````
npm install pm2 -g
````
### add to main project ecosystem.config.js file with next javascript
````
module.exports = {
@Ghepes
Ghepes / CSP
Last active June 12, 2024 20:17
nonce
<!-- EXEMPLE css nonce CSP -->
<link rel="stylesheet" media="all" href="https://domain.a.com/a/file/style.css" nonce="">
<!-- EXEMPLE js nonce CSP -->
<script nonce="">
// Codul scriptului
</script>
@Ghepes
Ghepes / service-worker.js
Created March 16, 2024 23:02 — forked from jeffposnick/service-worker.js
Example of InjectManifest in Workbox v5
// Add any other logic here as needed.
import { CacheableResponsePlugin } from 'workbox-cacheable-response/CacheableResponsePlugin';
import { CacheFirst } from 'workbox-strategies/CacheFirst';
import { createHandlerForURL } from 'workbox-precaching/createHandlerForURL';
import { ExpirationPlugin } from 'workbox-expiration/ExpirationPlugin';
import { NavigationRoute } from 'workbox-routing/NavigationRoute';
import { precacheAndRoute } from 'workbox-precaching/precacheAndRoute';
import { registerRoute } from 'workbox-routing/registerRoute';