Skip to content

Instantly share code, notes, and snippets.

@saosangmo
saosangmo / php-html-css-js-minifier.php
Created August 27, 2017 16:03 — forked from Rodrigo54/php-html-css-js-minifier.php
PHP Function to Minify HTML, CSS and JavaScript
<?php
/**
* -----------------------------------------------------------------------------------------
* Based on `https://github.com/mecha-cms/mecha-cms/blob/master/system/kernel/converter.php`
* -----------------------------------------------------------------------------------------
*/
// HTML Minifier
function minify_html($input) {
@saosangmo
saosangmo / LICENSE.txt
Created January 7, 2018 18:04 — forked from 140bytes/LICENSE.txt
140byt.es -- Click ↑↑ fork ↑↑ to play!
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@saosangmo
saosangmo / install-php7.2-mcrypt.sh
Created April 7, 2018 16:50 — forked from arzzen/install-php7.2-mcrypt.sh
Install PHP 7.2 MCrypt extension
#
# Check version php and pecl
#
php -v # if default php is not 7.2 then use /usr/bin/php7.2 instead php
pecl version
#
# Install mcrypt extension
# see http://pecl.php.net/package-info.php?package=mcrypt&version=1.0.1
#
@saosangmo
saosangmo / cdn-nginx.conf
Created October 24, 2018 16:52 — forked from alsyundawy/cdn-nginx.conf
Nginx CDN Server Configuration
server {
listen 80;
server_name cdn.domain.org;
root /usr/share/nginx/cdn
location / {
proxy_pass http://domain.org;
proxy_set_header Host $host;
proxy_set_header True-Client-IP $remote_addr;
@saosangmo
saosangmo / popup.html
Created April 5, 2019 18:24 — forked from Moollihawkja/popup.html
Creating a pop up in pure javascript
<!DOCTYPE html>
<html>
<head>
<style>
.popup {
position: fixed;
top: 50vh;
left: 50%;
width:400px;
margin-left: -200px;
<script type="application/ld+json">
{ "@context": "https://schema.org",
"@type": "Organization",
"name": "Elite Strategies",
"legalName" : "Elite Strategies Llc",
"url": "http://www.elite-strategies.com",
"logo": "http://cdn.elite-strategies.com/wp-content/uploads/2013/04/elitestrategies.png",
"foundingDate": "2009",
"founders": [
{
@saosangmo
saosangmo / create_php_site.sh
Created January 30, 2020 14:54 — forked from allebb/create_php_site.sh
Nginx and PHP-FPM, bash script for creating new vhost’s under separate fpm pools
#!/bin/bash
# @author: Seb Dangerfield
# http://www.sebdangerfield.me.uk/?p=513
# Created: 11/08/2011
# Modified: 07/01/2012
# Modified: 17/05/2012
# Modify the following to match your system
NGINX_CONFIG='/etc/nginx/sites-available'
NGINX_SITES_ENABLED='/etc/nginx/sites-enabled'
@saosangmo
saosangmo / nginx.conf
Created February 10, 2020 16:11 — forked from Stanback/nginx.conf
Example Nginx configuration for adding cross-origin resource sharing (CORS) support to reverse proxied APIs
#
# CORS header support
#
# One way to use this is by placing it into a file called "cors_support"
# under your Nginx configuration directory and placing the following
# statement inside your **location** block(s):
#
# include cors_support;
#
# As of Nginx 1.7.5, add_header supports an "always" parameter which
@saosangmo
saosangmo / 186_backlink_google_search
Created March 18, 2021 10:06
Cách kiếm 186 backlink xịn từ Google
/**
* Summernote StripTags
*
* This is a plugin for Summernote (www.summernote.org) WYSIWYG editor.
* To strip unwanted HTML tags and attributes while pasting content in editor.
*
* @author Hitesh Aggarwal, Extenzine
*
*/