Skip to content

Instantly share code, notes, and snippets.

View vladdancer's full-sized avatar
🖖

Vlad Moyseenko vladdancer

🖖
View GitHub Profile
@vladdancer
vladdancer / App.svelte
Last active January 18, 2021 17:36
workaround for a bug with hiding view toolbar on specific page on #framework7 #v5
<script>
import {
App,
View,
Toolbar,
Views,
Link, f7ready
} from 'framework7-svelte';
import {states} from "./services/store";
@vladdancer
vladdancer / Remove audio track from video.sh
Last active February 5, 2021 16:27
FFmpeg converting m4a, wav files to mp3 examples.
# show media file info
ffmpeg -i in.mp4
# find video track ID and set as -map param value
ffmpeg -i in.mp4 -map 0:0 -vcodec copy out-wo-audio.mp4
@vladdancer
vladdancer / fast_copy_node_proj.sh
Created December 7, 2020 10:46
Copy node project without node_modules #node #js #bash
rsync -av --progress ../source_proj/* ./ --exclude node_modules --exclude .git
@vladdancer
vladdancer / macos_logout_user.sh
Created December 12, 2020 11:26
Lgout user using shell on macos.
sudo launchctl bootout user/$(id -u USERNAME)
@vladdancer
vladdancer / analyze_js_bundle_size.sh
Created December 13, 2020 20:44
Analyze JS bundle size
source-map-explorer public/build/bundle.js public/build/bundle.js.map
@vladdancer
vladdancer / git-branches-by-commit-date.sh
Created January 20, 2021 09:01 — forked from jasonrudolph/git-branches-by-commit-date.sh
List remote Git branches and the last commit date for each branch. Sort by most recent commit date.
# Credit http://stackoverflow.com/a/2514279
for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ci %cr" $branch | head -n 1` \\t$branch; done | sort -r
@vladdancer
vladdancer / export.default.content.sh
Created February 24, 2021 13:40
export content in drupal
#!/bin/bash
# Note: the path is relative to the DRUPAL_ROOT
# drush dcer --folder
drush dcer taxonomy_term 11972 --folder=modules/custom/my_module/modules/my_module_demo_content/content
drush dcer question 13 --folder=modules/custom/my_module/modules/my_module_demo_content/content
@vladdancer
vladdancer / composer.json
Last active February 25, 2021 10:51
Redis config for settings.php #drupal8 #redis
{
"type": "project",
"license": "GPL-2.0-or-later",
"authors": [
{
"name": "",
"role": ""
}
],
"repositories": [
@vladdancer
vladdancer / drupal_db_drush.sh
Last active July 16, 2024 20:04
Import/export drupal db dump #drush #drupal
# intstall database
# drush si --db-url=mysql://root:pass@localhost:port/dbname
drush si --db-url=mysql://drupal:drupal@mariadb/drupal
# export db
drush sql-dump > db.sql
# import db
drush sql-cli < db.sql
@vladdancer
vladdancer / info.sh
Created March 24, 2021 18:27
Lando, get external container port to connect to the DB. #lando #drupal #docker
lando info --filter service=database
# or
lando info --format=json | jq '.[] | select(.service=="database") | .external_connection.port '
# to suppress nodejs warnings run lando with
# see https://github.com/lando/lando/issues/2928
node --no-warnings /path/to/lando.js info --format=json | jq '.[] | select(.service=="database") | .external_connection.port'