Skip to content

Instantly share code, notes, and snippets.

View mgomes's full-sized avatar

Mauricio Gomes mgomes

View GitHub Profile
@mgomes
mgomes / conv_net.py
Created March 19, 2019 14:45
Convolutional Neural Net using TensorFlow on Happy/Sad image dataset
import tensorflow as tf
import os
import zipfile
DESIRED_ACCURACY = 0.999
!wget --no-check-certificate \
"https://storage.googleapis.com/laurencemoroney-blog.appspot.com/happy-or-sad.zip" \
-O "/tmp/happy-or-sad.zip"
@mgomes
mgomes / bot_controller.rb
Created June 30, 2022 03:40
Support for multiple phone numbers in Stealth
class BotController < Stealth::Controller
before_action :set_outbound_phone
private def set_outbound_phone
if current_message.service == "twilio"
Stealth.config.twilio.from_phone = current_message.target_id
end
end
@mgomes
mgomes / decoration.rb
Created October 20, 2023 13:31
Method declaration with decoration in Ruby
module MethodDetector
def option_stack
@option_stack ||= []
end
def method_added(method_name)
unless option_stack.empty?
option = option_stack.pop
puts "You added the option '#{option}' to the method: #{method_name}"
end