Skip to content

Instantly share code, notes, and snippets.

View ivanacostarubio's full-sized avatar
💭
⚡️accelerating

Ivan ivanacostarubio

💭
⚡️accelerating
View GitHub Profile
=begin
Halle la suma de todos los multiplos de 3 y 5, por debajo de 1000
escriba un metodos para hallar el factorial del un numero
metodos para la suma de enteros hasta un numero n, luego la suma de cuadrados, los cubos y las potencias
=end
# USAGE --
# Start a carlos with the In App Purchase ID:
@carlos = CarlosSlim.new("loosing_weight_10")
# create blocks for failing and buying:
@carlos.fail = lambda { @l1.alpha = 1 ; @l2.alpha = 1 ; @button.alpha = 1 }
@carlos.winning = lambda { BubbleWrap.alert("THANK YOU") }
@ivanacostarubio
ivanacostarubio / gist:5324630
Last active December 15, 2015 21:19
TALK: Probabilistic Programing Lenguajes
########################################################################
# Computing Backwards and Probabilistic Programing Languajes
########################################################################
A probabilistic program is like computing backwards. Given certain data, we create a program with randomness in it and we get all posible ways those random events could have cause the data we observed. In a way, a probabilistic programing languaje allow us to "create a program" given certain amount of data. A probabilistic programming language includes randomness as first-class citizens.
Are you ready for the next big jump on programing paradigs? On this talk we'll explore in deep what is a probabilistic languaje, what are some of their current implementation, how we can leverage using Ruby as well as some concepts as what is humand thought, what is to think probabilitically, inference and true tables.
@ivanacostarubio
ivanacostarubio / gist:5194016
Created March 19, 2013 06:04
............................................________ ....................................,.-‘”...................``~., .............................,.-”...................................“-., .........................,/...............................................”:, .....................,?......................................................…
............................................________
....................................,.-‘”...................``~.,
.............................,.-”...................................“-.,
.........................,/...............................................”:,
.....................,?......................................................\,
.................../...........................................................,}
................./......................................................,:`^`..}
.............../...................................................,:”........./
..............?.....__.........................................:`.........../
............./__.(.....“~-,_..............................,:`........../
########################
me:
########################
Hi! This is Ivan. One of the founders of MealsApp.com I noticed you have recorded a lot of meals and I am wondering: - What don't you like and what do you like about the app? - What would you like to see in the app so that it is awesome? Thank you very very very very much for replying to this email. It'll help us create the best app for nutrition. Bon Appetit
########################
@ivanacostarubio
ivanacostarubio / when_to_use_ exceptions.text
Created February 26, 2013 19:35
When to use exceptions
-----------------------------------------------------------------------------------------------------------------------
Michael Feathers wrote on Ruby Parley:
I still like Bertrand Meyer's advice on exceptions: use them when you
can't tell before a call whether it will succeed or not.
That said, there are alternatives. You can pass two actions to a
method, one of which is called when it succeeds and the other when it
# BEFORE
orange_button({:action => :buton_action, :text => "GET MY IDEAL BODY WEIGHT", :size => CGRectMake(10, 240, 300, 46), :font => {:size => 33, :color => uicolor_white, :family => "BebasNeue"}})
# AFTER
orange_button do |b|
b.action = :button_action
b.text = "GET MY IDEAL BODY WEIGHT"
####################
# Multi App Dynos
####################
Recently @hirodusk tweeted - http://cl.ly/image/2s1X0E351v29 - about a prototype they've been working on to bring visibility to their dynos idling behavior. He got me thinking.
What about if we can have a different Dyno that can be share between apps? So far, I've been able to acomplish something similar to this by having a bunch of different sinatra apps and mapping them to different URLS. All this under the same Git repo and Heroku app. This approach is all good if all the sinatra apps are related somehow, but it brakes if they apps are unrelated because you don't want them all in the same repository.
I would love to pay Heroku for 5 Dynos and have them serve 10 different apps.
module MotionModel
module Model
def save(*)
puts "called MM#save"
end
end
end
module MotionModel
module Paranoid
require 'rr'
class CrazyMath
def self.fib(n)
if n < 3
1
else
CrazyMath.fib(n - 1) + CrazyMath.fib(n - 2)
end
end