Skip to content

Instantly share code, notes, and snippets.

@loulou2u
loulou2u / pom.xml
Last active August 7, 2016 19:17
Selenium basic maven pom.ml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.loulou2u</groupId>
<artifactId>testsuite</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>Selenium Testsuite</name>
<description>A selenium test setup with a collection of tests using Selenium Webdriver 3.0.0-beta release.</description>
<!-- properties -->
<properties>
<?php
$_LW->REGISTERED_APPS['resize_summary'] = array(
'title' => 'Resize Summary',
'handlers' => array('onOutputRSS'),
'custom' => array(
'always_truncate'=>false, // always truncate, or require /truncate/1?
'fields_to_shorten'=>array( // fields to shorten, and the maximum number of words for that field
'description'=>30
)
)
// JS functionality for a redundant checkbox above the group suggest selector box, providing a checkbox for users to select to a specific chosen group (like the homepage or main communications team).
(function($, LW) {
// Make adjustments below to match the group id and group name
// to the calendar group you want to use for this feature.
var group_id = '8';
var group_name = 'Homepage';
if (LW.page === 'events_edit' || LW.page === 'events_sub_edit' || LW.page === 'news_edit') { // define pages to target with this transformation
<?php
// PHP functionality for a redundant checkbox above the group suggest selector box, providing a shortcut for users to suggest to a specific chosen group (like the homepage or main communications team).
$_LW->REGISTERED_APPS['suggest_to']=array(
'title'=>'suggest_to',
'handlers'=>array('onLoad','onOutput'),
'custom'=>array(
'label'=>'Suggest to main calendar' // Customize checkbox label as appropriate
<?php
$_LW->REGISTERED_APPS['public_notifier']=array(
'title'=>'PublicNotifier',
'handlers' => array('onAfterPublicSubmission')
);
class LiveWhaleApplicationPublicNotifier {
// These two arrays are for including the users and/or groups that
@loulou2u
loulou2u / content-events-inline-list.php
Created May 27, 2015 19:38
The PHP code that constructs the actual widget code that pulls events from LWC
<?php
/**
* The template used for displaying an inline list of events. Used in side columns on landing page templates, mostly.
*
*
* @package bsu2014
*/
if( get_field('show_event_list') ) :
@loulou2u
loulou2u / gist:c9363ba8ad8d83f9e484
Last active August 29, 2015 14:22
Code generated by Advanced Custom Fields plugin at add custom fields to page/post editors
// Calendar (3 events): Show three LiveWhale Calendar events in a horizontal row
// Below is the resulting code, which you can roll into the master functions.php if you want it to apply to all themes in a multisite site.
register_field_group(array (
'id' => 'acf_calendar-3-events',
'title' => 'Calendar (3 events)',
'fields' => array (
array (
'key' => 'field_53d14e3d55dba',
'label' => 'Show events?',
@loulou2u
loulou2u / public.application.resize_images.php
Last active August 29, 2015 14:21
Resizing RSS images
<?php
$_LW->REGISTERED_APPS['resize_images'] = array( // configure this application module
'title' => 'Resize Images',
'handlers' => array('onLoad')
);
class LiveWhaleApplicationResizeImages {
public function onLoad() { // on frontend request
@loulou2u
loulou2u / .htaccess
Created May 15, 2015 17:11
.htaccess file to determine SECURED URI
SetEnvIfNoCase Request_URI "^/authenticated-directory/*" SECURED
# enforce auth if SECURED=1
AuthType Basic
AuthName "Login Required"
AuthUserFile /path/to/.htpasswd
Require valid-user
Order allow,deny
Allow from all
Deny from env=SECURED
@loulou2u
loulou2u / public.application.protect_files.php
Last active August 29, 2015 14:21
Restrict Access to Files
//The custom app below redirects files tagged as "private" to a .htaccess protected directory
<?php
$_LW->REGISTERED_APPS['protect_files']=array(
'title'=>'Protect Files',
'handlers'=>array('onLoad')
);
class LiveWhaleApplicationProtectFiles {