Skip to content

Instantly share code, notes, and snippets.

Avatar

Cedric L CedricL46

View GitHub Profile
View azure-Simple-Maven-build-pipelines-example.yml
# Maven package Java
# Build your Java project
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/java
trigger:
- master
variables:
# Agent VM image name
View DisplayDifferentMenuIfUserIsLoggedIn_Wordpress.php
<?php
//Add the following in your custom plugin code
//Note: if you prefer to add it in the function.php remove the array : add_filter('wp_nav_menu_args', 'display_custom_menu');
add_filter('wp_nav_menu_args', array($this,'display_custom_menu'));
/**
* Filter menu to display
* logged-in menu if user is logged in
* logged-in-admin menu if user is logged in and is an Administrator
* logged-out menu if visitor isn't logged in
View updateWordpressFromCommandLine.sh
#Your First need to install wordpress cli as describe : https://wp-cli.org/
#Try running
wp help
#and if you get an error run the following :
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
php wp-cli.phar --info
#Should display system informations
#If there is no errors make it executable and move it to path :
chmod +x wp-cli.phar
View UploadLocalFolderContentToAwsS3.php
<?php
// Include AWS php sdk that you can download here : https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/getting-started_installation.html
require 'aws/aws-autoloader.php';
use Aws\S3\S3Client;
use Aws\S3\Exception\S3Exception;
// Initialize your S3 connection.
// To generate your YOUR_IAM_USER_KEY and YOUR_IAM_USER_SECRET create and Aws IAM user with the S3FullAccess Role
// to do so follow : https://docs.aws.amazon.com/IAM/latest/UserGuide/id_users_create.html
View HowToSetJsfAttributeValueProgrammaticallyInOracleADF.java
//There is multiple way to programmatically set a value of a view attribute in Oracle ADF :
// 1. The JSF way using the highly recommended JSFUtils.java library function :
/**
* Method for setting a new object into a JSF managed bean
* Note: will fail silently if the supplied object does
* not match the type of the managed bean.
* @param expression EL expression
* @param newValue new value to set
View HowToCommitIteratorProgramaticallyInOracleADF.java
public static ViewObjectImpl getViewObjectFromIterator(String nomIterator) {
ViewObjectImpl returnVO = null;
DCBindingContainer dcb = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
if (dcb != null) {
DCIteratorBinding iter = dcb.findIteratorBinding(nomIterator);
if (iter != null) {
returnVO = (ViewObjectImpl)iter.getViewObject();
}
}
return returnVO;
View ConfigureJdeveloperToTrustAnSSLCertificate.bash
# This kind of error when calling an https url in Jdeveloper
# means that you need to add it's SSL certificate to Jdeveloper trusted keystore :
# sun.security.validator.ValidatorException: PKIX path building failed:sun.security.provider.certpath.SunCertPathBuilderException:
# unable to find validcertification path to requested target
# To fix this :
# 1) Download the SSL certificate from the https url.
# 1.a) go to the url
# 1.b) click on the padlock next to the url in your web browser
# 1.c) click the certificate button
View MigrateSvnProjectToCompanyGitlabGit.sh
#Once your local git can communicate with the gitlab server you can start migrating:
#Inspired from https://john.albin.net/git/convert-subversion-to-git
#First got to your gitlab and add a new project (in this tuto : YOUR_GITLAB_REPO.git)
#check out your svn project, right click in it and run git bash here to run the following command :
#Download all author commit data to update it to Git standard:
svn log -q | awk -F '|' '/^r/ {sub("^ ", "", $2); sub(" $", "", $2); print $2" = "$2" <"$2">"}' | sort -u > authors-transform.txt
#update the authors-transform.txt file with the git format e.g:
View ConfigureLocalGitToConnectWithCompanyGitLab.sh
#Up to date doc can be found on https://gitlab.com/help/ssh/README#generating-a-new-ssh-key-pair
#First configure your local git configuration so it can communicate with your gitlab server :
# If you're on windows install git bash for windows if not install git
# This time i'm on windows so :
#Open a git bash command terminal (right click into any folder + git bash here)
#Generate a new ED25519 SSH key pair
#(as a best practice we should always prefer ED25519 to old rsa format)
View retreiveValueOfAnAdfBindingProgrammatically.java
//Here is how to simply retreive the value of and ADF Binding from the view El Expression :
//Below is a view example with values taken from an ADF View Object
<af:inputText id="it1" autoSubmit="true" value="#{bindings.YOUR_VO.YOUR_VO_ATTRIBUTE.inputValue}" />
<af:table value="#{bindings.YOUR_VO.collectionModel}" var="row">
<af:column sortProperty="#{bindings.YOUR_VO.hints.YOUR_VO_ATTRIBUTE.name}"
id="c1">
<af:outputText value="#{row.YOUR_VO_ATTRIBUTE}" id="ot1"/>
</af:column>
</af:table>
You can’t perform that action at this time.