Skip to content

Instantly share code, notes, and snippets.

View scrubmx's full-sized avatar
🏴‍☠️

Jorge González scrubmx

🏴‍☠️
View GitHub Profile
@scrubmx
scrubmx / mkwp
Last active August 29, 2015 13:56
#! /bin/bash
# Author: @scrubmx
# https://github.com/scrubmx/
#
# WordPress installation name
if [[ $# -eq 0 ]] ; then
printf '\n\033[0;33m%s\033[0m' 'usage: '
printf '\033[0;32m%s\033[0m\n' 'mkwp name'
exit 0
if ( ! Modernizr.inputtypes.date ) {
$('input[type="date"]').datepicker({
dateFormat: 'yy-mm-dd'
});
}
/**
* Muestra el link a la ultima pagina del archive o page (con paginación)
* @return string HTML link with the proper link.
*/
function last_page_link()
{
global $wp_query;
$pagename = ($wp_query->query['pagename']) ? $wp_query->query['pagename'] : '';
window.Lightbox = {};
/**
* Contenedor donde se pone la imagen
* @type jQuery Wrapped DOM Element
*/
Lightbox.$container =$('#evento-uploads-lightbox');
/**
* Contador que indica el indice de la imagen que estamos viendo
body {
-moz-transform: rotate(-180deg);
-ms-transform: rotate(-180deg);
-o-transform: rotate(-180deg);
-webkit-transform: rotate(-180deg);
transform: rotate(-180deg);
}
@scrubmx
scrubmx / remove.js
Created April 9, 2014 20:01
Remove an element from an array
Array.prototype.remove = function (itemToRemove)
{
return this.filter(function (element) {
return element !== itemToRemove;
});
}
@scrubmx
scrubmx / loop.php
Created June 25, 2014 20:45
WordPress main loop example
<?php if ( have_posts() ) : ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'templates/post', get_post_format() ); ?>
<?php endwhile; ?>
<?php wp_reset_postdata(); ?>
<?php
/**
* The base configurations of the WordPress.
*
* This file has the following configurations: MySQL settings, Table Prefix,
* Secret Keys, WordPress Language, and ABSPATH. You can find more information
* by visiting {@link http://codex.wordpress.org/Editing_wp-config.php Editing
* wp-config.php} Codex page. You can get the MySQL settings from your web host.
*
* This file is used by the wp-config.php creation script during the
@scrubmx
scrubmx / service-location.php
Created July 16, 2014 23:35
Service Location Example in PHP
<?php
class MethodNotFoundException extends Exception {}
/**
* Concrete class (testable)
*/
class Beneficios_Query {
@scrubmx
scrubmx / datepicker.js
Created September 19, 2014 02:54
Input type date with jquery-ui fallback
if (! Modernizr.inputtypes.date) {
$('input[type=date]').datepicker();
}