Skip to content

Instantly share code, notes, and snippets.

View slemarchand's full-sized avatar

Sébastien Le Marchand slemarchand

View GitHub Profile
@skanjo
skanjo / install-oracle-jdk-centos.md
Last active June 21, 2018 18:35
Install Oracle JDK on CentOS

Install Oracle Java 8 JDK

Note: If you would like to install a different release of Oracle Java 8 JDK, go to the Oracle Java 8 JDK Downloads Page, accept the license agreement, and copy the download link of the appropriate Linux .rpm package. Substitute the copied download link in place of the highlighted part of the wget command.

Change to your home directory and download the Oracle Java 8 JDK RPM with these commands:

cd ~
wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u72-b15/jdk-8u72-linux-x64.rpm"

Then install the RPM with this yum command (if you downloaded a different release, substitute the filename here):

@atouchard
atouchard / varnish-install.sh
Last active September 29, 2021 16:16
Install Varnish on MacOSX via Homebrew
#!/bin/sh
#
# Install Varnish via Homebrew
#
# You need to add /usr/local/sbin in your PATH
# vcl files are in /usr/local/etc/varnish
#
# Usage :
@pavelfomin
pavelfomin / liferay-web-content-request-parameters.ftl
Last active January 22, 2022 14:35
Get the http request parameters in Liferay from the freemarker web content template
<#--
The request here is not the original request and doesn't contain the url query parameters
hence the usage of the serviceContext from ServiceContextThreadLocal.
-->
<#assign serviceContext = staticUtil["com.liferay.portal.service.ServiceContextThreadLocal"].getServiceContext()>
<#assign httpServletRequest = serviceContext.getRequest()>
myparam="${(httpServletRequest.getParameter('myparam')?html)!''}"
@ismailmechbal
ismailmechbal / sketch-never-ending.md
Last active January 28, 2022 04:23
Modify Sketch to never ending trial

###Sketch trial non stop

Open hosts files:

$ open /private/etc/hosts

Edit the file adding:

127.0.0.1 backend.bohemiancoding.com

127.0.0.1 bohemiancoding.sketch.analytics.s3-website-us-east-1.amazonaws.com

@rodneyrehm
rodneyrehm / gist:40e7946c0cff68a31cea
Last active November 7, 2022 09:11
Diagrams for Documentation

some tools for diagrams in software documentation

Diagrams For Documentation

Obvious Choices

ASCII

@ambrinchaudhary
ambrinchaudhary / DLTableFDSView.java
Created April 12, 2023 07:48
POC - Use of Frontend DataSet in D&M
package com.liferay.document.library.web.internal.frontend.data.set.view;
import com.liferay.frontend.data.set.view.FDSView;
import com.liferay.frontend.data.set.view.table.BaseTableFDSView;
import com.liferay.frontend.data.set.view.table.FDSTableSchema;
import com.liferay.frontend.data.set.view.table.FDSTableSchemaBuilder;
import com.liferay.frontend.data.set.view.table.FDSTableSchemaBuilderFactory;
import java.util.Locale;
@pedroblandim
pedroblandim / Envio de email.groovy
Last active October 5, 2023 17:46
Simplify Liferay - Vídeo: Configurando servidor de email
import com.liferay.mail.kernel.model.MailMessage;
import com.liferay.mail.kernel.service.MailServiceUtil;
import javax.mail.internet.InternetAddress;
MailMessage mailMessage = new MailMessage();
mailMessage.setHTMLFormat(true);
mailMessage.setBody("set body here");
mailMessage.setFrom(new InternetAddress("fromAddress","fromName"));
@lgdd
lgdd / search-suggestions.css
Last active December 22, 2023 09:35
Liferay DXP - Search Suggestions
.search-bar-suggestions-dropdown-menu.dropdown-menu {
border-radius: 0;
border-width: 1px;
box-shadow: 0;
}
.search-bar-suggestions-dropdown-menu
.search-bar-suggestions-results-list
.dropdown-subheader {
color: var(--color-brand-primary);
Install s3fs on Mac OS X
1 - Install Homebrew - http://brew.sh/
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
2 - Use Homebrew to install s3fs + dependencies
brew install s3fs
3 - Do some custom stuff. I only used the first step from here -> https://gist.github.com/fukayatsu/3910097
sudo /bin/cp -rfX /usr/local/Cellar/fuse4x-kext/0.9.2/Library/Extensions/fuse4x.kext /Library/Extensions
@DanHerbert
DanHerbert / fix-homebrew-npm.md
Last active February 12, 2024 17:18
Instructions on how to fix npm if you've installed Node through Homebrew on Mac OS X or Linuxbrew

OBSOLETE

This entire guide is based on an old version of Homebrew/Node and no longer applies. It was only ever intended to fix a specific error message which has since been fixed. I've kept it here for historical purposes, but it should no longer be used. Homebrew maintainers have fixed things and the options mentioned don't exist and won't work.

I still believe it is better to manually install npm separately since having a generic package manager maintain another package manager is a bad idea, but the instructions below don't explain how to do that.

Fixing npm On Mac OS X for Homebrew Users

Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.