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
rules: | |
# Inspired by this rule: https://github.com/Skyscanner/sonar-secrets/blob/v1.3.0/java/src/main/java/org/sonar/skyscanner/java/checks/PrivateKeys.java | |
- id: review.sider.general.security.private_keys | |
pattern: | |
- "-----BEGIN RSA PRIVATE KEY-----" | |
- "-----BEGIN DSA PRIVATE KEY-----" | |
- "-----BEGIN EC PRIVATE KEY-----" | |
- "-----BEGIN OPENSSH PRIVATE KEY-----" | |
- "-----BEGIN PRIVATE KEY-----" | |
message: Do not put private keys in this repository. |
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
Thread.new { raise "error from thread" }.tap { sleep 1 }.join |
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 ['a] rbarray = object method map : 'b . ('a -> 'b) -> 'b rbarray = Obj.magic () end;; | |
(* Error: The universal type variable 'b cannot be generalized: | |
it escapes its scope. *) |
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
$ cat -n w.rb | |
1 a = [1] | |
2 | |
3 a.each do |a| | |
4 a = 3 | |
5 end | |
6 | |
7 p a | |
$ ruby -cw w.rb | |
w.rb:3: warning: shadowing outer local variable - a |
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
import Foundation | |
class A0 { } | |
class A1: A0 { } | |
class A2: A1 { } | |
class Array<X> { | |
func get() -> X { fatalError() } | |
func set(x: X) -> () { fatalError() } | |
} |
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 A | |
module B | |
module C | |
def self.f() | |
puts "X = #{X}" | |
end | |
end | |
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
1) Failure: | |
JsonIO::API3::Form::CheckoutTest#test_update_checkout_from_open_to_close [/Users/soutaro/src/ubiregi-server/test/unit/json_io/api3/form/checkout_test.rb:342]: | |
=> {:id=>76, | |
:guid=>"checkout_guid_1", | |
:account_id=>1743, | |
:paid_at=>2013-09-01 13:05:00 UTC, | |
:closed_at=>Sun, 01 Sep 2013 22:05:00 JST +09:00, | |
:deleted_at=>nil, | |
:created_at=>2014-06-02 06:26:38 UTC, | |
:updated_at=>2014-06-02 06:26:38 UTC, |
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 AjaxQ | |
initialize: (options) -> | |
_.extend(this, Backbone.Events) | |
@options = _.clone(options) | |
_.extend(@options, max:3) | |
@waiting = [] | |
@requests = [] | |
enqueue: (k) -> |
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 "test_helper" | |
require "unifier_assertion" | |
class UnifierAssertionTest < ActiveSupport::TestCase | |
include UnifierAssertion | |
test "unifier" do | |
assert_equal({:"'a" => 1 }, | |
unify([[ | |
[1,2,3], |
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
# Testing two structures if they are unifiable. | |
# | |
module UnifierAssertion | |
def unify(es, s = {}, &block) | |
return s if es.empty? | |
e = es.shift | |
a,b = e | |
a = s[a] || a |
NewerOlder