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
| ####################################################################################################################### | |
| # This Gist is some crib notes/tests/practice/whatever for talking to Active Directory via LDAP. The (surprisingly | |
| # helpful) documentation for Net::LDAP can be found here: http://net-ldap.rubyforge.org/Net/LDAP.html | |
| ####################################################################################################################### | |
| require 'rubygems' | |
| require 'net/ldap' | |
| ####################################################################################################################### | |
| # HELPER/UTILITY METHOD |
| 1. Change rails version in Gemfile | |
| > gem 'rails', '~> 5.1', '>= 5.1.4' | |
| 2. Remove Gemfile.lock | |
| > git rm Gemfile.lock | |
| 3. Run bundle install command | |
| > bundle install --jobs=5 | |
| 4. Run rails' app update to apply changes to app |
| after "deploy:symlink", "deploy:restart_workers" | |
| ## | |
| # Rake helper task. | |
| # http://pastie.org/255489 | |
| # http://geminstallthat.wordpress.com/2008/01/27/rake-tasks-through-capistrano/ | |
| # http://ananelson.com/said/on/2007/12/30/remote-rake-tasks-with-capistrano/ | |
| def run_remote_rake(rake_cmd) | |
| rake_args = ENV['RAKE_ARGS'].to_s.split(',') | |
| cmd = "cd #{fetch(:latest_release)} && #{fetch(:rake, "rake")} RAILS_ENV=#{fetch(:rails_env, "production")} #{rake_cmd}" |
| after "deploy:symlink", "deploy:restart_workers" | |
| ## | |
| # Rake helper task. | |
| # http://pastie.org/255489 | |
| # http://geminstallthat.wordpress.com/2008/01/27/rake-tasks-through-capistrano/ | |
| # http://ananelson.com/said/on/2007/12/30/remote-rake-tasks-with-capistrano/ | |
| def run_remote_rake(rake_cmd) | |
| rake_args = ENV['RAKE_ARGS'].to_s.split(',') | |
| cmd = "cd #{fetch(:latest_release)} && #{fetch(:rake, "rake")} RAILS_ENV=#{fetch(:rails_env, "production")} #{rake_cmd}" |
| # | |
| # This function takes messy Word HTML pasted into a WYSIWYG and cleans it up | |
| # It leaves the tags and attributes specified in the params | |
| # Copyright (c) 2009, Radio New Zealand | |
| # Released under the MIT license | |
| require 'rubygems' | |
| require 'sanitize' | |
| def clean_up_word_html(html, elements = ['p', 'b', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'], attributes={}) |
| cd ~ | |
| sudo apt-get update | |
| sudo apt-get install openjdk-7-jre-headless -y | |
| ### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch and replace wget link below | |
| # NEW WAY / EASY WAY | |
| wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.0.1.deb | |
| sudo dpkg -i elasticsearch-1.0.1.deb |
| ## | |
| Lets say we have YoloFont.otf | |
| 1. We add it to vendor/assets/fonts/ folder | |
| 2. Me personaly creates a file named fonts.css.scss in app/assets/stylesheets | |
| In it I have | |
| @font-face{ | |
| font-family: 'YoloFont'; |
| Someone recently asked the following question in the discussion forum of the Rubyists LinkedIn group: What separates a junior Rails developer from a senior one? | |
| My response follows. Join us at http://www.linkedin.com/groups?gid=120725 to weigh in on this and other topics of interest to Rubyists. As of today there are almost 1,200 members, including numerous movers and shakers in the Ruby and Rails communities. | |
| “Distinguishing between junior and senior people in the Rails world is not so different from making the distinction in other web development environments. | |
| “Junior Rails people have not dealt with scaling issues to the degree that senior people have. Getting a public-facing Rails application to perform under significant stress is more challenging than doing the same with other building materials such as PHP. Senior people know how to performance-test Rails applications, where to look for bottlenecks, and how to eliminate them one after another until performance is acceptable in real conditions. The Ra |