How to set up a Headless Selenium Testing environment for CentOS 6.3.
Follow these steps to set up a CentOS 6.3 host to run headless Selenium tests with Firefox.
// To run: node theme.js | |
const fs = require('fs'); | |
const theme = { | |
"settings": { | |
"typography": { | |
"fontSizes": [ | |
// This is a comment. | |
{ | |
"name": "Large", |
<?php | |
if ( ! function_exists( '__return' ) ) { | |
function __return( $return ) { | |
return function() use ( $return ) { | |
return $return; | |
# using .domain to 127.0.0.1 | |
echo 'address=/.domain/127.0.0.1' >> /usr/local/etc/dnsmasq.conf | |
# make sure the file name in /etc/resolver is the same as your domain | |
sudo bash -c 'echo "nameserver 127.0.0.1" > /etc/resolver/domain' | |
# restart dnsmasq | |
sudo brew services restart dnsmasq |
<?php | |
/** | |
* Do the opposite of wpautop | |
* | |
* @param string $s | |
* | |
* @return string | |
*/ | |
public static function reverse_wpautop( $s ) { |
function smtp_mail( $phpmailer ) { | |
// Define that we are sending with SMTP | |
$phpmailer->isSMTP(); | |
// The hostname of the mail server | |
$phpmailer->Host = YOURHOST; | |
// Use SMTP authentication (true|false) | |
$phpmailer->SMTPAuth = true; | |
// SMTP port number normally 25 | |
$phpmailer->Port = '25'; | |
// Username to use for SMTP authentication |
#!/usr/bin/env bash | |
function BEFORE_PS1 { | |
printf "\e[32m[\e[0m$(whoami)\e[32m]@[\e[0mlocal\e[32m][\e[0m${PWD/#$HOME/~}\e[32m]$(gitPS1)\e[0m" | |
} |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteCond %{REQUEST_FILENAME} !-f [NC] | |
RewriteRule ^(.*\.(png|gif|jpg|jpeg)) http://example.com/$1 [NC,P,L] | |
</IfModule> |
# Download from wordpress.org repository into your plugins folder | |
# https://wordpress.org/plugins/elasticpress/ | |
# Make sure you have wp-cli installed (otherwise it won't work) http://wp-cli.org/ | |
# Add config line to wp-config.php: | |
# define( 'EP_HOST', 'http://127.0.0.1:9200' ); | |
# In your docroot (WordPress root folder) | |
wp plugin activate elasticpress --network |
# Install on ubuntu trusty tahr 14.04 | |
# I do this with root user, but if you sudo access with your user it will work too! | |
sudo su | |
# Update apt-get | |
apt-get update | |
# Install java jdk 7 or java jdk 8 or oracle jdk | |
apt-get install openjdk-7-jre-headless | |
# Make sure java is installed | |
java -version | |
# This should output: java version "1.7.XX" |