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 / index.html
Created January 5, 2015 15:35
San Silvestre Tarragona 2015 - CartoDB
<!DOCTYPE html>
<html>
<head>
<title>San Silvestre Tarragona 2014</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<style>
html, body, #map {
height: 100%;
padding: 0;
@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 / ThemeBackofficeRedirect.class.php
Created November 29, 2012 15:23
Redirect from dashboard to listing items
<?php if ( !defined('ABS_PATH') ) exit('ABS_PATH is not loaded. Direct access is not allowed.');
class ThemeBackofficeRedirect
{
var $location;
var $section;
public function __construct()
{
$this->location = Rewrite::newInstance()->get_location();
@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();
@juanramon
juanramon / googleanalytics.php
Created November 7, 2012 00:34
Google Analytics for GlotPress Plugin
<?php
class Google_Analytics extends GP_Plugin {
var $ga_id;
function __construct() {
parent::__construct();
$this->add_action( 'gp_footer' );
$this->ga_id= 'YOUR_GA_TRACKING_ID';