Updated for Rails 4.0.0+
-
Set up the
bower
gem. -
Follow the Bower instructions and list your dependencies in your
bower.json
, e.g.// bower.json
{
# This class should parse a yaml configuration file. | |
# | |
require 'ostruct' | |
class APISettings | |
def self.cross_origin_resource_sharing | |
OpenStruct.new(allow: ['http://127.0.0.1:8080', 'http://localhost:8080']) | |
end | |
end |
# | |
# A CORS (Cross-Origin Resouce Sharing) config for nginx | |
# | |
# == Purpose | |
# | |
# This nginx configuration enables CORS requests in the following way: | |
# - enables CORS just for origins on a whitelist specified by a regular expression | |
# - CORS preflight request (OPTIONS) are responded immediately | |
# - Access-Control-Allow-Credentials=true for GET and POST requests |
Updated for Rails 4.0.0+
Set up the bower
gem.
Follow the Bower instructions and list your dependencies in your bower.json
, e.g.
// bower.json
{
module Morpheus | |
module Adapters | |
module Solr | |
class Relation | |
include ActiveModel::Model | |
attr_accessor :connection, :relation_class, :where | |
delegate :present?, :blank?, :empty?, to: :to_a | |
delegate :each, :map, :collect, :select, :find, :last, :first, to: :to_a | |
delegate :total, :facet_fields, to: :response |
var Bar, Foo, | |
__hasProp = {}.hasOwnProperty, | |
__extends = function(child, parent) { | |
for (var key in parent) { | |
if (__hasProp.call(parent, key)) child[key] = parent[key]; | |
} | |
function ctor() { | |
this.constructor = child; | |
} | |
ctor.prototype = parent.prototype; |
# post_loc.txt contains the json you want to post | |
# -p means to POST it | |
# -H adds an Auth header (could be Basic or Token) | |
# -T sets the Content-Type | |
# -c is concurrent clients | |
# -n is the number of requests to run in the test | |
ab -p post_loc.txt -T application/json -H 'Authorization: Token abcd1234' -c 10 -n 2000 http://example.com/api/v1/locations/ |
Last night, Brian Shirai unilaterally "ended" the RubySpec project, a sub-project of Rubinius (the alternative Ruby implementation which Brian was paid to work on full-time from 2007 to 2013). The blog post describing his reasons for "ending" the project led to a big discussion on Hacker News.
When a single, competing Ruby implementation tells that you its test suite is the One True Way, you should be skeptical. Charles Nutter, Ruby core committer and JRuby head honcho, spent a lot of time last night on Twitter talking to people about what this decision means. He's probably too busy and certainly too nice of a guy to write about what is a political issue in the Ruby community, so I'm going to do it on behalf of all the new or intermediate Rubyists out there that are confused by Brian's decision and what it me
I highly suspect that the RSpec core team all use black backgrounds in their terminals because sometimes the colors aren’t so nice on my white terminal
I certainly use a black background. I'm not sure about the other RSpec core folks. Regardless, if there are some color changes we can make that would make output look good on a larger variety of backgrounds, we'll certainly consider that (do you have some suggested changes?). In the meantime, the colors are configurable, so you can change the colors to fit your preferences on your machine. First, create a file at