Skip to content

Instantly share code, notes, and snippets.

View antillas21's full-sized avatar

Antonio Antillon antillas21

  • Mexicali, Mexico
View GitHub Profile
@antillas21
antillas21 / application.html.erb
Created January 8, 2011 00:44
Files to edit after creating a Rails app with template: http://railswizard.org/d87652cae598fe1b11e1.rb
# in order to complete Devise initial requirements:
# app/views/layout/application.html.erb
<% flash.each do |key, value| %>
<div class='flash' id='<%= key %>'>
<%= value %>
</div>
<% end %>
@antillas21
antillas21 / qrcodes.rb
Created May 12, 2011 19:08
Creating QRCodes with rqr gem
require 'rubygems'
require 'rqr'
string = "http://google.com"
mecard = "MECARD:N:Android OS;EMAIL:android@gmail.com;URL:http://google.com;;"
RQR::QRCode.create() do |qr|
qr.save(string, "google.jpg")
end
@antillas21
antillas21 / pet_template.rb
Created January 28, 2012 02:46
SITIO BASICO: Como crear un simple sistema de plantillas para sitios web muy basicos. versión Ruby w/Sinatra
require 'sinatra'
helpers do
def partial(page)
erb page, :layout => false
end
end
get '/' do
@page_title = 'Mi pagina web'
@antillas21
antillas21 / Omega8cc Recipe
Created January 30, 2012 06:58 — forked from omega8cc/gist:960279
Import existing Drupal sites into Aegir
=== IMPORT YOUR EXISTING SITES TO AEGIR IN 8 EASY STEPS
1. Upload or rsync full drupal root of your site to static/custom/name
2. Chmod everything with command:
$ chmod -R 775 static/custom/name
and files only with:
$ chmod -R 777 static/custom/name/sites/default/files/*
@antillas21
antillas21 / gist:1741296
Created February 5, 2012 00:09
Clonar y administrar tus dotfiles
# primero colocarnos en el folder donde queremos tener nuestros dotfiles, en el ejemplo,
# directamente en el directorio de usuario
$ cd
# clonar repositorio que ya tienes
$ git clone git://github.com/badbit/dotvim.git
# esto creara el directorio dotvim en el directorio en que estábamos
$ ls -l
drwx------+ 65 aantillon staff 2210 Jan 30 02:53 dotvim
@antillas21
antillas21 / gist:1793540
Created February 10, 2012 22:20
Instrucciones para actualizar app de registro
$ cd ruta/a/directorio/app
# la app la instalé dentro de /home/atomix/mse2012, por lo que el comando anterior debería ser:
# cd ~/mse2012
$ git pull
# traemos el nuevo codigo de la app.
$ export RAILS_ENV=production
# con esto nos aseguramos de que todos los comandos que ejecutemos se realicen en el ambiente de producción.
@antillas21
antillas21 / git-install-config
Created March 10, 2012 07:31
Git Un-Workshop
Instalar y Configurar Git
Instalar Git
Identificándonos
$ git config --global user.name "Mi Nombre"
$ git config --global user.email "email@ejemplo.com"
$ ssh-keygen -t rsa -C "email@ejemplo.com"
@antillas21
antillas21 / .gitconfig
Created March 13, 2012 08:30
Como mostrar el branch en que trabajamos si usamos Git
## Agregar en nuestro archivo ~/.gitconfig
[alias]
hist = log --graph --pretty=format:'%C(yellow)%h%Creset -%C(green)%d%Creset %s %C(cyan)(%cr) %C(magenta)<%an>%Creset' --abbrev-commit --date=relative
# hist es un alias, en el ejemplo que se menciona, al escribir en el shell:
$ git hist
# obtendríamos la siguiente salida:
@antillas21
antillas21 / gist:2030077
Created March 13, 2012 17:32
Comentarios Alma
Avances
-Exposiciones
http://museoamparo.hechoendrupal.com/es/exposiciones
http://museoamparo.hechoendrupal.com/es/exposiciones/actuales/estructura-sin-contenido-una-intervencion-en-el-patio-geometrico-del-ma
http://museoamparo.hechoendrupal.com/es/exposiciones/anteriores
http://museoamparo.hechoendrupal.com/es/exposiciones/proximas
-Coleccion
# mis params para el shell prompt
export PS1='\[\033[0;36m\]\w\[\033[0m\]$(parse_git_branch)$ '
# resultado
~/Documents/Apps/2011/registrame [master]$
# los que menciona Miguel
export PS1="\[\033[35m\]\t\[\033[m\]-\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h:\[\033[33;1m\]\w\[\033[m\]$(parse_git_branch)$ "
# resultado
14:49:19-aantillon@phoenix:~/Documents/Apps/2011/registrame$