View subscribe_segment
def subscribe_to_segment(name, users, list_name = DEFAULT_LIST) | |
@list_id = find_list(list_name) | |
segment = find_segment(name, list_name, 'static') | |
users.each do |user| | |
@gb.lists.subscribe({id: @list_id, email: {email: user.email}, merge_vars: {FNAME: user.display_name, LNAME: user.display_name}, double_optin: false}) | |
end | |
#batch = users.is_a?(Array) ? users.collect{ |u| {email: u.email} } : (users.kind_of?(User) ? [{ email: users.email }] : [{ email: users.to_s }]) | |
#users | |
@gb.lists.static_segment_members_add({ id: @list_id, seg_id: segment["id"], batch: users})#if list_id and segment and batch | |
end |
View mail_to_list
private | |
def add_user_to_mailchimp | |
return if email.include?(ENV['ADMIN_EMAIL']) | |
mailchimp = Gibbon::API.new | |
result = mailchimp.lists.subscribe({ | |
:id => ENV['MAILCHIMP_LIST_ID'], | |
:email => {:email => self.email}, | |
:double_optin => false, | |
:update_existing => true, |
View LineamientosAsesorias
#Objetivo | |
- Aprender tecnologías utilizadas para el desarrollo de aplicaciones web, mejores prácticas y el proceso de desarrollo ágil. | |
- Participar en proyectos bajo la supervisión de un mentor. | |
- Mejorar las habilidades y experiencia de los participantes | |
- Definir y mejorar un proceso para el ingreso de nuevas personas al equipo (reduciendo curva de aprendizaje). | |
# Como funciona | |
- Reuniones 1 vez a la semana para seguimiento. |
View Rails Basics
# INTRODUCTION TO RAILS | |
This Guides serves as an introduction to the Rails Framework as some of the Keypoints to understand how it works and this is a guide as a learning path | |
## RESOURCES (complete guides) | |
- https://learn.thoughtbot.com/rails | |
- http://guides.rubyonrails.org/ | |
- https://github.com/alindeman/upgradingtorails4 |
View gist:5959224
#<Product:0x007f8d766ee5a0 | |
@asia_warehouse_in_stock=0, | |
@attributes= | |
{"_score"=>1.0, | |
"_type"=>"product", | |
"_index"=>"pmzeogxd7ya2glzksntk", | |
"_version"=>1, | |
"sort"=>nil, | |
"highlight"=>nil, | |
"_explanation"=>nil}, |
View sphero_mac_connect
Connect Sphero with your Mac | |
============================ | |
To connect your Mac with Sphero we need to download and install [Multicom](http://members.iinet.net.au/~mgl/MartysPlace/MultiCom.html) | |
The connection between your Sphero(s) and your Mac will be created by a serial port connection using your bluetooth in your mac. | |
Set up a new device | |
------------------- |
View test_sphero_1.rb
require 'artoo' | |
connection :sphero, :adaptor => :sphero, :port => '127.0.0.1:4321' | |
device :sphero, :driver => :sphero | |
work do | |
every(1.seconds) do | |
sphero.set_color(:red) | |
sphero.roll 90, rand(360) |
View Error Message
Building native extensions. This could take a while... | |
ERROR: Error installing hybridgroup-serialport: | |
ERROR: Failed to build gem native extension. | |
/Users/igmarin/.rvm/rubies/rbx-head/bin/rbx extconf.rb | |
checking for OS... apple | |
checking for termios.h... yes | |
checking for unistd.h... yes | |
creating Makefile |
View bobo.rb
class Object | |
def self.const_missing c | |
STDERR.puts "Missing constant: #{c.inspect}" | |
end | |
end | |
class Bobo < Object | |
def hello | |
puts "Hi Bobo!" | |
end |
View gatito.rb
require 'open-uri' | |
puts "Por favor escribe el width:" | |
width = gets.chomp! | |
puts "Por favor escribe el height:" | |
height = gets.chomp! | |
gatitos = open("http://placekitten.com/#{width}/#{height}") |