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 / Presentation.md
Created June 28, 2012 06:19
Quick & Dirty Geolocation ...en Rails

#Quick & Dirty Geolocation ...en Rails

¿Qué necesitamos?

  • Rails app
$ rails new geostore
@antillas21
antillas21 / gist:2938438
Created June 15, 2012 19:57
Group right en teaser de actividades
<div class="group-right">
Eventos<div class="field field-name-title field-type-ds field-label-hidden"><div class="field-items"><div class="field-item even"><h2><a href="/es/actividades/erat-mauris-neque/">Erat Mauris Neque</a></h2></div></div></div><div class="field field-name-field-event-date field-type-datetime field-label-hidden"><div class="field-items"><div class="field-item even"><span class="date-display-single">Martes, Agosto 2, 2011</span></div></div></div><div class="field field-name-activity-time field-type-ds field-label-hidden"><div class="field-items"><div class="field-item even">A las 11 hrs / Entrada Libre</div></div></div><div class="field-group-format group_body_readmore field-group-div group-body-readmore speed-none effect-none"><p>Etiam a turpis tincidunt leo gravida hendrerit in vel tellus.</p><a href="/es/actividades/erat-mauris-neque/">Ver detalle</a></div><div class="field field-name-share-icon field-type-ds field-label-hidden"><div class="field-items"><div class="field-item eve
@antillas21
antillas21 / application.rb
Created June 15, 2012 01:39
RSpec configuration in application.rb
# configuring generators
config.generators do |g|
g.test_framework :rspec, :fixtures => true, :view_specs => false, :helper_specs => false,
:routing_specs => false, :controller_specs => true, :request_specs => true
g.fixture_replacement :factory_girl, :dir => 'spec/factories'
end
@antillas21
antillas21 / gist:2932993
Created June 14, 2012 21:14
Git cleaned the master branch
~/Documents/Apps/StoneGiantLabs/crosstown [master*]$ git clean -xdf
Removing .bundle/
Removing Gemfile.lock
Removing app/
Removing db/
Removing log/
Removing tmp/
Removing vendor/
~/Documents/Apps/StoneGiantLabs/crosstown [master]$ git lg
@antillas21
antillas21 / sites.php
Created April 16, 2012 21:23
Steps to take Drupal site out of multi-site install
<?php
$sites = array(
'sitename.com' => 'sitename.com',
// the first sitename.com in the file, refers to the url content in the browser's window,
//you may/probably should replace this with a FQDN.
// the second sitename.com appearing after '=>' is the directory name inside sites/ where
//the site files are stored.
);
# 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$
@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
@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 / 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 / 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.