Skip to content

Instantly share code, notes, and snippets.

View aristotelesbr's full-sized avatar
🏠
Working from home

Aristóteles Coutinho aristotelesbr

🏠
Working from home
View GitHub Profile
@aristotelesbr
aristotelesbr / error
Created February 22, 2017 01:07
react-native run-android
react-native run-android
JS server already running.
Building and installing the app on the device (cd android && ./gradlew installDebug...
Downloading https://services.gradle.org/distributions/gradle-2.4-all.zip
Exception in thread "main" javax.net.ssl.SSLException: java.security.ProviderException: java.security.InvalidKeyException: EC parameters error
at sun.security.ssl.Alerts.getSSLException(Alerts.java:208)
at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1914)
at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1872)
at sun.security.ssl.SSLSocketImpl.handleException(SSLSocketImpl.java:1855)
@aristotelesbr
aristotelesbr / .vimrc
Created November 27, 2016 19:06
my vimrc
"*****************************************************************************
"" Vim-PLug core
"*****************************************************************************
if has('vim_starting')
set nocompatible " Be iMproved
endif
let vimplug_exists=expand('~/.vim/autoload/plug.vim')
let g:vim_bootstrap_langs = "elixir,javascript,python,ruby"
@aristotelesbr
aristotelesbr / examination_request_console.rb
Last active August 19, 2016 18:19
Nested Forms don't updated 🎳
@examination_request
=> #<ExaminationRequest:0x002ab3b2f7fd38> {
:id => 1,
:procedure_type => "",
:execultante_sector => "",
:patient_id => nil,
:user_id => nil,
:medical_consultation_id => nil,
:created_at => Fri, 19 Aug 2016 14:58:07 UTC +00:00,
:updated_at => Fri, 19 Aug 2016 14:58:07 UTC +00:00
@examination_request
=> #<ExaminationRequest:0x002ab3b2f7fd38> {
:id => 1,
:procedure_type => "",
:execultante_sector => "",
:patient_id => nil,
:user_id => nil,
:medical_consultation_id => nil,
:created_at => Fri, 19 Aug 2016 14:58:07 UTC +00:00,
:updated_at => Fri, 19 Aug 2016 14:58:07 UTC +00:00
FROM ubuntu:14.04
MAINTAINER Aristóteles Coutinho <[email protected]>
RUN apt-get update
# Defining the workplace
VOLUME ["/home/ruby/Workspace/Rails"]
# Install ruby dependencies
RUN apt-get install -y wget curl \
require 'mechanize'
agent = Mechanize.new
page = agent.get "https://login.oi.com.br/nidp/idff/sso?id=sso&sid=6&option=credential&sid=6"
# p page.forms
form = page.forms.first
form['Ecom_User_ID'] = '03372595343'
form['Ecom_Password'] = 'q2w3e4r5'
page = form.submit
class Expense < ActiveRecord::Base
validates :value, presence: true
belongs_to :user
has_many :portions
accepts_nested_attributes_for :portions, reject_if: :all_blank, allow_destroy: true
def self.total
where(created_at: Date.today.beginning_of_month..Date.today.end_of_day).sum(:value)
end
# Deve criar no banco de dados de um valor(despesa) parcelado, onde
# o valor de cada parcela será cobrado nos messes subsequentes.
def create_invoices
interval = 1.month
cicles = self.quantity
start_date = Date.today
current_date = start_date
cicles.times do
Vagrant.configure(2) do |config|
config.vm.box = "fnando/hellobits-trusty32"
end
class Meta
def initialize(meta = {})
@meta = meta
end
def atingir_meta(meta)
return meta
end
def dobrar_meta(meta)
meta*2
end