Skip to content

Instantly share code, notes, and snippets.

<?php
class WPLazyLoadImages {
function __construct() {
// Add Our Filters and actions for the plugin
add_action('wp_enqueue_scripts', array($this, 'enqueue_lazyload'));
add_filter('the_content', array($this, 'filter_lazyload'));
add_action('wp_footer', array($this, 'footer_lazyload'));
#!/bin/bash
# Anh Nguyen <anh.ng8@gmail.com>
# 2016-04-30
# MIT License
# This script takes in images from a folder and make a crossfade video from the images using ffmpeg.
# Make sure you have ffmpeg installed before running.
# The output command looks something like the below, but for as many images as you have in the folder.
@tacensi
tacensi / diceware.wordlist.pt.txt
Created April 22, 2019 19:09 — forked from patxipierce/diceware.wordlist.pt.txt
A diceware wordlist for the Portuguese language.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
11111 a
11112 aa
11113 aaa
11114 aaaa
11115 ab
11116 aba
11121 abaco
@tacensi
tacensi / getScript.js
Created April 22, 2019 18:33 — forked from kmonsoor/getScript.js
jquery $.getScript() replacement with vanilla JavaScript
"use strict";
// src: https://stackoverflow.com/a/28002292
const getScript = (source, callback) => {
var script = document.createElement('script');
var prior = document.getElementsByTagName('script')[0];
script.async = 1;
script.onload = script.onreadystatechange = (_, isAbort) => {
if (isAbort || !script.readyState || /loaded|complete/.test(script.readyState)) {
(function (context, trackingId, options) {
const history = context.history;
const doc = document;
const nav = navigator || {};
const storage = localStorage;
const encode = encodeURIComponent;
const pushState = history.pushState;
const typeException = 'exception';
const generateId = () => Math.random().toString(36);
const getId = () => {
@tacensi
tacensi / thrpatch.c
Created November 19, 2018 23:34 — forked from MathisRosenhauer/thrpatch.c
Upload patch to thr10 guitar amplifier
/*
* Copyright 2016
* Mathis Rosenhauer
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
@tacensi
tacensi / jquery.validate.cnpj.js
Created April 26, 2016 20:13 — forked from ricardoriogo/jquery.validate.cnpj.js
CNPJ validation for jQuery Validate
jQuery.validator.addMethod("cnpj", function(cnpj, element) {
var numeros, digitos, soma, resultado, pos, tamanho,
digitos_iguais = true;
if (cnpj.length < 14 && cnpj.length > 15)
return false;
for (var i = 0; i < cnpj.length - 1; i++)
if (cnpj.charAt(i) != cnpj.charAt(i + 1)) {
@tacensi
tacensi / gist:10427782
Last active August 29, 2015 13:58 — forked from liamcurry/gist:2597326
Vanilla vs jQuery

Moving from jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})