Skip to content

Instantly share code, notes, and snippets.

Avatar

Antonio Antillon antillas21

View GitHub Profile
View gist:5632645
|root
|public/ (home of drupal install)
|drush-bkups
|fixtures (db dumps, legacy data to be imported)
View proposed.json
{
"catalog_product_id":4,
"created_at":"2013-03-06T19:52:18Z",
"entity_type":"Printable",
"id":14,
"live":true,
"properties": {
"Quantity":[
{
"option_name":"250",
View post_spec.rb
# spec/models/post_spec.rb
require 'spec_helper'
describe Post do
let(:post) { Post.new }
describe 'basic attributes' do
it 'needs a title, content and name' do
post.title = 'post title'
@antillas21
antillas21 / gist:3724857
Created Sep 14, 2012
Common Media Queries - 2012
View gist:3724857
/* SOURCE: http://www.stuffandnonsense.co.uk/blog/about/hardboiled_css3_media_queries/ */
/* Smartphones (portrait and landscape) ----------- */
@media only screen
and (min-device-width : 320px)
and (max-device-width : 480px) {
/* Styles */
}
/* Smartphones (landscape) ----------- */
View gist:3537260
class Contact
delegate :vertical, :to => :campaign, :prefix => true
end
class Campaign
delegate :name, :to => :vertical, :prefix => true
end
contact = Contact.find(1)
camp = Campaign.find(2)
View gist:3536739
source :rubygems
gem 'rake'
gem 'sinatra', '~> 1.2.3'
gem 'shotgun', '~> 0.9'
gem 'haml', '~> 3.1.4'
# Sass & Compass
gem 'sass', '~> 3.1.12'
gem 'compass', '~> 0.11.6'
@antillas21
antillas21 / gist:3184092
Created Jul 26, 2012
OpenGraph Metatags
View gist:3184092
<head profile="http://www.w3.org/1999/xhtml/vocab">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta property="og:country-name" content="México">
<meta property="og:site_name" content="Cuauhtémoc Moctezuma">
<meta content="Cuauhtémoc Moctezuma premia el hábito de la lectura" about="/es/cuauhtemoc-moctezuma-premia-el-habito-de-la-lectura" property="dc:title">
<link rel="shortcut icon" href="http://www.cuamoc.com/sites/cuamoc.hechoendrupal.com/files/favicon.ico" type="image/vnd.microsoft.icon">
<meta about="/es/cuauhtemoc-moctezuma-premia-el-habito-de-la-lectura" property="sioc:num_replies" content="0" datatype="xsd:integer">
<meta property="og:url" content="http://www.cuamoc.com/es/cuauhtemoc-moctezuma-premia-el-habito-de-la-lectura">
<meta property="og:image" content="http://www.cuamoc.com/sites/cuamoc.hechoendrupal.com/files/styles/thumbnail/public/blog/image/concurso_lectura.jpg">
<link rel="canonical" href="/es/cuauhtemoc-moctezuma-premia-el-habito-de-la-lectura">
@antillas21
antillas21 / Gemfile
Created Jul 23, 2012
elasticsearch - playing around
View Gemfile
# ... gems
# para este demo, al guardar un registro, vía geocoder obtenía su geolocalizaicón
gem 'geocoder'
# Ruby API & DSL, with ActiveRecord/ActiveModel integration.
gem 'tire'
# elasticsearch requiere que el modelo a indexar soporte paginación,
# lo podemos lograr con will_paginate o kaminari (your choice)
@antillas21
antillas21 / gist:3132604
Created Jul 17, 2012
ctsteps.auth cucumber
View gist:3132604
~/Documents/Apps/TangoSource/ctsteps-authorization-server [testing]$ rake cucumber
/Users/aantillon/.rvm/rubies/ruby-1.9.3-p194/bin/ruby -S bundle exec cucumber --profile default
Using the default profile...
Feature: Change password
Background: # features/change_password.feature:3
Given a client # features/step_definitions/homepage_backrgound_steps.rb:2
And I have an account # features/step_definitions/forgot_password_steps.rb:1
execution expired (Timeout::Error)
/Users/aantillon/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/net/smtp.rb:540:in `initialize'
@antillas21
antillas21 / manage.py.sh
Created Jul 12, 2012
Result from => ./manage.py syncdb --noinput
View manage.py.sh
vagrant@lucid64:/vagrant$ ./manage.py syncdb --noinput
Traceback (most recent call last):
File "./manage.py", line 14, in <module>
execute_manager(settings)
File "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 438, in execute_manager
utility.execute()
File "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 379, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 261, in fetch_command
klass = load_command_class(app_name, subcommand)
You can’t perform that action at this time.