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
2019/02/26 18:15:19 [TRACE] vertex 'root.alicloud_db_instance.default': evaluating | |
2019/02/26 18:15:19 [TRACE] [walkValidate] Entering eval tree: alicloud_db_instance.default | |
2019/02/26 18:15:19 [TRACE] root: eval: *terraform.EvalSequence | |
2019/02/26 18:15:19 [TRACE] root: eval: *terraform.EvalValidateResourceSelfRef | |
2019/02/26 18:15:19 [TRACE] root: eval: *terraform.EvalGetProvider | |
2019/02/26 18:15:19 [TRACE] root: eval: *terraform.EvalInterpolate | |
2019/02/26 18:15:19 [TRACE] root: eval: *terraform.EvalValidateResource | |
2019/02/26 18:15:19 [TRACE] [walkValidate] Exiting eval tree: alicloud_db_instance.default | |
2019/02/26 18:15:19 [TRACE] dag/walk: walking "provider.alicloud (close)" | |
2019/02/26 18:15:19 [TRACE] vertex 'root.provider.alicloud (close)': walking |
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
location ~ /api/v1/cards/(\w+)/(\w+) { | |
if ($request_method = OPTIONS ) { | |
add_header 'Access-Control-Allow-Origin' '*'; | |
add_header 'Access-Control-Allow-Methods' 'GET, OPTIONS'; | |
add_header 'Access-Control-Allow-Headers' 'Cache-Control,Content-Type,If-Modified-Since'; | |
return 204; | |
} | |
add_header 'Access-Control-Allow-Origin' '*'; | |
add_header 'Access-Control-Allow-Methods' 'GET, OPTIONS'; | |
add_header 'Access-Control-Allow-Headers' 'Cache-Control,Content-Type,If-Modified-Since'; |
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
$ rails console | |
Loading development environment (Rails 3.0.6) | |
ruby-1.8.7-p334 :001 > r = Rails.application.routes | |
Gives you a handle of all the routes (config/routes.rb) | |
#Inspect a named route: | |
ruby-1.8.7-p334 :005 > r.recognize_path(app.destroy_user_session_path) | |
=> {:action=>"destroy", :controller=>"sessions"} |
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
// TEST | |
lab.test('it returns 500 error on failure', function (done) { | |
scope = nock(nockUrl) | |
.get('/some/endpoint') | |
.reply(500); | |
request = { | |
method: 'GET', | |
url: '/some/endpoint |
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
NSDecimal newPoint[2]; | |
new_point = Pointer.new(NSDecimal.type, 2) | |
NSDecimalRound(&newPoint[0], &newPoint[0], 0, NSRoundPlain); | |
NSDecimalRound(new_point, new_point, 0, NSRoundPlain) | |
int x = [[NSDecimalNumber decimalNumberWithDecimal:newPoint[0]] intValue]; |
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
(main)> bag = NanoStore::Bag.bag | |
=> #<NanoStore::Bag:0x8c930b0> | |
(main)> NanoStore.shared_store.addObject(bag, error:nil) | |
=> true | |
(main)> bag.setName "cars" | |
=> #<NanoStore::Bag:0x8c930b0> | |
(main)> user = User.create(8, 'demo', 23, bag.name) | |
=> #<User:0x8c93800> | |
(main)> user.save | |
=> #<User:0x8c93800> |
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
class OpenEndedRange | |
attr_reader :first, :last | |
def initialize(first, last, exists = {}) | |
exists = { first => true, last => true }.merge(exists) | |
@first, @last, @first_exists, @last_exists = first, last, exists[:first], exists[:last] | |
end | |
def first_exists? | |
@first_exists |
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 'active_support/dependencies' | |
module ActiveSupport::Dependencies | |
alias_method :require_or_load_without_multiple, :require_or_load | |
def require_or_load(file_name, const_path = nil) | |
if file_name.starts_with?(Rails.root.to_s + '/app') | |
relative_name = file_name.gsub(Rails.root.to_s, '') | |
@engine_paths ||= Rails::Application::Railties.engines.collect{|engine| engine.config.root.to_s } | |
@engine_paths.each do |path| | |
engine_file = File.join(path, relative_name) | |
require_or_load_without_multiple(engine_file, const_path) if File.file?(engine_file) |
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
class AppDelegate | |
def application(application, didFinishLaunchingWithOptions:launchOptions) | |
@window = UIWindow.alloc.initWithFrame(UIScreen.mainScreen.bounds) | |
@window.rootViewController = ExampleViewController.alloc.init | |
@window.makeKeyAndVisible | |
true | |
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
it 'should perform a long running operation' do | |
@ary.performSelector("addObject:", withObject:"soup", afterDelay:0.5) | |
wait 0.6 do | |
@ary.size.should.be 1 | |
end | |
end |
NewerOlder