Skip to content

Instantly share code, notes, and snippets.

View vihoangson's full-sized avatar

Vi Hoàng Sơn vihoangson

View GitHub Profile
@vihoangson
vihoangson / gist:6d268a1699c2cb2db8a7d57cfdc30afb
Last active July 24, 2023 03:38
Cấu hình docker-compose.yml cài đặt phpbb
version: '2'
services:
mariadb:
restart: always
image: docker.io/bitnami/mariadb:10.6
environment:
# ALLOW_EMPTY_PASSWORD is recommended only for development.
- ALLOW_EMPTY_PASSWORD=yes
- MARIADB_USER=bn_phpbb
- MARIADB_DATABASE=bitnami_phpbb
const mysql = require('C:/Users/Admin/AppData/Roaming/npm/node_modules/mysql');
console.log(mysql);
var con = mysql.createConnection({
host: "localhost",
user: "root",
password: "",
database : 'lampart'
});
con.query('select * from lp_users',(error, results, fields)=>{
console.log(results[0].user_login);
const redis = require("redis");
const express = require("express");
console.log(redis);
const port_redis = 6379;
const redis_client = redis.createClient(port_redis);
const app = express()
var io = require('socket.io-client') ;
// Vào một ngày đẹp trời tôi có nhã hứng muốn chọn file và hiện thị preview lên giao diện ngay lập tức. Sau đây là code thực hiện.
<img>
<input type="file">
<script
src="https://code.jquery.com/jquery-3.4.1.js"
integrity="sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU="
crossorigin="anonymous"></script>
<script>
$("input[type=file]").on('change', function () {
var preview = document.querySelector('img'); // Image reference
@vihoangson
vihoangson / GetParamsLinks.php
Last active December 25, 2019 01:43
Bài này dành cho anh Tâm
<video id="my_video" autoplay="" loop="" muted="" style="margin-top: -45px; opacity: 1;">
<source src="http://shop1.wds.com.vn/wp-content/themes/pshop01/images/video.mp4" type="video/mp4">
</video>
const WebSocket = require('ws');
const https = require('https');
const request = require('request');
const wss = new WebSocket.Server({ port: 8686 });
wss.broadcast = function broadcast(data) {
wss.clients.forEach(function each(client) {
```php
<?php
namespace App\Libs;
/**
HTU:
define('KEY_CHATWORK', '');
$cw = new \App\Libs\ChatworkLib;
$cw->setRoomId('119727315');
$cw->setMsg($e->getMessage());
```
$("#issue_tree").before("<input class='jobtype' type='checkbox' data-color='true' id='div_coloring'><label for='div_coloring'>Coloring</label>");
$("#issue_tree").before("<input class='jobtype_hideall' type='button' data-ele='HideAll' id='div_9' value='HideAll'>");
$("#issue_tree").before("<input class='jobtype_hideallother' type='button' data-ele='HideAll' id='div_9' value='HideAll other'>");
$("#issue_tree").before("<input class='jobtype_remove' type='checkbox' data-ele='Closed' id='div_1'><label for='div_1'>Closed</label>");
$("#issue_tree").before("<input class='jobtype_remove' type='checkbox' data-ele='In Progress' id='div_2'><label for='div_2'>In Progress</label>");
$("#issue_tree").before("<input class='jobtype_remove' type='checkbox' data-ele='Paused' id='div_3'><label for='div_3'>Paused</label>");
@vihoangson
vihoangson / gist:7037d7776039e69aeebbd97b674c4828
Created January 20, 2019 05:09
sh get all file name in disk
now=$(date +%Y%m%d_%H%M%S)
find . > Logs/filename_$now.txt
cp Logs/filename_$now.txt 'Transcend - green.txt'