Skip to content

Instantly share code, notes, and snippets.

@anwas
anwas / youtube-dl.txt
Last active April 14, 2025 16:00
[youtube-dl cli templates] #youtube-dl #youtube #cli
https://github.com/rg3/youtube-dl/blob/master/README.md#output-template
youtube-dl --download-archive archive.txt --output "%(playlist_index)s - %(title)s – [%(alt_title)s].%(ext)s" https://www.youtube.com/playlist?list=PL4dWJMOQ_a1TgayrpaB-SEVJhHC58U1wU --ignore-errors
youtube-dl --download-archive archive.txt -f bestvideo+bestaudio --merge-output-format mkv --output "%(playlist_uploader)s – %(playlist)s/%(playlist_index)s - %(title)s.%(ext)s" https://www.youtube.com/playlist?list=$1 --ignore-errors
youtube-dl --download-archive archive.txt -f 'bestvideo[height>=720]+bestaudio' --merge-output-format mkv --output "%(playlist_uploader)s – %(playlist)s/%(playlist_index)s - %(title)s.%(ext)s" https://www.youtube.com/playlist?list=$1 --ignore-errors
@anwas
anwas / wp-config.php
Last active November 10, 2021 11:35
[WordPress wp-config customization]
<?php
/* WordPress debug mode for developers. */
define( 'WP_DEBUG', true );
// Enable Debug logging to the /wp-content/debug.log file
define( 'WP_DEBUG_LOG', true );
// Disable display of errors and warnings
define( 'WP_DEBUG_DISPLAY', false );
@anwas
anwas / recursevely-remove-folders-or-files-by-name.sh
Last active October 23, 2021 02:24
[Rekursiškai trinti aplankus pagal pavadinimą] #cli #folders
#!/bin/bash
find . -type d -name .metadata -exec rm -rf {} \;
# or files by wildcard
find . -type f -name *.part -exec rm -rf {} \;
# The script starts within the current directory,
# so be sure you navigate to the directory you want to start searching from first.
# This script would work on any search type;
# simply replace ".metadata" with the search of your choosing but be careful:
@anwas
anwas / move-folders-to-parent.sh
Last active March 17, 2018 16:18
[Perkelti visus failus į aukštesnį aplanką] #cli #folders #files
(shopt -s dotglob; mv -- * ..)
@anwas
anwas / bitbucket.txt
Created February 28, 2018 14:55
[BitBucket project initialize on local machine] #git #bitbucket
# Existing local project
#Step 1: Switch to your repository's directory
cd /path/to/your/repo
# Step 2: Connect your existing repository to Bitbucket
git remote add origin https://aivaras_n@bitbucket.org/pavbiblioteka/theme_pankrastas.git
git push -u origin master
@anwas
anwas / center-verticaly-2.scss
Last active February 28, 2018 15:10
[Center verticaly] #css #scss #centering
.element {
position: relative;
top: 50%;
transform: perspective(1px) translateY(-50%);
}
@anwas
anwas / wpml-ssl.php
Last active February 28, 2018 15:15
[WPML force SSL] #wordpress #wpml #ssl
<?php
/****************/
/* WPML SUPPORT */
/****************/
function force_ssl( $force_ssl, $id = 0 ) {
// A list of posts that should be SSL
$ssl_posts = array(8);
if ( in_array( $id, $ssl_posts ) ) {
$force_ssl = true;
@anwas
anwas / convert-pdf.sh
Last active October 1, 2020 07:49
[PDF apsaugos nuo teksto kopijavimo pašalinimas] #pdf #hack #cli
pdftops apsaugotas.pdf tmp.ps
ps2pdf tmp.ps naujas.pdf
@anwas
anwas / css-grid-gallery-with-fallback.scss
Last active July 1, 2020 08:10
[CSS grid gallery with fallback] #css #css-grid #scss
@anwas
anwas / wordpress-facebook-opengraph.php
Last active October 22, 2022 08:50
[Facebook OpenGraph integracija WordPress temoje]
<?php
/**
* Adding the Open Graph in the Language Attributes
* @param $output
*
* @return string
*/
function mysite_add_opengraph_doctype( $output ) {
return $output . ' xmlns:og="http://opengraphprotocol.org/schema/" xmlns:fb="http://www.facebook.com/2008/fbml"';
}