Skip to content

Instantly share code, notes, and snippets.

@rotty3000
rotty3000 / description.md
Last active February 2, 2018 00:14
pacl policy process
  1. place the plugin into generate mode:

     security-manager-enabled=generate
    
  2. with no other policy rules in place, the policy for the app will behave as if PACL is enabled (performing expected checks)

  3. however, rather than throwing an error on failed security checks, causing the plugin to fail, the individual checker which caused the failuer will contribute a suggested rule which resolves the failed check

  4. the rules will be collected and writen (on the fly) to a properties file

  5. the default write location is:

${liferay.home}/pacl-policy/${servletContextName}.policy

@annalinneajohansson
annalinneajohansson / plugin-settings.php
Last active February 23, 2023 04:42
A base for a WordPress plugin settings page, using the Settings API #add_options_page #add_action #admin_init #register_setting #add_settings_section
<?php
# http://kovshenin.com/2012/the-wordpress-settings-api/
# http://codex.wordpress.org/Settings_API
add_action( 'admin_menu', 'my_admin_menu' );
function my_admin_menu() {
add_options_page( __('My Plugin Options', 'textdomain' ), __('My Plugin Options', 'textdomain' ), 'manage_options', 'my-plugin', 'my_options_page' );
}
add_action( 'admin_init', 'my_admin_init' );
@davidecavaliere
davidecavaliere / portal-developer.properties
Created August 6, 2013 11:33
Liferay's portal-developer.properties to disable embedded firebug-lite console, javascript and html minifier.place this file in /liferay-portal-{version}/tomcat-{tomcat-version}/webapps/ROOT/WEB-INF/classes/
javascript.log.enabled=false
javascript.fast.load=false
theme.css.fast.load=false
com.liferay.portal.servlet.filters.minifier.MinifierFilter=false
com.liferay.filters.strip.StripFilter=false
layout.template.cache.enabled=false
browser.launcher.url=
@bmvakili
bmvakili / freemarker_variables_wcm
Created January 20, 2015 14:23
liferay 6.2 GA2 web content template freemarker variables available
scopeGroupId
expandoRowLocalService
reserved-article-id
unicodeLanguageUtil
serviceLocator
reserved-article-author-email-address
userGroupPermission
userPermission
staticFieldGetter
Images
@brennanMKE
brennanMKE / hero.ts
Last active July 15, 2024 15:25
Example of Mongoose with TypeScript and MongoDb
import * as mongoose from 'mongoose';
export let Schema = mongoose.Schema;
export let ObjectId = mongoose.Schema.Types.ObjectId;
export let Mixed = mongoose.Schema.Types.Mixed;
export interface IHeroModel extends mongoose.Document {
name: string;
power: string;
@taniarascia
taniarascia / functions.php
Last active February 13, 2024 07:51
Inlcuding custom fields and uploads in a WordPress post
<?php
function create_post_your_post() {
register_post_type( 'your_post',
array(
'labels' => array(
'name' => __( 'Your Post' ),
),
'public' => true,
'hierarchical' => true,
@taniarascia
taniarascia / page.php
Created August 10, 2016 18:09
Displaying all the output from your custom meta box
<?php get_header(); ?>
<?php
$args = array(
'post_type' => 'your_post',
);
$your_loop = new WP_Query( $args ); if ( $your_loop->have_posts() ) : while ( $your_loop->have_posts() ) : $your_loop->the_post();
$meta = get_post_meta( $post->ID, 'your_fields', true ); ?>
@ahmadawais
ahmadawais / flywheel-local-xdebug-vscode.md
Last active June 3, 2024 13:28
Debug WordPress with Visual Studio Code | VSCode WordPress Debug Setup | WordPress xDebug Setup for Local by FlyWheel with VSCode | Part of the VSCode Learning Course → https://VSCode.pro

VSCode WordPress Debugging Setup: WordPress Xdebug Setup for Local by FlyWheel with VSCode


Consider supporting my work by purchasing the course this tutorial is a part of i.e. VSCode Power User

🚅 TL;DR

  • Make sure your Local by FlyWheel WordPress install is a custom install
@mrbar42
mrbar42 / README.md
Last active July 22, 2024 07:54
Secured HLS setup with Nginx as media server

Secured HLS setup with Nginx as media server

This example is part of this article.

This is an example for an HLS delivery with basic security. Nginx compiled with nginx-rtmp-module & secure-link is used as media server. Features:

  • Domain filtering
  • Referrer filtering
  • Embed buster
@jasonbahl
jasonbahl / order-by-acf-like-count.php
Last active July 10, 2024 20:41
Shows how to add a custom order value to a connection to order by a custom field.
add_filter( 'graphql_PostObjectsConnectionOrderbyEnum_values', function( $values ) {
$values['LIKE_COUNT'] = [
'value' => 'like_count',
'description' => __( 'The number of likes on the post', 'wp-graphql' ),
];
return $values;
} );