Skip to content

Instantly share code, notes, and snippets.

View brunobasto's full-sized avatar

Bruno Basto brunobasto

  • Automattic
  • Recife, PE, Brazil
  • X @bbasto
View GitHub Profile
import { ORG_ROLES, APP_ROLES } from './src/utils/acl';
const all: { [key: string]: { appRole?: string, orgRole: string } } = {};
for ( const role of Object.keys(ORG_ROLES) ) {
const permissions = ORG_ROLES[role].permissions;
for ( const permission of permissions ) {
const shortName = permission.replace('apps:environments:', '').replace('apps:', '');
const roleName = `Org ${role}`;
<!DOCTYPE html>
<html amp lang="en-US" data-ampdevmode="" i-amphtml-layout="" i-amphtml-no-boilerplate="" transformed="self;v=1">
<head>
<meta charset="utf-8">
<style amp-runtime="" i-amphtml-version="012103261048002">
html {
overflow-x: hidden !important
}
@brunobasto
brunobasto / Commerce Dataset Display Usage.json
Created May 26, 2020 19:52
Usages of <commerce-ui:dataset-display in Liferay DXP
{
"modules": {
"Liferay Commerce Account Web": {
"files": {
"/Users/brunobalbuquerque/Projects/liferay-portal-ee/modules/apps/commerce/commerce-account-web/src/main/resources/META-INF/resources/view_account_addresses.jsp": {
"total": 1
},
"/Users/brunobalbuquerque/Projects/liferay-portal-ee/modules/apps/commerce/commerce-account-web/src/main/resources/META-INF/resources/view_account_info.jsp": {
"total": 1
},
@brunobasto
brunobasto / Search Container Usage.json
Last active May 26, 2020 17:24
Usages of <liferay-ui:search-container and derivatives (search-container-row and etc) in Liferay DXP
{
"modules": {
"Liferay Account Admin Web": {
"files": {
"/Users/brunobalbuquerque/Projects/liferay-portal/modules/apps/account/account-admin-web/src/main/resources/META-INF/resources/account_entries_admin/account_entry/domains.jsp": {
"total": 1
},
"/Users/brunobalbuquerque/Projects/liferay-portal/modules/apps/account/account-admin-web/src/main/resources/META-INF/resources/account_entries_admin/account_entry/parent_account_entry.jsp": {
"total": 1
},
<form
action="http://localhost:8080/group/control_panel/manage?p_p_id=com_liferay_configuration_admin_web_portlet_SystemSettingsPortlet&amp;p_p_lifecycle=1&amp;p_p_state=maximized&amp;p_p_mode=view&amp;_com_liferay_configuration_admin_web_portlet_SystemSettingsPortlet_javax.portlet.action=bindConfiguration&amp;p_auth=jzH4Beui"
class="form " data-fm-namespace="_com_liferay_configuration_admin_web_portlet_SystemSettingsPortlet_"
id="_com_liferay_configuration_admin_web_portlet_SystemSettingsPortlet_fm" method="post"
name="_com_liferay_configuration_admin_web_portlet_SystemSettingsPortlet_fm">
<input class="field form-control" id="_com_liferay_configuration_admin_web_portlet_SystemSettingsPortlet_formDate"
name="_com_liferay_configuration_admin_web_portlet_SystemSettingsPortlet_formDate" type="hidden"
value="1562165818009" />
<input class="field form-control" id="_com_liferay_configuration_admin_web_portlet_SystemSettingsPortlet_redirect"
name="_com_liferay_configuration_admi
#include <ESP8266WiFi.h>
#include <ESP8266mDNS.h>
#include <WiFiUdp.h>
#include <ArduinoOTA.h>
#include <ESP8266WebServer.h>
const char *ssid = "VIVO-0B74";
const char *password = "C662100B74";
ESP8266WebServer server (80);

Hey guys! I wanted to give you some updates on the Single Page Application (SPA) feature on Liferay DXP. I've talked to some people and it seems they were under the impression that DXP would render pages faster when SPA was disabled than otherwise. That got me intrigued, because the main purpose of SPA is to make pages render faster and to provide better experiences for our users. So I went on and ran some tests to see what the numbers would say.

First thing I did, was to make sure enabling SPA does not cause the server to respond slower. I didn't think it would since it adds almost no server-side processing overhead. I ran a very simple load test to prove it: I used ApacheBench (version 2.3) on one machine, hitting tomcat on another machine with 100 concurrent users 2000 times. These were my results:

With SPA Enabled: With SPA Enabled

With SPA Disabled: ![With SPA Disabled](https://i.imgur.com/1lXVKDy.png "With SPA Disable

slow

This bash script offers quick shortcuts to simulate slower network connections. It is useful when you need to simulate a wireless network on a Linux network server, especially when you are using a virtual machine guest on your local machine or in the cloud.

slow 3G                   # Slow network on default eth0 down to 3G wireless speeds
slow 3G -l 600ms -p 10%   # slow network on eth0 and setup latency to 600ms packetloss to 10%
slow reset                # Reset connection for default eth0 to normal
slow vsat --latency=500ms # Simulate satellite internet  with a high latency

slow dsl -b 1mbps # Simulate DSL with a slower speed than the default

Dec 27, 2016 5:37:09 PM org.apache.jasper.compiler.Compiler generateClass
SEVERE: Error compiling file: /Users/brunobasto/Projects/bundles/work/com.liferay.journal.web-2.0.0/org/apache/jsp/edit_005farticle_jsp.java
17:37:09,417 ERROR [http-nio-8080-exec-10][PortletRequestDispatcherImpl:261] org.apache.jasper.JasperException: PWC6033: Error in Javac compilation for JSP__PWC6199: Generated servlet error:_Cannot find annotation method 'immediate()' in type 'org.osgi.service.component.annotations.Component': class file for org.osgi.service.component.annotations.Component not found__PWC6199: Generated servlet error:_Cannot find annotation method 'service()' in type 'org.osgi.service.component.annotations.Component'__PWC6199: Generated servlet error:_Cannot find annotation method 'unbind()' in type 'org.osgi.service.component.annotations.Reference': class file for org.osgi.service.component.annotations.Reference not found__PWC6199: Generated servlet error:_Cannot find annotation method 'unbind()' in type 'org.osgi.
/**
* @author Bruno Basto
*/
public class ModalTag extends SoyRendererTag {
@Override
public int doStartTag() {
Map<String, Object> context = new HashMap<String, Object>();
context.put("body", GetterUtil.getString(_body));