Skip to content

Instantly share code, notes, and snippets.

View keithpotter21's full-sized avatar

keithpotter21 keithpotter21

View GitHub Profile
@keithpotter21
keithpotter21 / drupal7_delete_expired_content_v1.php
Created March 4, 2019 21:13
Ways to select nodes from Drupal 7
<?php
error_reporting(0);
ini_set('display_errors', 'Off');
ini_set('display_startup_errors', 'Off');
//Bootstrap Drupal
chdir(getcwd() . '/../');
define('DRUPAL_ROOT', getcwd());
require_once(DRUPAL_ROOT . '/includes/bootstrap.inc');
drupal_override_server_variables();
@keithpotter21
keithpotter21 / test.js
Created May 18, 2018 05:16
Setup selenium-webdriver with chrome options to change download directory.
var webdriver = require('selenium-webdriver'),
chromeDriver = require('selenium-webdriver/chrome'),
By = require('selenium-webdriver').By,
until = require('selenium-webdriver').until;
var options = new chromeDriver.Options();
options.addArguments('start-maximized');
options.addArguments('incognito');
options.setUserPreferences({'download.default_directory' : '/path/to/your/download/directory'});
@keithpotter21
keithpotter21 / mysql_migration.sh
Last active March 10, 2017 17:14
Bash script to migrate a mysql database from a production server to a local database.
#/bin/sh
#
# Script to migrate databases from prod
#
REMOTE_HOST=<your-remote-hostname>
REMOTE_USER=<your-remote-username>
# get remote password