Skip to content

Instantly share code, notes, and snippets.

View neo22s's full-sized avatar

Chema neo22s

View GitHub Profile
@neo22s
neo22s / better-video.js
Last active February 24, 2024 03:43
Playlist video player for HTML5
jQuery(document).ready(function( $ ) {
/**
* improving the current html5 video player
*/
//when we pause we store the current time
$("video").on("pause", function(event) {
// Save into local storage,if you change the browser will not work
localStorage.setItem('bvideo-'+btoa(this.src), this.currentTime);
@neo22s
neo22s / seoreport.php
Created August 19, 2012 08:59
seo report php
<?php
/**
*
* SEO report for different metrics
*
* @category SEO
* @author Chema <chema@garridodiaz.com>
* @copyright (c) 2009-2012 Open Classifieds Team
* @license GPL v3
* Based on seo report script http://www.phpeasycode.com && PHP class SEOstats
@neo22s
neo22s / README.MD
Created July 19, 2017 10:12
Gimp Curves Presets

About

Collection of 123 curves presets for GIMP.

Installing

You just have to copy the contents of the file into your gimp-curves-tool.settings file. On my version of Linux this was under

@neo22s
neo22s / video.html
Last active August 20, 2023 14:55
HTML5 Video Position Saving
<!DOCTYPE html>
<html>
<head>
<script src="https://cdn.jsdelivr.net/npm/jquery@3.6.0/dist/jquery.min.js"></script>
</head>
<body>
<video controls="" src="https://s3.amazonaws.com/akamai.netstorage/HD_downloads/Orion_SM.mp4?" data-origwidth="0" data-origheight="0" ></video>
@neo22s
neo22s / crashsafari.com.html
Created January 26, 2016 20:26
Source code of crashsafari.com
<!DOCTYPE html>
<html>
<body>
<h1>What were you expecting?</h1>
<script>
var total = "";
for( var i = 0; i < 100000; i++ ) {
total = total + i.toString();
history.pushState(0,0, total );
}
@neo22s
neo22s / bbcode.php
Created May 3, 2012 08:55
BBcode parser example
<?php
/**
* BBcode helper class
*
* @package BBcode
* @category Helper
* @author Chema <chema@garridodiaz.com>
* @copyright (c) 2012
* @license GPL v3
*/
@neo22s
neo22s / post-password.php
Last active December 27, 2021 15:32
Get unique cookie for password protected posts in wordpress. We use the url of the post as MD5 for unique cookie storage. This way you can be loged in in different posts without putting the password in each of them. Also if you are an admin no need ot insert the password
<?php
/**
* Plugin Name: Advanced Post Password
* Plugin URI: https://garridodiaz.com
* Description: Password protected posts/pages adding some extra security features.
* Version: 1.0
* Author: Chema
* Author URI: https://garridodiaz.com
* License: GPL2
*/
@neo22s
neo22s / aws-backup.sh
Last active March 12, 2021 01:55
Backup for AWS, uploads to FTP and deletes old files.
#################
# FTP AWS Backup Script
# Backup for AWS, uploads to FTP and deletes old files.
# chema@yclas.com
# You need to install AWS CLI read more here http://martinbuberl.com/blog/backup-amazon-s3-bucket-with-aws-cli/
# 2015-07-20
# GPLv3
#################
@neo22s
neo22s / seo.php
Created February 21, 2014 09:48
<?php
/**
* Class to improve the seo of the site
*
* @package OC
* @category SEO
* @author Chema <chema@open-classifieds.com>
* @version 1.0
* @date 21-02-2014
* @url http://garridodiaz.com/phpseo/
@neo22s
neo22s / validate.php
Last active October 18, 2020 02:25
validate domain name in PHP
<?
/**
* checks if a domain name is valid
* @param string $domain_name
* @return bool
*/
public static function domain_name($domain_name)
{
//FILTER_VALIDATE_URL checks length but..why not? so we dont move forward with more expensive operations
$domain_len = strlen($domain_name);