Tests build confidence. Write 'em. They'll save your ass, and they'll let you take a chainsaw to your code without being afraid of unintended consequences.
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
| dir = File.expand_path("..", __FILE__) | |
| require File.join(dir, "redis_protocol") | |
| require 'pp' | |
| class APIFront | |
| GEM_STORE = "http://production.s3.rubygems.org" |
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
| got |
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 'rubygems' | |
| require 'benchmark' | |
| require 'json' | |
| A = (0..1_000).to_a | |
| org_array = [] | |
| json_array = [] | |
| 0.upto(20000) do |i| |
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
| diff --git a/misc/wasm/wasm_exec.js b/misc/wasm/wasm_exec.js | |
| index 231185a123..13030eea00 100644 | |
| --- a/misc/wasm/wasm_exec.js | |
| +++ b/misc/wasm/wasm_exec.js | |
| @@ -256,6 +256,9 @@ | |
| const timeOrigin = Date.now() - performance.now(); | |
| this.importObject = { | |
| + _gotest: { | |
| + add: (a, b) => a + b, |
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
| diff --git a/lib/kpeg/compiled_parser.rb b/lib/kpeg/compiled_parser.rb | |
| index ff82467..eb16e32 100644 | |
| --- a/lib/kpeg/compiled_parser.rb | |
| +++ b/lib/kpeg/compiled_parser.rb | |
| @@ -51,6 +51,12 @@ module KPeg | |
| @string = string | |
| @string_size = string ? string.size : 0 | |
| @pos = pos | |
| + | |
| + if string |
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
| 2021-03-14T01:46:24.752Z 5a1426a7 lax [info] Starting instance | |
| 2021-03-14T01:46:24.797Z 5a1426a7 lax [info] Configuring virtual machine | |
| 2021-03-14T01:46:24.799Z 5a1426a7 lax [info] Pulling container image | |
| 2021-03-14T01:46:27.320Z 5a1426a7 lax [info] Unpacking image | |
| 2021-03-14T01:46:28.566Z 5a1426a7 lax [info] Preparing kernel init | |
| 2021-03-14T01:46:29.025Z 5a1426a7 lax [info] Configuring firecracker | |
| 2021-03-14T01:46:29.106Z 5a1426a7 lax [info] Starting virtual machine | |
| 2021-03-14T01:46:29.313Z 5a1426a7 lax [info] Starting init (commit: c1dec69)... | |
| 2021-03-14T01:46:29.335Z 5a1426a7 lax [info] Running: `/goapp/app` as root | |
| 2021-03-14T01:46:34.361Z 5a1426a7 lax [info] Error: UnhandledIoError(Os { code: 8, kind: Other, message: "Exec format 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
| mount("/proc/self/exe", "/run/runc/test/runc.mQQvkM", 0x8cbf35, MS_BIND, 0x8cbf35) = 0 | |
| mount("", "/run/runc/test/runc.mQQvkM", 0x8cbf35, MS_RDONLY|MS_REMOUNT|MS_BIND, "") = 0 | |
| openat(AT_FDCWD, "/run/runc/test/runc.mQQvkM", O_RDONLY|O_PATH) = 6 | |
| umount2("/run/runc/test/runc.mQQvkM", MNT_DETACH) = 0 | |
| unlink("/run/runc/test/runc.mQQvkM") = 0 | |
| execveat(6, "", ["./runc-rc8-mod", "init"], ["GOMAXPROCS=", "_LIBCONTAINER_CONSOLE=3", "_LIBCONTAINER_INITPIPE=4", "_LIBCONTAINER_STATEDIR=/run/runc"..., "_LIBCONTAINER_FIFOFD=5", "_LIBCONTAINER_INITTYPE=standard", "_LIBCONTAINER_CLONED_BINARY=1"], AT_EMPTY_PATH) = -1 ENOENT (No such file or directory) | |
| close(6) = 0 |
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
| root@ea0a4fce183c:/proc/10# diff -u /tmp/maps6 /tmp/maps7 | |
| --- /tmp/maps6 2016-09-06 00:17:49.464078812 +0000 | |
| +++ /tmp/maps7 2016-09-06 00:42:58.275517610 +0000 | |
| @@ -1,7 +1,7 @@ | |
| 564fdc34d000-564fdc637000 r-xp 00000000 00:2e 68 /usr/local/bin/ruby | |
| 564fdc836000-564fdc83d000 rw-p 002e9000 00:2e 68 /usr/local/bin/ruby | |
| 564fdc83d000-564fdc84d000 rw-p 00000000 00:00 0 | |
| -564fdd644000-564fde03b000 rw-p 00000000 00:00 0 [heap] | |
| +564fdd644000-564fde3a4000 rw-p 00000000 00:00 0 [heap] | |
| 7f63fd3fb000-7f63fd421000 r-xp 00000000 00:2e 34 /lib/x86_64-linux-gnu/libtinfo.so.5.9 |
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
| #!/usr/bin/env ruby | |
| require 'bundler' | |
| gems = ARGV | |
| if gems.empty? | |
| puts "Updating all gems" | |
| Bundler.definition(true) |
NewerOlder