Skip to content

Instantly share code, notes, and snippets.

View bdeleasa's full-sized avatar

Brianna Deleasa bdeleasa

View GitHub Profile
@praveen-palanisamy
praveen-palanisamy / wp-backup-script.sh
Created August 19, 2018 16:25
WordPress backup script: A bash script to compress and backup a complete wordpress site including the database
#!/usr/bin/env bash
# wp-backup-script.sh - Creates a complete, compressed backup of your WordPress database and files. You can then transfer it to your preferred location (local disk, cloud backup storage etc)
# Author: Praveen Palanisamy | Twitter: @PraveenPsamy | GitHub: https://github.com/praveen-palanisamy| Website: https://praveenp.com
# Dependencies: mailutils
# 0. Change the variables below to suit your environment
WP_FOLDER="$HOME/public_html/" # Folder where your wordpress root installation is
BACKUP_FOLDER="$HOME/backups" # Folder where you want to store the backups
@pelmered
pelmered / convert-to-composer.php
Last active May 23, 2024 20:36
Convert WP to Composer
#!/usr/bin/php
<?php
/**
* USAGE:
*
* (optional) Download script:
* "wget https://gist.githubusercontent.com/pelmered/2ee27f1cb18b8c73a0205ded580e3195/raw/convert-to-composer.php"
*
* Basic usage:
* php convert-to-composer.php
@dmrrlc
dmrrlc / RelatedContentTitles.php
Last active August 2, 2017 16:13
Entity reference filter with drupal 8
<?php
/**
* @file
* Definition of Drupal\mymodule\Plugin\views\filter\RelatedContentTitles.
*/
namespace Drupal\mymodule\Plugin\views\filter;
use Drupal\views\Plugin\views\display\DisplayPluginBase;
use Drupal\views\Plugin\views\filter\ManyToOne;
use Drupal\views\ViewExecutable;
/**
@lgladdy
lgladdy / _wordpress_core.scss
Created April 13, 2014 19:02
WordPress Core Styles in SASS
/* =WordPress Core - Sassified.
-------------------------------------------------------------- */
.alignnone {
margin: 5px 20px 20px 0;
}
.aligncenter, div.aligncenter {
display: block;
margin: 5px auto 5px auto;
}
@Davidlab
Davidlab / Hide Nextgen Junk
Created March 11, 2013 14:31
Nexgen hide all styles and scripts. Good to use if you are using a third party plugin along side Nexgen that handles the styles and fancy stuff. This will hide all Nexgen junk from loading.
/*
* Hide Nextgen styles and scripts
*/
if (!is_admin()) {
// goodbye NextGen junk
define('NGG_SKIP_LOAD_SCRIPTS', true);
function nextgen_styles() {
wp_deregister_style('NextGEN');
}
add_action('wp_print_styles', 'nextgen_styles', 100);
@Narga
Narga / wordpress-remove-recent-comment-style.php
Created June 7, 2012 08:26
Wordpress Snippets - remove recent comments style
<?php
//http://www.narga.net/how-to-remove-or-disable-comment-reply-js-and-recentcomments-from-wordpress-header
function twentyten_remove_recent_comments_style() {
global $wp_widget_factory;
remove_action( 'wp_head', array( $wp_widget_factory->widgets['WP_Widget_Recent_Comments'], 'recent_comments_style' ) );
}
add_action( 'widgets_init', 'twentyten_remove_recent_comments_style' );
?>
@jimkutter
jimkutter / gist:1370525
Created November 16, 2011 16:21
List of US States in a PHP array
<?php
array(
'AL' => 'Alabama',
'AK' => 'Alaska',
'AZ' => 'Arizona',
'AR' => 'Arkansas',
'CA' => 'California',
'CO' => 'Colorado',
'CT' => 'Connecticut',