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
# If you have any session variables that should survive a logout, add them to | |
# the except_for array. Usage from a controller: | |
# | |
# ResetsSessionButItsStillThursdayINeedThese.new.reset(self, | |
# except_for: [:has_logged_in_before]) | |
class ResetsSessionButItsStillThursdayINeedThese | |
def reset(receiver, except_for: []) | |
backup = except_for.map { |key| [key, receiver.session[key]] } | |
receiver.reset_session |
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
module Application | |
module Controllers | |
class MyController < Sinatra::Base | |
helpers Sinatra::Streaming | |
class << self | |
def stream(method, path, opts = {}, &block) | |
send(method, path, opts) do | |
stream do |out| | |
timer = EventMachine::PeriodicTimer.new(10) { out << "\0" } |
Custom recipe to get OS X 10.11 El Capitan running from scratch, setup applications and developer environment. This is very similar (and currently mostly the same) as my 10.10 Yosemite setup recipe (as found on this gist https://gist.github.com/kevinelliott/0726211d17020a6abc1f). Note that I expect this to change significantly as I install El Capitan several times.
I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. On average, I reinstall each computer from scratch every 6 months, and I do not perform upgrades between distros.
This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.
You are encouraged to fork this and modify it to your heart's content to match your own needs.
This list is based on aliases_spec.rb.
You can see also Module: RSpec::Matchers API.
matcher | aliased to | description |
---|---|---|
a_truthy_value | be_truthy | a truthy value |
a_falsey_value | be_falsey | a falsey value |
be_falsy | be_falsey | be falsy |
a_falsy_value | be_falsey | a falsy value |
# Postgresql fancy datatypes! | |
* array | |
* hstore (=~ hash) | |
* json | |
* jsonb | |
Philippe Creux - [@pcreux](http://twitter.com/pcreux) |
The reason why you might get certificate errors in Ruby 2.0 when talking HTTPS is because there isn't a default certificate bundle that OpenSSL (which was used when building Ruby) trusts.
Update: this problem is solved in edge versions of rbenv and RVM.
$ ruby -rnet/https -e "Net::HTTP.get URI('https://github.com')"
net/http.rb:917:in `connect': SSL_connect returned=1 errno=0 state=SSLv3
read server certificate B: certificate verify failed (OpenSSL::SSL::SSLError)
You can work around the issue by installing a certificate bundle that you trust. I trust Mozilla and curl.
function deParam (params, coerce) { | |
var obj = {}; | |
var coerce_types = { 'true': !0, 'false': !1, 'null': null }; | |
var decode = decodeURIComponent; | |
// Iterate over all name=value pairs. | |
$.each(params.replace(/\+/g, ' ').split('&'), function(j, v){ | |
var param = v.split( '=' ), | |
key = decode(param[0]), | |
val, |