Skip to content

Instantly share code, notes, and snippets.

View juanramon's full-sized avatar

Juan Ramón Díaz juanramon

  • Lifull Connect
  • Barcelona, Spain
View GitHub Profile
@juanramon
juanramon / allow_url_fopen.php
Created April 15, 2011 11:16
Check if allow_url_fopen is enabled
<?php
if( ini_get('allow_url_fopen') ) {
die('allow_url_fopen is enabled. file_get_contents should work well');
} else {
die('allow_url_fopen is disabled. file_get_contents would not work');
}
?>
@juanramon
juanramon / session.php
Created January 20, 2011 09:20
Check if session is working well
<?php
$session_path = ini_get('session.save_path');
if( file_exists($session_path) ) {
echo 'Session path exists: ' . $session_path;
} else {
echo 'Session path doesn\'t exist: ';
echo $session_path;
exit();
}
@juanramon
juanramon / jquery.uniform.js
Created May 6, 2011 22:27
jQuery uniform fixed select issues
/*
Uniform v1.7.5
Copyright © 2009 Josh Pyles / Pixelmatrix Design LLC
http://pixelmatrixdesign.com
Requires jQuery 1.4 or newer
Much thanks to Thomas Reynolds and Buck Wilson for their help and advice on this
@juanramon
juanramon / akismet_send_friend.php
Created May 8, 2013 09:33
Function to check if the listings is going to be shared is an spam message.
<?php
function send_friend_post_akismet($item) {
// we don't performe this action if akismet is not
if( !osc_akismet_key() ) {
return false;
}
require_once osc_lib_path() . 'Akismet.class.php';
$akismet = new Akismet(osc_base_url(), osc_akismet_key());
var nodecr = require('nodecr');
// Recognise text of any language in any format
nodecr.process(__dirname + '/images/correoe.tiff',function(err, text) {
if(err) {
console.error(err);
} else {
console.log(text);
}
});
var nodecr = require('nodecr');
// Recognise text of any language in any format
nodecr.process(__dirname + '/images/correoe.png',function(err, text) {
if(err) {
console.error(err);
} else {
console.log(text);
}
}, null, null, null, nodecr.preprocessors.convert);
@juanramon
juanramon / main.css
Created April 24, 2013 08:56
CSS main file of Bender theme.
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
nav,
section {
/*jshint strict:false*/
/*global CasperError, console, phantom, require*/
var links = [];
var casper = require("casper").create();
casper.defaultWaitForTimeout = 20000;
function getLinks() {
var links = document.querySelectorAll("a[name='productview']");
diff --git a/oc-includes/osclass/controller/search.php b/oc-includes/osclass/controller/search.php
index 402a079..5e281c4 100755
--- a/oc-includes/osclass/controller/search.php
+++ b/oc-includes/osclass/controller/search.php
@@ -377,8 +377,8 @@
$this->_exportVariableToView('search_alert', base64_encode($json));
- //calling the view...
- if(count($aItems)==0 || !$successCat) {
@juanramon
juanramon / ThemeBlockPages.class.php
Created November 29, 2012 15:08
Block Theme Pages
<?php if ( !defined('ABS_PATH') ) exit('ABS_PATH is not loaded. Direct access is not allowed.');
class ThemeBlockPages
{
var $location;
var $section;
public function __construct()
{
$this->location = Rewrite::newInstance()->get_location();