Skip to content

Instantly share code, notes, and snippets.

View vladdancer's full-sized avatar
🖖

Vlad Moyseenko vladdancer

🖖
View GitHub Profile
@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 / 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 / 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 / gist:edb40c11807e7e672ac43d62f2f7383f
Created October 7, 2020 15:41
php, memory limit, composer install
php -d memory_limit=-1 $(which composer) install
@vladdancer
vladdancer / certbot.cron
Created October 8, 2020 10:38
Debian 10 Certbot cron task to prolongate certificate
#Ansible: Certbot automatic renewal.
*/3 * * * * (/opt/certbot/certbot-auto renew --quiet --no-self-upgrade --pre-hook "/bin/systemctl stop nginx" --post-hook "/bin/systemctl start nginx") >> /var/log/certbotcron.log 2>&1
@vladdancer
vladdancer / fix_entity_type_after_removing_entity_key.drush.php
Last active October 9, 2020 22:14
Fix entity type after removing entity key. #drupal8 #drupal #entity #drush
<?php
/**
* For the details see https://www.drupal.org/project/drupal/issues/3058082
* Run with:
* `drush scr fix_entity_type_after_removing_entity_key.drush entity_type -- YOUR_ENTITY_TYPE_NAME entity_key -- KEY_TO_REMOVE`
* How to run php script with Drush on Drupal see `drush scr --help`.
*/
if ($extra[0] !== 'entity_type' || !isset($extra[1])) {
print "You should provide 'entity_type' argument\n";
@vladdancer
vladdancer / domain.conf
Last active November 3, 2020 14:39
NGINX https config for a single domain with PHP app on Debian 10 using Letsencrypt certificate
server {
listen 443 ssl http2;
server_name example.com;
root /var/www/app;
index index.php index.html index.htm;
ssl on;
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
@vladdancer
vladdancer / export.single.config.sh
Created October 28, 2020 12:40
Export list of single config files using Drupal Console
#!/bin/bash
# get a list of config ids that we are interested in.
drupal dc | grep 'views.view.phot*'
drupal ces \
--module=MY_MODULE \
--optional \
--remove-uuid \
--remove-config-hash \
@vladdancer
vladdancer / drush.ev.sh
Created October 30, 2020 18:35
Set TTL for file deletion #drupal
drush cset system.file temporary_maximum_age 1 -y