Skip to content

Instantly share code, notes, and snippets.

View jmlweb's full-sized avatar
:octocat:
Cannot read property of undefined

José Manuel Lucas jmlweb

:octocat:
Cannot read property of undefined
View GitHub Profile
@jmlweb
jmlweb / gist:946765
Created April 28, 2011 17:06
Para poner un ancla en el sitio
<html>
<head><title>Enlace al sitio</title></head>
<body>
<!-- En el enlace -->
<a href="#destino">ENLACE QUE ENVÍA AL DEE</a>
<!-- En el post al cuál queréis llegar, por ejemplo -->
<div class="post">
<h1 id="destino"><a href="http://www.mipagina.com/2011/04/25/el-hobbit/" title="Permalink for El Hobbit">El Hobbit</a></h1>
</div>
@jmlweb
jmlweb / jquery.validVal-2.4.1.js
Created May 18, 2011 22:42
validVal with Spanish translation
/*
* jQuery validVal version 2.4.1
* demo's and documentation:
* validval.frebsite.nl
*
* Copyright (c) 2010 Fred Heusschen
* www.frebsite.nl
*
* Thanks to Ryan Henson, who helped speeding up the performance.
*
@jmlweb
jmlweb / transitions.php
Created July 16, 2011 18:29
Transitions plugin for Turbine (very very alpha state)
<?php
/**
* CSS3 Transitions Plugin for Turbine
* José Manuel Lucas
*
* http://github.com/jmlweb/turbine_transitions
*
*/
@jmlweb
jmlweb / selectors.php
Created July 16, 2011 18:59
Selectors plugin for Turbine CSS
<?php
/**
* CSS3 Selectors Plugin for Turbine
* José Manuel Lucas
*
* http://github.com/jmlweb/turbine_transitions
*
*/
@jmlweb
jmlweb / 69_update_events_schema.sql
Created February 20, 2012 15:52
Verificar que no exista una columna antes de añadirla
DELIMITER $$
DROP PROCEDURE IF EXISTS add_has_detail_column $$
CREATE PROCEDURE add_has_detail_column()
BEGIN
IF NOT EXISTS(SELECT * FROM information_schema.COLUMNS WHERE TABLE_SCHEMA=DATABASE() AND TABLE_NAME= 'events' AND COLUMN_NAME = 'has_detail') THEN
ALTER TABLE `events` ADD COLUMN `has_detail` BOOLEAN NOT NULL DEFAULT 1 AFTER `is_migrated`;
END IF;
@jmlweb
jmlweb / Chopshop.coffee
Created March 23, 2012 12:52
Chopshop.coffee
$ ->
#Colorbox
$('a.popup', '#content').colorbox(colorboxOpts)
#General
$('nav.categories a span, h2 span').hide()
$('.slideshow .banner').cycle
fx: 'scrollLeft'
speed: 1500
@jmlweb
jmlweb / bitoke.coffee
Created April 20, 2012 07:26
Coffeescript + jQuery basic use
BITOKE = {
external_links: ->
$('a[rel=external]', '.main_content').click ->
window.open($(this).attr('href'))
return false
lava_lamp: ->
#move($('a.current', '.main_menu'), 0)
_a_list = $('a', '.main_menu')
@jmlweb
jmlweb / field_validation.php
Created May 31, 2012 10:18
Ejemplo de validación para campos con array
<?php
//asumiendo que campo es un campo de formulario de tipo array
foreach($_POST as $k1 => $v1) {
if($k1 === 'campo' && is_array($v1)) {
foreach($campo as $k2 => $v2) {
$this->form_validation->set_rules('campo['.$k2.']', 'campo'.$k2, 'required');
}
}
}
@jmlweb
jmlweb / control_directives.scss
Created July 30, 2013 10:44
Example of control directives in SCSS
i {
$positions: (izq, der);
$colors: (w, b);
@for $i from 1 through 2 {
@each $position in $positions {
@each $color in $colors {
&.#{ $position }_0#{ $i }_#{ $color } {
@include fx_item(#{ $position }_0#{ $i }_#{ $color });
}
}
@jmlweb
jmlweb / HTML5_basic_skeleton.html
Created February 5, 2014 12:03
HTML5 (very) basic Skeleton
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="utf-8" />
<title>¡Nuestro primer esqueleto HTML!</title>
</head>
<body>
<!-- Aquí es donde va nuestro contenido -->
</body>
</html>