-
Open the Terminal
-
Use
mysqldumpto backup your databases -
Check for MySQL processes with:
ps -ax | grep mysql -
Stop and kill any MySQL processes
-
Analyze MySQL on HomeBrew:
brew remove mysql
| class UsuarioConvenio | |
| include ActiveModel::Modelze | |
| attr_accessor :id, :nome, :senha, :estabelecimento_id | |
| validates :nome, :email, :senha, :estabelecimento, presence: true | |
| validate :garantindo_que_o_estabelecimento_eh_de_um_convenio_valido | |
| def self.create(params) | |
| object = new(params) |
| class CreateProfiles < ActiveRecord::Migration | |
| def change | |
| create_table :profiles do |t| | |
| t.string :name | |
| t.timestamps null: false | |
| t.index :name | |
| end | |
| end | |
| end |
| File.open("#{Rails.root}/public/countries.txt", 'w') do |file| | |
| countries = [] | |
| Country.all.each do |country| | |
| next if country.sponsors.count.zero? | |
| countries << [country.sponsors.count, country.to_s] | |
| end.nil? | |
| file.puts "=" * 100 |
| require 'active_support/all' | |
| class FreeleticsLogin | |
| def self.log(*args) | |
| new(*args).log | |
| end | |
| def initialize(email, password) | |
| self.login_url = 'https://www.freeletics.com/api/user/v1/auth/password/login' | |
| self.email = email |
| # Este aquivo fica em app/models/sponsor.rb | |
| class Sponsor < ActiveRecord::Base | |
| # aqui fica meu codigo e scopes | |
| end |
| ### Add those lines after *filter near the beginning of the file | |
| :ufw-http - [0:0] | |
| :ufw-http-logdrop - [0:0] | |
| ### Add those lines near the end of the file | |
| ### Start HTTP ### |
| NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:@"REST URL PATH"]]; | |
| NSData *imageData = UIImageJPEGRepresentation(image, 1.0); | |
| [request setCachePolicy:NSURLRequestReloadIgnoringLocalCacheData]; | |
| [request setHTTPShouldHandleCookies:NO]; | |
| [request setTimeoutInterval:60]; | |
| [request setHTTPMethod:@"POST"]; | |
| NSString *boundary = @"unique-consistent-string"; |
| # Add the "https://github.com/jwt/ruby-jwt" gem to your "Gemfile" | |
| gem 'jwt' |
| # the instructions from here: https://stackoverflow.com/questions/3704919/installing-rmagick-on-ubuntu/31089915#31089915 | |
| # worked, but only after I added in line 8 | |
| sudo apt-get purge graphicsmagick graphicsmagick-dbg imagemagick-common imagemagick imagemagick-6.q16 libmagickcore-6-headers libmagickwand-dev graphicsmagick-libmagick-dev-compat | |
| sudo apt-get autoremove | |
| sudo apt-get install imagemagick libmagickwand-dev | |
| sudo ln -s /usr/lib/x86_64-linux-gnu/ImageMagick-6.8.9/bin-Q16/Magick-config /usr/bin/Magick-config | |
| export PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig | |
| gem install rmagick |