This file contains 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 = true unless defined? a | |
=> nil | |
unless defined? a | |
a = true | |
end | |
=> true |
This file contains 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
mix do deps.get, compile -v 16:09:41 | |
Dependency resolution completed successfully | |
All dependencies up to date | |
==> bcrypt (compile) | |
ld: warning: directory not found for option '-L"/usr/local/Cellar/erlang/17.3.4/lib/erlang/lib/erl_interface-3.7.19/lib"' | |
ld: library not found for -lerl_interface | |
collect2: error: ld returned 1 exit status | |
ERROR: Command [compile] failed! | |
** (Mix) Could not compile dependency bcrypt, /usr/local/bin/rebar command failed. If you want to recompile this dependency, please run: mix deps.compile bcrypt |
This file contains 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
mix do deps.get, compile -v 15:26:00 | |
Dependency resolution completed successfully | |
All dependencies up to date | |
==> bcrypt (compile) | |
ld: warning: directory not found for option '-L"/usr/local/Cellar/erlang/17.3.4/lib/erlang/lib/erl_interface-3.7.19/lib"' | |
ld: library not found for -lerl_interface | |
clang: error: linker command failed with exit code 1 (use -v to see invocation) | |
ERROR: Command [compile] failed! | |
** (Mix) Could not compile dependency bcrypt, /usr/local/bin/rebar command failed. If you want to recompile this dependency, please run: mix deps.compile bcrypt | |
[capture_life] gcc --version 15:26:19 |
This file contains 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
module.exports = function(req, res, next) { | |
if (!req.current_user.isAdmin()) { | |
req.body.owner_id = req.current_user.id; | |
} | |
return next(); | |
}; |
This file contains 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
var s = require('sails'); | |
s.load({ | |
environment: 'production', | |
log: { | |
level: 'info' | |
}, | |
hooks: { | |
blueprints: false, | |
controllers: false, |
This file contains 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 'spec_helper' | |
describe SimplySettings do | |
before do | |
Rails.cache.clear | |
end | |
subject(:settings) { SimplySettings } |
This file contains 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
function getSelection() | |
{ | |
// returns null, or a structure containing startPoint and endPoint, | |
// each of which has node (a magicdom node), index, and maxIndex. If the node | |
// is a text node, maxIndex is the length of the text; else maxIndex is 1. | |
// index is between 0 and maxIndex, inclusive. | |
if (browser.msie) | |
{ | |
var browserSelection; | |
try |
This file contains 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
# The idea here is that if any of the three tokens are not already | |
# set, then they should be generated. In order to generate one, it | |
# must be unique. | |
def generate_tokens! | |
[ :code, :access_token, :refresh_token ].each do |attr| | |
next if send(attr) | |
send "#{attr}=", tokenize(attr) | |
end | |
end |
This file contains 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 'performance_helper' | |
require 'benchmark' | |
describe UsersController, :type => :controller do | |
context "index performance" do | |
it 'should be fast' do | |
Benchmark.realtime{ | |
get :index, :format => :json |
This file contains 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
RSpec.configure do |config| | |
... | |
config.use_transactional_fixtures = true | |
#seed the database before the test suite runs | |
config.before(:suite) do | |
load "#{Rails.root}/db/performance_data.rb" | |
end | |
... | |
end |
NewerOlder