Skip to content

Instantly share code, notes, and snippets.

@eamexicano
eamexicano / Array.extend.js
Created October 22, 2013 02:53
Ejemplo para extender la funcionalidad de los arreglos.
Array.prototype.random = function () {
var self = this
var conteo = self.length
var temp, x
for (var i = conteo - 1; i >= 0; i--){
temp = self[i]
x = Math.floor(Math.random() * conteo)
self[i] = self[x]
self[x] = temp
@eamexicano
eamexicano / application.js
Created May 14, 2013 04:31
galetahub /ckeditor - assets/ckeditor/application.js - This references jQuery, jQueryUI (optional - I use it), jQueryUJS included in a rails 3.2.x app
//= require jquery
//= require jquery-ui.min
//= require jquery_ujs
//= require ckeditor/filebrowser/javascripts/jquery.tmpl.min.js
//= require ckeditor/filebrowser/javascripts/fileuploader.js
//= require ckeditor/filebrowser/javascripts/application.js
@eamexicano
eamexicano / application.js
Created May 14, 2013 04:23
galetahub/ckeditor - assets/ckeditor/filebrowser/javascripts/application.js updated for jQuery 1.9.1 Changed .live for .on
$.QueryString = (function(a) {
if (a == "") return {};
var b = {};
for (var i = 0; i < a.length; ++i)
{
var p=a[i].split('=');
if (p.length != 2) continue;
b[p[0]] = decodeURIComponent(p[1].replace(/\+/g, " "));
}
return b;
@eamexicano
eamexicano / perro.html
Created October 4, 2012 12:14
Etiqueta personalizada en html
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<style>
/* Las siguientes reglas son para visualizar la etiqueta head, style y meta */
head {display: block; border: 2px dotted #ccc; width: 500px; height: auto; margin: 0 auto; padding: 1em; background: black;}
style {display: block; width: 100%; height: auto; background: orange; color: #000; font-size: 12px;}
meta {display: block; width: 100%; height: auto; background: red; color: #000; font-size: 12px;}
meta:after {content: "/>";}
@eamexicano
eamexicano / Objeto_de_Deseo.xml
Created October 1, 2012 17:24
Paquete para advene de objeto de deseo - http://www.youtube.com/watch?v=c-69y6b2keQ
<package xmlns='http://experience.univ-lyon1.fr/advene/ns' xmlns:dc='http://purl.org/dc/elements/1.1/' xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:tst='http://experience.univ-lyon1.fr/advene/ns/test' dc:creator='Emmanuel Ayala Mexicano' dc:date='2005-05-11' id='test'>
<meta>
<duration xmlns='http://experience.univ-lyon1.fr/advene/ns/advenetool'>80313</duration>
<mediafile xmlns='http://experience.univ-lyon1.fr/advene/ns/advenetool'>F:\EMMANUEL\ADVENE + VLC\proyectos\videos\objeto de deseo.mov</mediafile>
<title xmlns='http://purl.org/dc/elements/1.1/'>Objeto de Deseo</title>
</meta>
<imports>
</imports>
<annotations>
@eamexicano
eamexicano / setup-multiple.sh
Created September 28, 2012 17:03
Inicializa repositorio de git con 2 ramas (master / dev). Crea un repositorio remoto. Sincroniza htdocs (/var/www/sitio o /var/www/sitio-dev). Necesita el nombre del repo, usuario y ajustar las rutas.
#!/bin/bash
SITIO="$1"
PRUEBAS="${1}-dev"
USUARIO="$2"
PUERTO="22"
REPOSITORIO_REMOTO="/var/repo/$SITIO"
SHEBANG="#!/bin/bash"
BRANCH='\$branch'
REF2='\${ref[2]}'
@eamexicano
eamexicano / referencia.git
Created September 18, 2012 19:40
Referencia básica de git
CONFIGURAR
git config --global user.name ""
git config --global user.email ""
color.ui=true
CREAR REPOSITORIO
# Iniciar repositorio en la carpeta en la que se está
init
@eamexicano
eamexicano / trabajo-sucio.html
Created September 6, 2012 02:52
Archivo html donde el navegador se encarga de llenar las etiquetas html, head y body
<style>
body {width: 500px; height: 500px; background: #ccc;}
#trabajo-sucio {border: 1px solid #ccc; width: 100px; height: 100px; margin: 100px 50%; background: #fff; padding: 1em;}
</style>
<div id='trabajo-sucio'>
Este documento le deja al navegador el trabajo sucio
</div>
@eamexicano
eamexicano / FontAwesome.html
Created September 5, 2012 13:25
Ligas a los archivos CSS para utilizar font-awesome en wordpress
<link rel="stylesheet" type="text/css" href="<?php echo get_stylesheet_directory_uri(); ?>/font-awesome/css/font-awesome.css">
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="<?php echo get_stylesheet_directory_uri(); ?>/font-awesome/css/font-awesome-ie7.css">
<![endif]-->
@eamexicano
eamexicano / jquery-test.html
Created September 4, 2012 15:04
El signo de $ es una abreviación de jQuery
<!-- $ es una abreviación de jQuery. -->
<!-- jQuery en la cabeza -->
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<style>
body {background: #eee; font-family: sans-serif; margin: 0 auto; width: 800px;}
#click {width: 200px; height: 100px; margin: 49% 40%; border: 1px dashed black; background: #eee; line-height: 100px; text-align: center;}