Skip to content

Instantly share code, notes, and snippets.

Avatar

Antonio Antillon antillas21

View GitHub Profile
@antillas21
antillas21 / sites.php
Created Apr 16, 2012
Steps to take Drupal site out of multi-site install
View sites.php
<?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.
);
@antillas21
antillas21 / Vagrantfile.rb
Created Apr 23, 2012
Sample Vagrantfile
View Vagrantfile.rb
Vagrant::Config.run do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "lucid64"
# The url from where the 'config.vm.box' box will be fetched if it
# doesn't already exist on the user's system.
@antillas21
antillas21 / gist:2932993
Created Jun 14, 2012
Git cleaned the master branch
View gist:2932993
~/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 / application.rb
Created Jun 15, 2012
RSpec configuration in application.rb
View 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:2938438
Created Jun 15, 2012
Group right en teaser de actividades
View gist:2938438
<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 / Presentation.md
Created Jun 28, 2012
Quick & Dirty Geolocation ...en Rails
View Presentation.md

#Quick & Dirty Geolocation ...en Rails

¿Qué necesitamos?

  • Rails app
$ rails new geostore
@antillas21
antillas21 / rough_draft.md
Created Jul 4, 2012
Tweet capturado con TweetStream
View rough_draft.md

##Flujo

  • Abrir un cliente al Streaming API de twitter via la gema TweetStream
  • Este cliente debe estar siempre funcionando y proveer un comportamiento cuando haya necesidad de reconnectarse (por problemas en twitter y diversos) y en caso de error (por las mismas causas) # Leer documentacion de la gema
  • El cliente debe enviar todos los tweets capturados en base a un query='on @dimensions, @dimensions' a un Array o a un queue.
  • A través de un background_job, procesar el queue, leyendo de cada tweet capturado, el atributo :expanded_url (provisionando que puede ser nulo o empty)
  • El background_job debe hacer una búsqueda en los feed_entries con ese valor capturado. Si encuentra un match, entonces += 1 a su tweet_count.
@antillas21
antillas21 / Gemfile
Created Jul 6, 2012
CKEditor dependencies
View Gemfile
source 'https://rubygems.org'
# long list of gems
gem 'rails_admin' # to handle auth and adding content
gem "ckeditor", "3.7.1"
# ckeditor gem is the one responsible for making the WYSIWYG editor available
# even more gems
View bundle-install
~/Documents/Apps/TangoSource/ctsteps-authorization-server [master]$ bundle install
Fetching gem metadata from http://gems.onterraresearch.net/.
Fetching full source index from http://gems.onterraresearch.net/
Fetching gem metadata from http://rubygems.org/........
Unfortunately, a fatal error has occurred. Please see the Bundler
troubleshooting documentation at http://bit.ly/bundler-issues. Thanks!
/Users/aantillon/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:650:in `load': uninitialized constant Psych::Object (NameError)
from /Users/aantillon/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:650:in `_load'
from /Users/aantillon/.rvm/gems/ruby-1.9.3-p125@global/gems/bundler-1.1.4/lib/bundler/fetcher.rb:57:in `load'
from /Users/aantillon/.rvm/gems/ruby-1.9.3-p125@global/gems/bundler-1.1.4/lib/bundler/fetcher.rb:57:in `fetch_spec'
View console.sh
~/Documents/Apps/TangoSource/ctsteps-authorization-server [master*]$ bundle
Using rake (0.8.7)
Using multi_json (1.3.6)
Using activesupport (3.1.0)
Using bcrypt-ruby (3.0.1)
Using builder (3.0.0)
Using i18n (0.6.0)
Using activemodel (3.1.0)
Using erubis (2.7.0)
Using rack (1.3.6)
You can’t perform that action at this time.