Skip to content

Instantly share code, notes, and snippets.

View nicolabavaro's full-sized avatar

Nicola Bavaro nicolabavaro

View GitHub Profile
@nicolabavaro
nicolabavaro / add-vc-grid-element.php
Created February 16, 2017 17:05
Create a custom element fo visual Composer Grid Builder
// _dt_fancy_header_bg_image
add_filter( 'vc_gitem_template_attribute_fancy_image', 'vc_gitem_template_attribute_fancy_image', 10, 2 );
function vc_gitem_template_attribute_fancy_image( $value, $data ) {
/**
* @var Wp_Post $post
* @var string $data
*/
global $post;
@moshekaplan
moshekaplan / selenium_cookies_to_mechanize.py
Created August 29, 2014 14:18
Selenium cookies to Mechanize
import mechanize
import cookielib
import selenium.webdriver
# Create a selenium instance for browsing web pages
driver = selenium.webdriver.Firefox()
# ... Perform some actions
# Grab the cookie
@boonebgorges
boonebgorges / bbg-csv-export.php
Created May 13, 2014 18:13
WordPress script for doing a .csv export of misc data
<?php
function bbg_csv_export() {
if ( ! is_super_admin() ) {
return;
}
if ( ! isset( $_GET['bbg_export'] ) ) {
return;
}
@bgallagh3r
bgallagh3r / wp.sh
Last active March 24, 2024 03:12
Wordpress: Bash Install Script -- Downloads latest WP version, updates wp-config with user supplied DB name, username and password, creates and CHMOD's uploads dir, copies all the files into the root dir you run the script from, then deletes itself!
#!/bin/bash -e
clear
echo "============================================"
echo "WordPress Install Script"
echo "============================================"
echo "Database Name: "
read -e dbname
echo "Database User: "
read -e dbuser
echo "Database Password: "
@dongilbert
dongilbert / wp-shell-install.sh
Created May 2, 2011 15:27
Auto Install Latest WordPress from Shell
#!/bin/bash
# Install script for Latest WordPress by Johnathan Williamson - extended by Don Gilbert
# Disclaimer: It might not bloody work
# Disclaimer 2: I'm not responsible for any screwups ... :)
# DB Variables
echo "MySQL Host:"
read mysqlhost
export mysqlhost