Skip to content

Instantly share code, notes, and snippets.

View neo22s's full-sized avatar

Chema neo22s

View GitHub Profile
@neo22s
neo22s / install.php
Created August 8, 2014 10:38
install 2.2.0
<?php
/**
* HTML template for the install
*
* @package Install
* @category Helper
* @author Chema <[email protected]>
* @copyright (c) 2009-2014 Open Classifieds Team
* @license GPL v3
*/
@neo22s
neo22s / update16.php
Last active August 29, 2015 14:04
update open eshop to 1.6
<?php
/**
* HTML template for the install
*
* @package Install
* @category Helper
* @author Chema <[email protected]>
* @copyright (c) 2009-2014 Open Classifieds Team
* @license GPL v3
*/
@neo22s
neo22s / update220.php
Last active August 29, 2015 14:04
update open classifieds to 2.2.0
<?php
/**
* HTML template for the install
*
* @package Install
* @category Helper
* @author Chema <[email protected]>
* @copyright (c) 2009-2014 Open Classifieds Team
* @license GPL v3
*/
<?php
/*
EmailAddressValidator Class
http://code.google.com/p/php-email-address-validation/
Released under New BSD license
http://www.opensource.org/licenses/bsd-license.php
@neo22s
neo22s / loadingbar.js
Created June 17, 2014 16:07
loading bar.js
//from https://github.com/peachananr/loading-bar
//I have recoded it a bit since uses a loop each, which is not convenient for me at all
$(function(){
$("a.ajax-load").click(function(e){
e.preventDefault();
button = $(this);
//get the link location that was clicked
pageurl = button.attr('href');
//to get the ajax content and display in div with id 'content'
@neo22s
neo22s / formatcurrency.php
Created March 18, 2014 14:41
NumberFormatter formatCurrency alternative
<?php
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
ini_set('display_errors', 1);
function formatcurrency($floatcurr, $curr = 'USD')
{
/**
* A list of the ISO 4217 currency codes with symbol,format and symbol order
@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 <[email protected]>
* @version 1.0
* @date 21-02-2014
* @url http://garridodiaz.com/phpseo/
@neo22s
neo22s / embed.js
Created December 21, 2013 11:55
Modal open iframe with external URI
function getElementsByClassName(node, classname) {
if (node.getElementsByClassName) {
return node.getElementsByClassName(classname);
} else {
return (function getElementsByClass(searchClass, node) {
if (node == null)
node = document;
var classElements = [],
els = node.getElementsByTagName("*"),
elsLen = els.length,
@neo22s
neo22s / example.php
Created February 12, 2013 10:38
You know Range from PHP? so this function does same but with given dates ;)
//normal
$dates = date_range(strtotime('-1 month'), time());
//advanced, using all parameters
$dates = date_range(strtotime('-1 month'), time(),'+1 day','Y-m-d',array('date'=>0,'count'=> 0),'date');
/**
* get an array range with dates in a specific format
* @param string $start from
* @param string $end to
@neo22s
neo22s / example.php
Created February 12, 2013 10:23
remodel, PHP models for redis
<?php
//main class to extend usage
require 'remodel.php';
//loading library predis: https://github.com/nrk/predis
require 'predis-0.8/autoload.php';
Predis\Autoloader::register();
///MODEL EXAMPLE
class Model_Post extends Remodel {