Skip to content

Instantly share code, notes, and snippets.

View vladdancer's full-sized avatar
🖖

Vlad Moyseenko vladdancer

🖖
View GitHub Profile
@vladdancer
vladdancer / gist:edb40c11807e7e672ac43d62f2f7383f
Created October 7, 2020 15:41
php, memory limit, composer install
php -d memory_limit=-1 $(which composer) install
@vladdancer
vladdancer / docker-compose.yml
Last active February 2, 2022 15:27
ngrok tunneling https to docker4drupal web app
nginx:
image: wodby/nginx:$NGINX_TAG
container_name: "${PROJECT_NAME}_nginx"
depends_on:
- php
environment:
NGINX_STATIC_OPEN_FILE_CACHE: "off"
NGINX_ERROR_LOG_LEVEL: debug
NGINX_BACKEND_HOST: php
NGINX_SERVER_ROOT: /var/www/html/web
@vladdancer
vladdancer / PsCurves.js
Created June 11, 2019 10:31
#photoshop #raw-data #parser #mapper #art-layers #adjustment-layers #curves #kaitai-struct #deserializer Example of Curves Art Layer parser based on KaitaiStruct declarative parser
// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define(['kaitai-struct/KaitaiStream'], factory);
} else if (typeof module === 'object' && module.exports) {
module.exports = factory(require('kaitai-struct/KaitaiStream'));
} else {
root.PsCurves = factory(root.KaitaiStream);
}
@vladdancer
vladdancer / Replacer.ts
Last active July 21, 2021 21:46
Photoshop Xtools performance optimisation for the process of converting a large raw data (AD.write["DescValueType.RAWTYPE"]) (Color Lookup layers) #concept #photoshop #nodejs #jsx #tools #atn #binary #post-process
import {padWord, toByteInHex} from "../utils";
import FileSystem from "./FileSystem";
import { Buffer } from 'buffer';
declare interface Marker {
marker: string,
data: BufferSource
}
class Replacer {
@vladdancer
vladdancer / unzipOnFtp.php
Created March 8, 2019 13:35
unzip dir instead of transfering via FTP #php #ftp #deployment
<?php
$zip = new ZipArchive;
if ($zip->open('archive.zip') === TRUE) {
$zip->extractTo('./destDir');
$zip->close();
echo 'ok';
}
drush sqlq "UPDATE users_field_data SET mail = '[email protected]' WHERE mail = '[email protected]'"
drush cr
@vladdancer
vladdancer / docker-compose.yml
Last active March 20, 2018 14:31
docker-compose example for testing Drupal
version: "2"
services:
mariadb:
image: wodby/mariadb:10.2-3.0.2
# image: wodby/mariadb:10.1-3.0.2
environment:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: drupal
MYSQL_USER: drupal
@vladdancer
vladdancer / update_product_displays.drush
Created October 11, 2017 13:18
Drupal 7, Drush. Bulk update changed time for specific product displays using drush
<?php
// drush php-script update_product_displays.drush
$time = time();
$prev_timestamp = $time - (15 * 60);
$efq = new EntityFieldQuery();
$efq
// Conditions on the entity - its type and its bundle ("sub-type")
->entityCondition('entity_type', 'node')
@vladdancer
vladdancer / findNewUrls.drush
Last active August 21, 2017 15:08
Drupal 8. Find new path aliases by old ones
<?php
/**
* @file
* findNewUrls.drush
*
* This script tries to find a new url based on old one.
* Old urls should be placed in the same dir as a script file,
* and named as url-list.php, use php array format to add more old urls.
*
* Here is a finding logic.