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.php
Created August 13, 2012 14:35
register-show-home
<?php
/*
Plugin Name: Registered users only
Plugin URI: http://www.osclass.org/
Description: This plugin block non-registered users
Version: 0.9.3
Author: OSClass
Author URI: http://www.osclass.org/
Short Name: registered_users_only
Plugin update URI: registered-users-only
source ~/.git-completion.bash
function parse_git_branch
{
git_status="$(git status 2> /dev/null)";
if [ ! -n "$git_status" ]; then
return 1;
fi
git_branches="$(git branch 2> /dev/null)"
#!bash
#
# bash completion support for core Git.
#
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/).
# Distributed under the GNU General Public License, version 2.0.
#
# The contained completion routines provide support for completing:
#
@juanramon
juanramon / index.html
Created July 25, 2012 07:01
index.html
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript">/*! jQuery v1.7.2 jquery.com | jquery.org/license */
(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cu(a){if(!cj[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ck||(ck=c.createElement("iframe"),ck.frameBorder=ck.width=ck.height=0),b.appendChild(ck);if(!cl||!ck.createElement)cl=(ck.contentWindow||ck.contentDocument).document,cl.write((f.support.boxModel?"<!doctype html>":"")+"<html><body>"),cl.close();d=cl.createElement(a),cl.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ck)}cj[a]=e}return cj[a]}function ct(a,b){var c={};f.each(cp.concat.apply([],cp.slice(0,b)),function(){c[this]=a});return c}function cs(){cq=b}function cr(){setTimeout(cs,0);return cq=f.now()}function ci(){tr
@juanramon
juanramon / gettingstarted.php
Created June 28, 2012 08:58
glotpress getting started
<?php
class Getting_Started extends GP_Plugin {
function __construct() {
parent::__construct();
$this->add_action( 'init' );
$this->add_action( 'after_notices' );
GP::$router->add( '/getting-started', 'getting_started_page' );
/* FYI: for now, only available on english */
/* MAIN CATEGORIES */
INSERT INTO /*TABLE_PREFIX*/t_category (pk_i_id, i_position, b_enabled) VALUES (1, 1, 1);
INSERT INTO /*TABLE_PREFIX*/t_category_description (fk_i_category_id, fk_c_locale_code, s_name, s_slug) VALUES (1, 'en_US', 'For sale', 'for-sale');
INSERT INTO /*TABLE_PREFIX*/t_category (pk_i_id, i_position, b_enabled) VALUES (2, 2, 1);
INSERT INTO /*TABLE_PREFIX*/t_category_description (fk_i_category_id, fk_c_locale_code, s_name, s_slug) VALUES (2, 'en_US', 'Vehicles', 'vehicles');
INSERT INTO /*TABLE_PREFIX*/t_category (pk_i_id, i_position, b_enabled) VALUES (3, 3, 1);
INSERT INTO /*TABLE_PREFIX*/t_category_description (fk_i_category_id, fk_c_locale_code, s_name, s_slug) VALUES (3, 'en_US', 'Classes', 'classes');
INSERT INTO /*TABLE_PREFIX*/t_category (pk_i_id, i_position, b_enabled) VALUES (4, 4, 1);
INSERT INTO /*TABLE_PREFIX*/t_category_description (fk_i_category_id, fk_c_locale_code, s_name, s_slug) VALUES (4, 'en_US', 'Real estate', 'real-estate
@juanramon
juanramon / generate_rules.php
Created December 14, 2011 10:16
Generate rules with rules for cities
<?php
/*
* OSCLass – software for creating and publishing online classified
* advertising platforms
*
* Copyright (C) 2010 OSCLASS
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License
* as published by the Free Software Foundation, either version 3 of
@juanramon
juanramon / upgrade-funcs.php
Created November 30, 2011 12:09
Upgrade funcs with a fix for price update
<?php
/**
* OSClass – software for creating and publishing online classified advertising platforms
*
* Copyright (C) 2010 OSCLASS
*
* This program is free software: you can redistribute it and/or modify it under the terms
* of the GNU Affero General Public License as published by the Free Software Foundation,
* either version 3 of the License, or (at your option) any later version.
*
@juanramon
juanramon / ms-files.php
Created September 8, 2011 10:41
ms-files
<?php
/**
* Multisite upload handler.
*
* @since 3.0.0
*
* @package WordPress
* @subpackage Multisite
*/
@juanramon
juanramon / mailserver.php
Created September 5, 2011 09:13
Mailserver settings v2.2.1
<?php
/**
* OSClass – software for creating and publishing online classified advertising platforms
*
* Copyright (C) 2010 OSCLASS
*
* This program is free software: you can redistribute it and/or modify it under the terms
* of the GNU Affero General Public License as published by the Free Software Foundation,
* either version 3 of the License, or (at your option) any later version.
*