Skip to content

Instantly share code, notes, and snippets.

View madila's full-sized avatar

Ruben madila

View GitHub Profile
@madila
madila / lazysizes
Created July 4, 2016 11:00
Lazysizes filter for wordpress post thumbnail attachment
<?php
/**
* Created by PhpStorm.
* User: Madila
* Date: 21/06/2016
* Time: 11:58
*/
add_filter('wp_get_attachment_image_attributes', 'lazysizes_data_src', 3);
@madila
madila / parallax.js
Last active August 15, 2016 14:19
Parallax Effect code, smooth scroll on IE and Edge and prefixing of properties via window.appbrowser.prefix.css
/**
* Created by Madila on 15/08/2016.
*/
window.appbrowser = {};
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
/**
* Created by Madila on 05/10/2016.
*/
class Async {
constructor(id) {
this.url = url;
this.id = id;
}
add(url) {
@madila
madila / Laravel PHP7 LEMP AWS.md
Created November 23, 2016 14:25 — forked from santoshachari/Laravel PHP7 LEMP AWS.md
Laravel 5.x on Ubuntu 14.x, PHP 7.x, Nginx 1.9.x

#Steps to install latest Laravel, LEMP on AWS Ubuntu 14.4 version. This tutorial is the improvised verision of this tutorial on Digitalocean based on my experience.

Install PHP 7 on Ubuntu

Run the following commands in sequence.

sudo apt-get install -y language-pack-en-base
sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install zip unzip
@madila
madila / fontFaceLoading.js
Last active April 12, 2017 14:34
Native Font Loading with fallback
/**
* Created by Madila on 12/04/2017.
*/
(function(window){
var assets_url = '/assets/js/';
var fonts = [];
var loSto = {};
try {
// We set up a proxy variable to help with localStorage, e.g. when cookies are disabled
@madila
madila / of-woocommerce-social-sharing.php
Last active April 19, 2018 11:09
OFC Woocommerce Product Social Sharing Drop-In Plugin
<?php
/*
Plugin Name: OFC Sharing Buttons
Description: sharing buttons for content
Version: 0.1
License: GPL
Author: Ruben Madila
Author URI: ollieford.co.uk
*/
@madila
madila / ofc-social-sharing.php
Created April 19, 2018 11:13
OFC Social Sharing Buttons
<?php
/*
Drop In Function for your theme.
Usage in the loop: ofc_social_sharing_buttons(get_the_ID());
*/
function ofc_social_sharing_buttons($id = null) {
global $post;
$id = ($id) ? $id : $post->ID;
@madila
madila / enqueue-assets-template.php
Created July 2, 2019 11:51
Webpack Hashed Assets Theme for Wordpress (Just the require structure)
/* File location: /src/enqueue-assets-template.php */
<?php
/**
* Template for the webpack config to be replace the appropiate assets. It uses the shortcode format [asset_name]
* The asset name is the webpack [name] of the original asset minus the extension, e.g. [theme.styles] for theme.styles.css
* Enqueue scripts and styles.
*/
function webpack_enqueue_assets() {
@madila
madila / customizer-links.php
Created July 5, 2019 14:40 — forked from slushman/customizer-links.php
How to link into the WordPress Customizer
@madila
madila / WordPress:PluginHeader
Created December 30, 2019 19:02 — forked from rabbitinblack/WordPress:PluginHeader
Wordpress : Plugin Header Comment
<?php
/**
* Plugin Name:
* Plugin URI:
* Description:
* Version: 1.0
* Author: Rabbitinblack
* Author URI: http://www.rabbitinblack.com
* License: GPL2
*/