Skip to content

Instantly share code, notes, and snippets.

View RocketSharck's full-sized avatar

RocketSharck

View GitHub Profile
@RocketSharck
RocketSharck / gist:d6f44b8520b29d756f525b3cb13126f8
Created August 27, 2018 20:57
Convert m4a to mp3 with ffmpeg
ffmpeg -i foo.m4a -acodec libmp3lame -aq 2 bar.mp3
for foo in *.m4a; do ffmpeg -i "$foo" -acodec libmp3lame -aq 2 "${foo%.m4a}.mp3"; done
@RocketSharck
RocketSharck / youtube.sh
Created August 22, 2018 18:31 — forked from dantheman213/youtube-dl_cheatsheet.md
youtube-dl cheatsheet -- Download entire youtube playlist and more!
# https://github.com/rg3/youtube-dl/
# On ubuntu: apt-get install libav-tools
# Download Playlist to batch of MP3s
youtube-dl -f bestvideo+bestaudio --extract-audio --audio-format mp3 --prefer-avconv --playlist-random https://www.youtube.com/playlist?list=XXXXX
# Download individual song
youtube-dl -f bestvideo+bestaudio --extract-audio --audio-format mp3 --prefer-avconv https://www.youtube.com/watch?v=ZZZZZZZ
@RocketSharck
RocketSharck / yoast-seo-sitemap.php
Last active August 12, 2018 19:10 — forked from mohandere/yoast-seo-sitemap.php
Wordpress yoast seo plugin, generate custom sitemap for custom URLS
<?php
// add_filter( 'wpseo_enable_xml_sitemap_transient_caching', '__return_false');
/**
* Create a new custom yoast seo sitemap
*/
add_filter( 'wpseo_sitemap_index', 'ex_add_sitemap_custom_items' );
add_action( 'init', 'init_wpseo_do_sitemap_actions' );
@RocketSharck
RocketSharck / custom-css.php
Created May 27, 2018 18:47 — forked from MohammedKaludi/custom-css.php
Add Custom CSS in AMPforWP via Hook
add_action('amp_post_template_css','ampforwp_add_custom_css_example', 11);
function ampforwp_add_custom_css_example() { ?>
/* Add your custom css here */
body {
background: red;
}
<?php
}
@RocketSharck
RocketSharck / fix-wordpress-permissions.sh
Created May 23, 2018 15:18 — forked from Adirael/fix-wordpress-permissions.sh
Fix wordpress file permissions
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org>
#
WP_OWNER=www-data # <-- wordpress owner
WP_GROUP=www-data # <-- wordpress group
WP_ROOT=$1 # <-- wordpress root directory
@RocketSharck
RocketSharck / Instructions.sh
Created May 23, 2018 15:00 — forked from GhazanfarMir/Instructions.sh
Install PHP7.2 NGINX and PHP7.2-FPM on Ubuntu 16.04
########## Install NGINX ##############
# Install software-properties-common package to give us add-apt-repository package
sudo apt-get install -y software-properties-common
# Install latest nginx version from community maintained ppa
sudo add-apt-repository ppa:nginx/stable
# Update packages after adding ppa
@RocketSharck
RocketSharck / tmux-cheatsheet.markdown
Created March 27, 2018 20:38 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@RocketSharck
RocketSharck / PHP cleaner
Created March 24, 2018 13:56 — forked from gordonbanderson/PHP cleaner
Find leading and trailing space
<?php
/***********************
*@author: Ritesh Agrawal
*@description: Identifies php files that contain leading or trailing spaces before or after PHP opening or closings tags
*@version: 1.0
*@date: Nov 06, 2007
@todo – check only *.PHP or *.CTP files rather than checking all of the files
– html based output
***********************/
//Set Source Path