Skip to content

Instantly share code, notes, and snippets.

View lcube45's full-sized avatar
🏌️‍♂️
Focusing

lcube lcube45

🏌️‍♂️
Focusing
View GitHub Profile
@lcube45
lcube45 / gist:9e3464c1db17088656ca9ed9faff97ce
Created January 13, 2023 14:13
Switch Java version (Ubuntu)
sudo update-alternatives --config java
@lcube45
lcube45 / gist:a218b072c1f6f0a74ed99175e90b6ef6
Created December 6, 2022 15:57
Count lines of code recursively
find . -name '*.ts' | xargs wc -l
docker run \
--rm \
-v "$(pwd):/usr/src" \
sonarsource/sonar-scanner-cli \
-Dsonar.projectKey=<project-key> \
-Dsonar.sources=<folder-to-scan> \
-Dsonar.host.url=<sonarqube-dns> \
-Dsonar.login=<sonarqube-token>
@lcube45
lcube45 / gist:a68ed815015982656b261f6667dc2f37
Created July 4, 2022 10:47
Decode a certificate with openssl
openssl x509 -in path/to/certificate -text -noout
@lcube45
lcube45 / ContactForm-basic.php
Created May 11, 2022 16:03 — forked from WengerK/ContactForm-basic.php
Drupal 8 — Inline validation in forms
<?php
/**
* @file
* Contains \Drupal\my_contact\Form\ContactForm.
*/
namespace Drupal\my_contact\Form;
use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;
@lcube45
lcube45 / php-docker-ext
Created May 11, 2022 12:03 — forked from hoandang/php-docker-ext
Complete list of php docker ext
RUN apt update
RUN apt upgrade -y
RUN apt install -y apt-utils
RUN a2enmod rewrite
RUN apt install -y libmcrypt-dev
RUN docker-php-ext-install mcrypt
RUN apt install -y libicu-dev
RUN docker-php-ext-install -j$(nproc) intl
RUN apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng12-dev
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/
@lcube45
lcube45 / webpack.config.js
Created May 11, 2022 07:26
Webpack basic SASS setup
// set compiled css filename
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
// clean dist folder before each build
const { CleanWebpackPlugin } = require('clean-webpack-plugin')
// remove unwanted index.js generated by webpack
const FixStyleOnlyEntriesPlugin = require('webpack-fix-style-only-entries')
const mode = process.env.NODE_ENV === 'production' ? 'production' : 'development'
const toCompile = {
// update to composer v2
composer selfupdate --2
// rollback if you want
composer self-update --rollback
sudo lsof -iTCP -sTCP:LISTEN -n -P
@lcube45
lcube45 / gist:c0dbd11eed052377cd188c49945e6901
Last active April 20, 2022 17:04
Drupal 9 composer update
composer update "drupal/core-*" --with-dependencies