Skip to content

Instantly share code, notes, and snippets.

@eamexicano
eamexicano / template.html
Created November 7, 2013 16:37
HTML5 base template - to be used as a remote repository.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Template</title>
<link rel="stylesheet" href="template.css" type="text/css" media="screen" title="no title" charset="utf-8">
</head>
<body>
<header>
<h1>Template</h1>
@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 / json.js
Created December 4, 2012 04:25
Referencia básica de JSON
/*
*
* Teclear el código en una consola de JS (en un navegador)
* Los comentarios de una línea (//) son conceptos
* Los comentarios de una línea + flecha sencilla (//->) es código que se puede teclear en la consola.
* Los comentarios de una línea + flecha doble (// => ) es la respuesta que se obtiene.
*
* Copyright (c) 2012 Emmanuel Ayala Mexicano
*/
@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 / setup-single.sh
Created September 24, 2012 15:09
Inicializa repositorio de git. Lo envia vía ssh a un nuevo repositorio vacío y sincroniza con htdocs. Necesita el nombre del repo, usuario y modificar las rutas.
#!/bin/bash
SITIO="$1"
USUARIO="$2"
PUERTO="22"
REPOSITORIO_REMOTO="/var/repo/$SITIO"
SHEBANG="#!/bin/bash"
SITIO_HTDOCS="/var/www/$SITIO"
read -r -d '' HOOK <<EOF
${SHEBANG}
@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