Skip to content

Instantly share code, notes, and snippets.

<!-- отправка десктопа -->
<script>
document.addEventListener("DOMContentLoaded", function(event) {
let title = "{{ resources['client_order_title'] }} №{{ order.id }}"//Заявка номер 111
let name = "{{ order.user_name }}"//Alexey
<!-- отправка десктопа -->
<script>
document.addEventListener("DOMContentLoaded", function(event) {
let title = "{{ resources['client_order_title'] }} №{{ order.id }}"//Заявка номер 111
let name = "{{ order.user_name }}"//Alexey
<!-- отправка десктопа -->
<script>
document.addEventListener("DOMContentLoaded", function(event) {
let title = "{{ resources['client_order_title'] }} №{{ order.id }}"//Заявка номер 111
let name = "{{ order.user_name }}"//Alexey
@klim2020
klim2020 / gist:e9db3957740e42a27943e3dd5ef7caea
Created August 8, 2022 01:33
php js jquery обработка работа преобразование объектов JSON клинет - сервер строковое представление
PHP->Laravel
$office_get = json_decode($request->autoSelectedOffice,true);
js->front
JSON.stringify(carLibrary.offices[{{ $region_get }}])
@klim2020
klim2020 / 1651261762.txt
Last active April 29, 2022 19:50
PG sql
pgsql:
image: postgres:13
ports:
- '${FORWARD_DB_PORT:-5432}:5432'
environment:
PGPASSWORD: '${DB_PASSWORD:-secret}'
POSTGRES_DB: '${DB_DATABASE}'
POSTGRES_USER: '${DB_USERNAME}'
POSTGRES_PASSWORD: '${DB_PASSWORD:-secret}'
volumes:
@klim2020
klim2020 / 1649581609.php
Last active April 10, 2022 09:08
php howto Remove double quote in json_encode() удалить двойные кавычки в json массиве с php
$array_final = preg_replace('/"([a-zA-Z]+[a-zA-Z0-9_]*)":/','$1:',$array_final);
@klim2020
klim2020 / get-all-attribute-names-fromsql.sql
Last active April 9, 2022 05:21
php opencart mysql get all attributes for directory
SELECT ocptc.category_id,
ocp.product_id,
ocp.attribute_id,
ocp.language_id,
ocp.text,
oagd.attribute_group_id,
oagd.name
FROM `oc_category_path`
RIGHT JOIN `oc_product_to_category` ocptc
on ocptc.category_id = oc_category_path.category_id
@klim2020
klim2020 / vqmod_create.php
Created April 8, 2022 18:42 — forked from grey-dev-0/vqmod_create.php
vQmod xml creation and merge from git diff output
<?php
// Creates vQmod xml file from git diff output stored in a text file "git.txt"
// NOTE: Works only with SINGLE line changes.
$diffs = fopen('diffs.txt', 'r');
$modifications = "<modification>";
$fileIsOpen = $operationIsOpen = $searchIsOpen = false;
while($line = fgets($diffs)){
if(preg_match('/^diff --git ([^ ]+) ([^ ]+)/', $line, $files)){
if($operationIsOpen){
@klim2020
klim2020 / debug.php
Created November 25, 2021 09:29 — forked from eddieajau/debug.php
Printing a clean debug backtrace in PHP.
// PHP < 5.3.6
foreach (debug_backtrace() as $trace)
{
echo sprintf("\n%s:%s %s::%s", $trace['file'], $trace['line'], $trace['class'], $trace['function']);
}
die;
// PHP >= 5.3.6
debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
die;
@klim2020
klim2020 / php json add quotes to number
Last active November 8, 2021 07:23
Created with Copy to Gist
$myNewJsonString = preg_replace('/"([^"]+)":\s*(\d+)/', '"\1": "\2"', $myJsonString);