This file contains hidden or 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
| $:.unshift File.join(File.dirname(__FILE__), "lib") | |
| require "rugged" | |
| repo = Rugged::Repository.new(".") | |
| 10000000.times do | |
| begin | |
| Rugged::Reference.each(repo) do |ref| | |
| raise "fail" | |
| end |
This file contains hidden or 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 RepositoryThreadedPushTest < Rugged::SandboxedTestCase | |
| def setup | |
| super | |
| sandbox_init("testrepo.git") | |
| @repos = (1..10).collect do |i| | |
| sandbox_clone("testrepo.git", "testrepo#{i}.git").tap { |r| r.config['core.bare'] = true } | |
| sandbox_clone("testrepo#{i}.git", "testrepo#{i}") | |
| end |
This file contains hidden or 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
| namespace eval Spec { | |
| namespace eval Mocks { | |
| nx::Class create MessageExpectation { | |
| :property method_name:required | |
This file contains hidden or 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 "benchmark/ips" | |
| $LOAD_PATH.unshift("./lib") | |
| require "rugged" | |
| Benchmark.ips do |x| | |
| # Typical mode, runs the block as many times as it can | |
| x.report("Rugged::Repository.open") { Rugged::Repository.open("test/fixtures/testrepo.git") } |
This file contains hidden or 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
| $ rake test | |
| Run options: --seed 60793 | |
| # Running tests: | |
| ..........E.................................................................................... | |
| Finished tests in 5.710699s, 16.6354 tests/s, 35.7224 assertions/s. | |
| 1) Error: |
This file contains hidden or 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 YARD | |
| module CodeObjects | |
| module Tcl | |
| class NamespaceObject < CodeObjects::Base | |
| attr_writer :resolution_path | |
| attr_reader :children | |
| def initialize(namespace, name, *args, &block) | |
| @children = CodeObjectList.new(self) |
This file contains hidden or 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
| (sql\srun|fsqlFetch\s\{[^\}]+\})\s"[^"\$]+\$[^"]+" |
This file contains hidden or 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
| proxied_git () | |
| ( | |
| export GIT_PROXY_COMMAND=/tmp/gitproxy; | |
| cat > $GIT_PROXY_COMMAND <<EOF |
This file contains hidden or 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
| <?php | |
| $arr = array(1, 2, 3, 4); | |
| foreach ($arr as &$value) { | |
| $value = $value * 2; | |
| } | |
| // $arr is now array(2, 4, 6, 8) | |
| unset($value); // break the reference with the last element | |
| ?> |
This file contains hidden or 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
| <?php | |
| $server = 'localhost'; | |
| $user = 'root'; | |
| $password = ''; | |
| $connect = mysql_connect(__,__,__); | |
| $sql = '___________'; | |
| mysql_select_db(____,$connect); | |
| $result = mysql_query(____); | |
| mysql_close(_____); |