ESPN's hidden API endpoints
Latest News: http://site.api.espn.com/apis/site/v2/sports/football/college-football/news
Latest Scores: http://site.api.espn.com/apis/site/v2/sports/football/college-football/scoreboard
Latest News: http://site.api.espn.com/apis/site/v2/sports/football/college-football/news
Latest Scores: http://site.api.espn.com/apis/site/v2/sports/football/college-football/scoreboard
#Деградация функциональности http://joxi.ru/DxXOU4wyTJCzLlQsA7o Есть фичи у проекта - есть критичные вещи, есть такие что можно пожертвовать чем-то При проектировании архитектуры нужно учесть возможные фоллбеки Все доп, фичи можно отключить или не использовать в ситуации крайней нагрузки
#Масштабирование Нагрузка растет нужно мастабироваться
| #config/initializers/carrierwave.rb | |
| module CarrierWave | |
| module MiniMagick | |
| # Rotates the image based on the EXIF Orientation | |
| def exif_rotation | |
| manipulate! do |img| | |
| img.auto_orient | |
| img = yield(img) if block_given? | |
| img | |
| end |
| def convert_to_brightness_value(background_hex_color) | |
| (background_hex_color.scan(/../).map {|color| color.hex}).sum | |
| end | |
| def contrasting_text_color(background_hex_color) | |
| convert_to_brightness_value(background_hex_color) > 382.5 ? '#000' : '#fff' | |
| end |
| #!/usr/bin/env bash | |
| uninstall() { | |
| list=`gem list --no-versions` | |
| for gem in $list; do | |
| gem uninstall $gem -aIx | |
| done | |
| gem list | |
| gem install bundler | |
| } |
| # activerecord-3.0.0/lib/active_record/connection_adapters/mysql_adapter.rb | |
| # Maps logical Rails types to MySQL-specific data types. | |
| def type_to_sql(type, limit = nil, precision = nil, scale = nil) | |
| return super unless type.to_s == 'integer' | |
| case limit | |
| when 1; 'tinyint' | |
| when 2; 'smallint' | |
| when 3; 'mediumint' | |
| when nil, 4, 11; 'int(11)' # compatibility with MySQL default |
| # | |
| # RUN JUST ONCE | |
| # | |
| # Add a new directory in your Dropbox (or use an existing one) | |
| mkdir -p ~/Dropbox/dotfiles | |
| # move existing file to Dropbox | |
| mv ~/.zshrc ~/Dropbox/dotfiles/zshrc | |
| # oh-my-zsh |