sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo apt-get autoremove
sudo reboot
This file contains hidden or 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 'open-uri' | |
| url = 'http://maps.googleapis.com/maps/api/staticmap?center=40.714728,-73.998672&markers=color:0x4E3253%7C40.714728,-73.998672&zoom=15&size=640x640&scale=2&format=png&maptype=roadmap&sensor=false' | |
| target = File.join(File.expand_path('../', __FILE__), '/maps.jpg') | |
| File.open(target, "wb") do |saved_file| | |
| open(url, 'rb') do |read_file| | |
| saved_file.write(read_file.read) | |
| end | |
| end |
This file contains hidden or 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
| # Enable GZIP | |
| use Rack::Deflater |
This file contains hidden or 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
| # a.rb | |
| class A < ActiveRecord::Base | |
| has_one :b | |
| accepts_nested_attributes_for :b | |
| end | |
| # b.rb | |
| class B < ActiveRecord::Base | |
| belongs_to :a | |
| attr_accessible :name |
NewerOlder
