Skip to content

Instantly share code, notes, and snippets.

View manh-dan's full-sized avatar
🎯
Focusing

Huynh Manh Dan manh-dan

🎯
Focusing
View GitHub Profile
@manh-dan
manh-dan / demo_tinymce.html
Created August 29, 2022 01:32 — forked from mtvbrianking/demo_tinymce.html
Dynamically add and remove Tinymce 4.x
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Dynamically add and remove Tinymce 4</title>
<link rel="stylesheet" href="bootstrap.min.css" type="text/css" media="all">
</head>
<body>
<div class="container">

Compile NGINX with RTMP and setup Multi-Streaming

These Scripts will install NGINX with the RTMP Module in the usual directories similar to installation with apt-get.

The RTMP-Server you get with this can then be used to do one ore more of the following:

  • deliver streams in a local network
  • deliver streams to websites similar to youtube
  • transcode rtmp streams to hls video
  • publish to multiple streaming providers
  • record livestreams to a harddrive
@manh-dan
manh-dan / sendPush.txt
Created April 5, 2022 12:44 — forked from valfer/sendPush.txt
Sending Push Notification with HTTP2 (and PHP) see entire post at: http://coding.tabasoft.it/ios/sending-push-notification-with-http2-and-php/
<?php
/**
* @param $http2ch the curl connection
* @param $http2_server the Apple server url
* @param $apple_cert the path to the certificate
* @param $app_bundle_id the app bundle id
* @param $message the payload to send (JSON)
* @param $token the token of the device
* @return mixed the status code (see https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/APNsProviderAPI.html#//apple_ref/doc/uid/TP40008194-CH101-SW18)
@manh-dan
manh-dan / nginx.conf
Created October 2, 2021 14:22 — forked from Asjas/nginx.conf
Nginx sample config. Includes CSP headers, caching headers, gzip and brotli compression
user www-data;
worker_processes auto;
worker_rlimit_nofile 8192;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 8000;
}
@manh-dan
manh-dan / laravel-query-many-to-many-relationship.md
Created August 23, 2021 04:00 — forked from aquasmit/laravel-query-many-to-many-relationship.md
Laravel - Eloquent - query many to many relationship

Laravel - Eloquent - query many to many relationship

Example:

Table 1: posts

Table 2: categories

Pivot Table: category_post with foreign keys category_id, post_id

@manh-dan
manh-dan / form.html
Created August 17, 2021 02:13 — forked from runspired/form.html
How to turn off password and email/username autocomplete.
<!--
<form autocomplete="off"> will turn off autocomplete for the form in most browsers
except for username/email/password fields
-->
<form autocomplete="off">
<!-- fake fields are a workaround for chrome/opera autofill getting the wrong fields -->
<input id="username" style="display:none" type="text" name="fakeusernameremembered">
<input id="password" style="display:none" type="password" name="fakepasswordremembered">
@manh-dan
manh-dan / Install.md
Created July 12, 2021 01:00 — forked from juyal-ahmed/Install.md
Installing and Configuring ImageMagick on Xampp

#Steps to Install

  1. Download and Install ImageMagick http://imagemagick.org/script/binary-releases.php#windows
  2. Visit ImageMagic installation directory and module/coders copy all files and past on D:\xampp\apache\bin
  3. Download Binary https://pecl.php.net/package/imagick/3.4.0RC5/windows php 5.6 TS one according to phpinfo Architecture if it is x86/x64
  4. Exatract and copy php_imagick.dll to D:\xampp\php\ext
  5. Add php_imagick.dll on php.ini
  6. Copy 8 CORE_*.dll to D:\xampp\apache\bin
  7. Restart Apache
  8. done and visit phpinfo
@manh-dan
manh-dan / laravel setup.sh
Created June 14, 2021 03:53 — forked from rolandstarke/laravel setup.sh
Server setup bash script for Laravel
# Ubuntu 18.04 LTS Server Setup for Laravel
# Login as root user
sudo su -
# Update list of available packages
apt update
@manh-dan
manh-dan / js-nl2br-br2nl.md
Created June 14, 2021 03:49 — forked from yidas/js-nl2br-br2nl.md
JavaScript nl2br & br2nl functions

JavaScript nl2br & br2nl functions

The exchange of new line & br HTML tag could refer to PHP - nl2br() function, which uses to inserts HTML line breaks before all newlines in a string.

These JavaScript functions consider whether to use insert or replace to handle the swap.

nl2br

@manh-dan
manh-dan / laravel-queue.service
Created May 5, 2021 06:37 — forked from thomasjsn/laravel-queue.service
Laravel queue worker using systemd.
# Laravel queue worker using systemd
# ----------------------------------
#
# /lib/systemd/system/queue.service
#
# run this command to enable service:
# systemctl enable queue.service
[Unit]
Description=Laravel queue worker