Skip to content

Instantly share code, notes, and snippets.

Moving the global installation location for Node.js packages to a directory in your home folder on a MacBook can be a good way to avoid having to use sudo for npm installs. This allows you to manage global packages without needing administrative privileges. Here’s a step-by-step guide to achieve this:

1. Create a New Directory for Global Packages

Open your terminal and run the following command to create a new directory where your global npm packages will be stored:

mkdir ~/.npm-global

2. Configure npm to Use the New Directory

SECTION #0: Introduction and Presentation
=========================================
(use slideshow)
SECTION #1: Creating a "Report Request" portlet plugin
=======================================================
1. Create a new MVC portlet plugin project (in eclipse) called "dev-life-report"
2. Create a new class com.jardineworks.dev.life.liferay.portlet.report.ReportRequestPortlet in the src/main/java folder with the following definition.
@dcfrancisco
dcfrancisco / AutoML_data_preparation_AIA023.ipynb
Created January 29, 2019 17:00 — forked from yufengg/AutoML_data_preparation_AIA023.ipynb
Notebook for preparing a CSV for Google Cloud AutoML Vision
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dcfrancisco
dcfrancisco / SearchCriteria.java
Created May 17, 2017 10:37
mybatis-pagination HOWTO
package com.example.www.form;
import com.google.common.collect.Lists;
import org.crazycake.utils.CamelNameUtils;
import org.mybatis.pagination.dto.datatables.PagingCriteria;
import org.mybatis.pagination.dto.datatables.SearchField;
import org.mybatis.pagination.dto.datatables.SortField;
import java.util.List;
import java.util.Map;
@dcfrancisco
dcfrancisco / main.js
Last active January 18, 2016 11:36 — forked from farmerbradllc/main.js
AUI().ready(
'liferay-hudcrumbs', 'liferay-navigation-interaction', 'liferay-sign-in-modal',
function(A) {
var navigation = A.one('#navigation');
var menu_toggle = navigation.one('#nav_toggle');
if (navigation) {
navigation.plug(Liferay.NavigationInteraction);
#* @vtlvariable name="portletNamespace" type="java.lang.String" *#
#* @vtlvariable name="portal" type="com.liferay.portal.util.Portal" *#
#* @vtlvariable name="getterUtil" type="com.liferay.portal.kernel.util.GetterUtil" *#
#* @vtlvariable name="stringUtil" type="com.liferay.portal.kernel.util.StringUtil" *#
#* @vtlvariable name="max-members" type="com.liferay.portlet.journal.util.TemplateNode" *#
#* @vtlvariable name="team-name" type="com.liferay.portlet.journal.util.TemplateNode" *#
#* @vtlvariable name="section-members" type="com.liferay.portlet.journal.util.TemplateNode" *#
#* @vtlvariable name="groupId" type="java.lang.String" *#
#* @vtlvariable name="sectionMembers" type="java.lang.String" *#
#* @vtlvariable name="locale" type="java.util.Locale" *#
#* @vtlvariable name="portletNamespace" type="java.lang.String" *#
#* @vtlvariable name="portal" type="com.liferay.portal.util.Portal" *#
#* @vtlvariable name="getterUtil" type="com.liferay.portal.kernel.util.GetterUtil" *#
#* @vtlvariable name="stringUtil" type="com.liferay.portal.kernel.util.StringUtil" *#
#* @vtlvariable name="max-members" type="com.liferay.portlet.journal.util.TemplateNode" *#
#* @vtlvariable name="team-name" type="com.liferay.portlet.journal.util.TemplateNode" *#
#* @vtlvariable name="section-members" type="com.liferay.portlet.journal.util.TemplateNode" *#
#* @vtlvariable name="groupId" type="java.lang.String" *#
#* @vtlvariable name="sectionMembers" type="java.lang.String" *#
#* @vtlvariable name="locale" type="java.util.Locale" *#
(function() {
var Dom = YAHOO.util.Dom,
Event = YAHOO.util.Event;
Event.onDOMReady(function() {
var layout = new YAHOO.widget.Layout({
units: [
{ position: 'top', height: 60, body: 'top_pane', gutter: '3px', collapse: true, resize: false },
{ position: 'left', header: 'Search results', width: 200, resize: true, body: 'left_pane', gutter: '3px', collapse: true, close: false, collapseSize: 30, scroll: true, animate: true },
{ position: 'center', body: 'center_pane', gutter: '3px',scroll: true }