Skip to content

Instantly share code, notes, and snippets.

@mhrubel
mhrubel / Full Apache2, Multi PHP & MariaDB - Web Server on Ubuntu 18.04 or later
Last active September 23, 2023 19:58
Full Installation and Configuration of Apache2, Multiple PHP, MariaDB, phpMyAdmin, LetsEncrypt, HTTP/2, IonCube, Postfix, Dovecot, SPF, DKIM, Roundcube Webmail and Files Permission Commands on Ubuntu 18.04 and 18.10 Web Server
Complete Installation and Configuration of Apache2, Multiple PHP, MariaDB, phpMyAdmin, LetsEncrypt,
HTTP/2, IonCube, Postfix, Dovecot, SPF, DKIM, Roundcube Webmail and
Files Permission Commands on Ubuntu 18.04 and 18.10 Web Server
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
This is a complete Ubuntu Linux based web server for Website, PHP, SSL, TLS, Database and Email hosting purpose.
Built with the below components for good performance. Also, I tried to make it as secure as possible.
@rodrigopolo
rodrigopolo / CUIValidation.js
Created January 19, 2019 07:55
Simple and more elaborated Guatemalan CUI validation
// Simple
function valCUI(cui){
var nd, v, t=0, dl, dn = [17,8,16,16,13,14,19,8,24,20,9,29,32,22,8,17,12,5,10,11,7,17];
if(nd = /^(\d{8})(\d{1})(\d{2})(\d{2})$/.exec(cui.replace(/\D/g,''))){
v = parseInt(nd[2]);
for (var i = 0; i < nd[1].length; i++){
t += nd[1][i] * (i + 2);
}
if((t % 11) === v){
if(dl=dn[nd[3]-1]){
@jsn789
jsn789 / add-gtm-wp.php
Last active September 4, 2024 13:38
Add Google Tag Manager through functions.php in WordPress
/* Add Google Tag Manager javascript code as close to
the opening <head> tag as possible
=====================================================*/
function add_gtm_head(){
?>
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
@zenorocha
zenorocha / basic.md
Last active March 26, 2023 09:00
New Firebase Auth vs Old Firebase Auth
@willyg302
willyg302 / .lambda.yml
Last active August 11, 2023 06:39
A Lambda function for AES encryption/decryption, from a Gist!
config:
FunctionName: aws-lambda-aes-gist
Handler: index.handler
Runtime: nodejs
Description: A Lambda function for AES encryption/decryption, from a Gist!
install: npm install --production
@cferdinandi
cferdinandi / stop-video.js
Last active September 5, 2024 19:41
A simple method to stop YouTube, Vimeo, and HTML5 videos from playing.
/**
* Stop an iframe or HTML5 <video> from playing
* @param {Element} element The element that contains the video
*/
var stopVideo = function ( element ) {
var iframe = element.querySelector( 'iframe');
var video = element.querySelector( 'video' );
if ( iframe ) {
var iframeSrc = iframe.src;
iframe.src = iframeSrc;
@danharper
danharper / background.js
Last active August 23, 2024 01:26
Bare minimum Chrome extension to inject a JS file into the given page when you click on the browser action icon. The script then inserts a new div into the DOM.
// this is the background code...
// listen for our browerAction to be clicked
chrome.browserAction.onClicked.addListener(function (tab) {
// for the current tab, inject the "inject.js" file & execute it
chrome.tabs.executeScript(tab.ib, {
file: 'inject.js'
});
});