Skip to content

Instantly share code, notes, and snippets.

View vladdancer's full-sized avatar
🖖

Vlad Moyseenko vladdancer

🖖
View GitHub Profile
@vladdancer
vladdancer / save_recursively_list_of_files_and_rename
Last active July 11, 2017 08:41
save recursively list of files and rename via wget & mmv #test-category
wget -i list_of_urls_file -P destination_folder
brew install mmv
find . -type f ! -name "*.*" | mmv '*' '#1.jpg'
@vladdancer
vladdancer / gist:3317e97991ffddac7cad63b61410fa9d
Last active January 2, 2021 11:35
test git #test-category
composer require drupal/console:~1.0 \
--prefer-dist \
--optimize-autoloader \
--sort-packages \
--no-update
@vladdancer
vladdancer / Built_In.xml
Created March 5, 2017 20:34 — forked from mglaman/Built_In.xml
Configurations to run Drupal Commerce tests in PHPStorm. add to $PROJECT/.idea/runConfigurations. The compound "Commerce Test Runner" will launch PhanomJS, PHP's built in and then run Drupal Commerce's PHPUnit tests.
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Built-in" type="PhpBuiltInWebServerConfigurationType" factoryName="PHP Built-in Web Server" singleton="true" document_root="$PROJECT_DIR$/www" port="8080">
<method />
</configuration>
</component>
@vladdancer
vladdancer / get_info.sh
Created July 29, 2017 17:39
[get gif duration using CLI] #shell #macos
exiftool -Duration /path/to/file.gif
@vladdancer
vladdancer / upwork_prettify_messages_and_print.js
Last active August 30, 2019 21:52
How to print an entire Upwork message thread
$ = $ || wmjQuery || jQuery
setTimeout(function(){
$('nav').remove();
$('.composer-panel').remove();
$('div[target-selector=".main-container"]').remove();
$('nav.primary-navbar').remove();
$('#room-chat-nav').remove();
$('#room-nav').remove();
$('body').css('overflow-y', 'scroll');
$('body').css('height', '10000px');
@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.
@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 / 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
drush sqlq "UPDATE users_field_data SET mail = '[email protected]' WHERE mail = '[email protected]'"
drush cr
@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';
}