Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Ismael G Marin C igmarin

🏠
Working from home
View GitHub Profile
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
@igmarin
igmarin / mail_to_list
Created Jan 17, 2014
MailChimp method with Gibbon gem to add a user to a list
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},
@igmarin
igmarin / sphero_mac_connect
Created Jun 27, 2013
This is the first part of the Guide to Connect Sphero with Mac
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)
@igmarin
igmarin / Error Message
Created Jun 15, 2013
gem install hybridgroup-serialport error missing library
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
@igmarin
igmarin / bobo.rb
Last active Dec 14, 2015
Little example using const_missing, after reading Chap3 of Rebuilding Rails, this is how rails works.
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
@igmarin
igmarin / gatito.rb
Created Feb 9, 2013
My example for Bajio on Rails Feb 9 meeting
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}")
You can’t perform that action at this time.