Skip to content

Instantly share code, notes, and snippets.

View stefanomarra's full-sized avatar
🌍
Working from home

Stefano Marra stefanomarra

🌍
Working from home
View GitHub Profile
@stefanomarra
stefanomarra / WP Emojics Auto Initialization
Last active April 2, 2020 18:16
This PHP function will auto initialize your Emojics wordpress plugin based on the host. Emojics WP Plugin is needed: https://wordpress.org/plugins/emojics-wp/
/**
* This snippet needs to be added in the functions.php file of your theme
* This function will auto initialize emojics based on the known hosts array defined in the function
* Update $known_hosts array by adding the key => value pair host => api key as shown in the commented example
*/
function emojics_auto_init() {
/**
* Store key value pairs of known hosts as key and api key as value
*/
(function(d, e, id) {
function s() {var js, a = d.getElementsByTagName("script")[0];js = d.createElement("script");js.id = id;js.src = "https://connect.emojics.com/dist/sdk.js";a.parentNode.insertBefore(js, a);}
window.emojics=e;e.readyQueue=[];e.ready=function(b){e.readyQueue.push(b)}
window.attachEvent?window.attachEvent("onload",s):window.addEventListener("load",s)
})(document, window.emojics||{}, "emojics-js");
emojics.ready(function() {
console.log('Emojics Ready');
// The following event will fire whenever a visitor clicks on a reaction.
# BEGIN DEFLATE COMPRESSION
<IfModule mod_deflate.c>
# Compress HTML, CSS, JavaScript, Text, XML and fonts
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
AddOutputFilterByType DEFLATE application/x-font
AddOutputFilterByType DEFLATE application/x-font-opentype
AddOutputFilterByType DEFLATE application/x-font-otf
AddOutputFilterByType DEFLATE application/x-font-truetype
@stefanomarra
stefanomarra / LAMP Stack With PHP 5.5
Last active February 20, 2016 15:13 — forked from JeffreyWay/LAMP Stack With PHP 5.5
Stop using MAMP. Here's a laughably simple way to get setup with a LAMP stack with PHP 5.5.
alias lamp="curl -L -o 'install.sh' https://gist.githubusercontent.com/stefanomarra/e0c1437349dfa1703c19/raw/e919d6275bfd5fb8daa47e90712ded1374878a5b/install.sh && curl -L -o 'Vagrantfile' https://gist.githubusercontent.com/stefanomarra/caf2a34a0e0f83f0c280/raw/dc9ce54e13a8e8819e7d574cb2df0fc560b15282/Vagrantfile && vagrant up"
@stefanomarra
stefanomarra / Vagrantfile
Last active February 19, 2016 15:45 — forked from JeffreyWay/Vagrantfile
Quickie vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "precise64"
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
config.vm.network :private_network, ip: "192.168.33.21"
@stefanomarra
stefanomarra / install.sh
Created February 17, 2016 10:41 — forked from JeffreyWay/install.sh
Super-fast LAMP + 5.5 install script.
sudo apt-get update
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password root'
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password root'
sudo apt-get install -y vim curl python-software-properties
sudo add-apt-repository -y ppa:ondrej/php5
sudo apt-get update
sudo apt-get install -y php5 apache2 libapache2-mod-php5 php5-curl php5-gd php5-mcrypt php5-readline mysql-server-5.5 php5-mysql git-core php5-xdebug