This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
``` | |
require 'rails_helper' | |
RSpec.describe Admin::CoursesController, type: :controller do | |
let(:valid_attributes) { | |
attributes_for(:course) | |
} | |
let(:invalid_attributes) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'uri' | |
require 'net/http' | |
url = URI("http://www.domaingames.com.br/Ajax_Funcoes.asp?IsNovoCfg=true&Busca=Exeggcute&Funcao=BuscaAvancada&Pagina=1") | |
http = Net::HTTP.new(url.host, url.port) | |
request = Net::HTTP::Post.new(url) | |
request["content-length"] = '108' | |
request["content-type"] = 'application/x-www-form-urlencoded' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'geocoder' | |
module ImportXML | |
class Geocoder | |
attr_accessor :result | |
GERMAN_STATES = { | |
"Germany" => "Deutschland", | |
"Bavaria" => "Bayern", | |
"Hesse" => "Hessen", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://stackoverflow.com/questions/7416318/how-do-i-clear-stuck-stale-resque-workers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://ubuntuforums.org/showthread.php?t=2008576 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash reboot=warm,cold,bios,smp,triple,kbd,acpi,efi,pci,force" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var settings = { | |
"async": true, | |
"crossDomain": true, | |
"url": "https://jardim-das-perdizes.compartibike.com.br/api/v1/cyclists?cyclist[name]=NAME&cyclist[email]=EMAIL&cyclist[cpf]=CPF&cyclist[password]=PASSWORD&cyclist[password_confirmation]=PASSWORD_CONFIRMATION&cyclist[adr_logradouro]=LOGRADOURO&cyclist[adr_number]=ADD_NUMBER&cyclist[adr_city]=CITY&cyclist[adr_state]=STATE&cyclist[adr_cep]=ZIP-CODE&cyclist[birthday]=BIRTHDAY&cyclist[phone_number]=PHONE_NUMBER_FORMATED", | |
"method": "POST", | |
"headers": { | |
"x-api-key": VALID_TOKEN, | |
"cache-control": "no-cache" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# collection | |
# Model.start datetime | |
# 20/02/2016 16:20 | |
# 20/02/2016 19:20 | |
# 20/03/2016 20:20 | |
Model.find(:all).collect(&:start).uniq | |
# i would like select only date, rejecting the time in attribute |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# set 777 to all folders | |
``` | |
find . -type d -exec chmod 777 {} \; | |
``` | |
# reset permissions | |
``` | |
find . -type d -exec chmod 777 {} \; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# create website directory | |
cd /var/www/html/ | |
sudo mkdir nome-do-projeto | |
# create virtual host | |
cd /etc/apache2/sites-available | |
sudo nano projeto.conf |