Skip to content

Instantly share code, notes, and snippets.

View flashvnn's full-sized avatar

Huynh Khac Thao flashvnn

View GitHub Profile
https://alexshomenetwork.com/linux-desktop-in-browser/
@flashvnn
flashvnn / AmLich.php
Last active September 14, 2023 04:47
AmLich.php
/**
* Thư viện AmLich.
* Example
* $am_lich = new AmLich();
* $al = $am_lich->convertSolar2Lunar(30, 10, 2023, 7.0);
* Ngày: $al[0], Tháng: $al[1], Năm: $al[2]
*/
class AmLich {
public function INT($d) {
@flashvnn
flashvnn / composer.json
Created August 25, 2023 05:16
Drupal ^9.5 patchs
{
"name": "drupal/recommended-project",
"description": "Project template for Drupal 9 projects with a relocated document root",
"type": "project",
"license": "GPL-2.0-or-later",
"homepage": "https://www.drupal.org/project/drupal",
"support": {
"docs": "https://www.drupal.org/docs/user_guide/en/index.html",
"chat": "https://www.drupal.org/node/314178"
},
@flashvnn
flashvnn / ajax_callback_select2_radios.php
Created August 8, 2023 03:41
Ajax callback select2, radios field
<?php
namespace Drupal\nh_phahe\Service;
use Drupal\Component\Utility\NestedArray;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\StringTranslation\StringTranslationTrait;
use Drupal\node\Entity\Node;
/**
@flashvnn
flashvnn / timezone.sh
Last active April 4, 2023 03:41
Webtop timezone update
sudo mv /etc/localtime /etc/localtime.bk
sudo ln -s /usr/share/zoneinfo/Asia/Bangkok /etc/localtime
## install options
sudo apt update
sudo apt install xdg-utils vlc ffmpeg
@flashvnn
flashvnn / wget_curl_ssl_disable.sh
Last active September 13, 2022 09:46
Wget, CURL disable ssl check
# WGET, (Add Last Line to /etc/wgetrc) - check_certificate = off
sudo bash -c "echo 'check_certificate = off' >> /etc/wgetrc"
# CURL, You can add insecure option to your $HOME/.curlrc file:
sudo bash -c "echo 'insecure' >> $HOME/.curlrc"
<?php
namespace Drupal\example\Form;
use Drupal\Core\Form\ConfigFormBase;
use Drupal\Core\Form\FormStateInterface;
/**
* Class AjaxAddMoreForm.
*
@flashvnn
flashvnn / command.sh
Created August 16, 2022 04:48
Command redirect output to log file
|| visible in terminal || visible in file || existing
Syntax || StdOut | StdErr || StdOut | StdErr || file
==========++==========+==========++==========+==========++===========
> || no | yes || yes | no || overwrite
>> || no | yes || yes | no || append
|| | || | ||
2> || yes | no || no | yes || overwrite
2>> || yes | no || no | yes || append
|| | || | ||
&> || no | no || yes | yes || overwrite
@flashvnn
flashvnn / tunnel.example.com.conf
Last active February 7, 2023 13:44
Go http proxy with apache
<VirtualHost 10.0.0.195:80>
ServerAlias *.tunnel.example.com
ProxyPass / http://localhost:7080/
ProxyPassReverse / http://localhost:7080/
UseCanonicalName on
ProxyPreserveHost on
</VirtualHost>
# Support ssl .well-known folder for virtualmin
<VirtualHost *:80>
@flashvnn
flashvnn / index.js
Created June 7, 2022 05:46
Totaljs http2
const spdy = require('spdy');
const fs = require('fs');
require('total4');
// Registers a route
ROUTE('GET /', function() {
// this === Controller
this.json({ message: 'Hello world' });
});