Skip to content

Instantly share code, notes, and snippets.

View chebyte's full-sized avatar
🤡
smile

maurotorres chebyte

🤡
smile
View GitHub Profile
class Article < ActiveRecord::Base
# ...
define_index do
#los indexes tienen que ser datos del tipo string
indexes title, :sortable => true
indexes entry
indexes author.name, :as => :author, :sortable => true
#los atributos pueden ser integer, boolean o datetime
@articles = Article.search params[:search]
#Variantes que podemos utilizar
# :include => :author
# :conditions => { :created_at => 1.week.ago.to_i..Time.now.to_i }
# :with => [ "publication <= ? ", TIme.now ]
# :order => :name
# :field_weights => { :name => 20, :content => 10, :author_name => 5 }
# :match_mode => :boolean
#thinking sphinx utiliza will_paginate si esta diposnible :)
# :page => 1, :per_page => 20
development:
port: 13000
test:
port: 13001
staging:
port: 13002
production:
port: 13003
[user]
name = Mauro Torres
email = [email protected]
[alias]
ci = commit -a
co = checkout
st = status
praise = blame
up = pull --rebase origin
#! /bin/sh
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: nginx init.d script for Ubuntu 8.10 and lesser versions.
# Description: nginx init.d script for Ubuntu 8.10 and lesser versions.
### END INIT INFO
=> #<Google::Response:0xb734d3cc @results=[{:domain=>"www.tuquito.org.ar", :content=>"Proyecto Linux de Tucumán, datos y temas relacionados al proyecto, foros y ayuda para usuarios de la distribución y descargas.", :title=>"Tuquito 3", :cache_url=>"http://www.google.com/search?q=cache:4NZXKc3gQA8J:www.tuquito.org.ar", :url=>"http://www.tuquito.org.ar/"}, {:domain=>"en.wikipedia.org", :content=>"Oct 11, 2008 ... Tuquito is a Debian-based operating system created in Tucumán, Argentina, by Ignacio Díaz, Chris Arenas and Mauro Torres, students of The ...", :title=>"Tuquito - Wikipedia, the free encyclopedia", :cache_url=>"http://www.google.com/search?q=cache:a1xAEvHHujUJ:en.wikipedia.org", :url=>"http://en.wikipedia.org/wiki/Tuquito"}, {:domain=>"www.slideshare.net", :content=>"Tuquito 3 Nuevo Diseño En varios idiomas (Ingles,Portugues y Español) Interfaces mas intuitivas Optimizado para la conectividad(wifi, ...", :title=>"Tuquito 3", :cache_url=>"http://www.google.com/search?q=cache:T8VfO-4iyioJ:www.slideshare.
sudo gem install -y wirble
en la home crear el archivo .irbrc con el siguiente contenido
require 'rubygems'
require 'wirble'
Wirble.init
Wirble.colorize
warning: You did not specify any refspecs to push, and the current remote
warning: has not configured any push refspecs. The default action in this
warning: case is to push all matching refspecs, that is, all branches
warning: that exist both locally and remotely will be updated. This may
warning: not necessarily be what you want to happen.
warning:
warning: You can specify what action you want to take in this case, and
warning: avoid seeing this message again, by configuring 'push.default' to:
warning: 'nothing' : Do not push anything
warning: 'matching' : Push all matching branches (default)
>> include AWS::S3
=> Object
>> Base.establish_connection!(:access_key_id => "XXXXXX", :secret_access_key => "XXXXXX", :connection_name => "chebyte")
=> #<AWS::S3::Connection:0xb6eb9018 @secret_access_key="XXXXXX", @http=#<Net::HTTP s3.amazonaws.com:80 open=false>, access_key_id"XXXXXX", options{:port=>80, :access_key_id=>"XXXXXX", :secret_access_key=>"XXXXXX", :connection_name=>"chebyte", :server=>"s3.amazonaws.com"}
>> Base.establish_connection!(:access_key_id => "XXXXXX", :secret_access_key => "XXXXXX", :connection_name => "chebyte2")
=> #<AWS::S3::Connection:0xb6e72618 @secret_access_key="XXXXXX", @http=#<Net::HTTP s3.amazonaws.com:80 open=false>, access_key_id"XXXXXX", options{:port=>80, :access_key_id=>"XXXXXX", :secret_access_key=>"XXXXXX", :connection_name=>"chebyte2", :server=>"s3.amazonaws.com"}
>> Base.connections.size
=> 2
>> Base.connections
=> {"chebyte2"=>#<AWS::S3::Connection:0xb6e72618 @secret_access_key="XXXXXX", @http=#<Net::HTTP s3.amazonaws.com:80 open=false>, access_key_id"XXXXXX", optio
#install rake: sake -i apt.rake apt:plugins:install
#sake apt:plugins:install set=common #=> installs using script/plugin install
#sake apt:plugins:install set=common method=external # => installas using script/plugin install -x
#sake apt:plugins:install set=common method=clone # => installs via git clone
namespace :apt do
namespace :plugins do
desc "instala plugins de forma automatica con apt para rails :)"
task :install do
sets = {