View update_zig.sh
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
#!/bin/bash | |
set -e | |
# set -xv | |
DIR=/usr/local/opt/zig | |
if [ "$1" == "clean" ]; then | |
shift | |
echo "...from clean" |
View expect_equal_deep.zig
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
const std = @import("std"); | |
/// std.testing.expectEqual, but auto-coerces then uses expectEqualDeep | |
pub fn expectEqual(expected: anytype, actual: anytype) !void { | |
const T = @TypeOf(expected, actual); | |
return try expectEqualDeep(@as(T, expected), @as(T, actual)); | |
} | |
pub const expectEqualSlices = expectEqualSlicesDeep; |
View expect_equal_deep.zig
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
const std = @import("std"); | |
/// std.testing.expectEqual, but auto-coerces then uses expectEqualDeep | |
pub fn expectEqual(expected: anytype, actual: anytype) !void { | |
const T = @TypeOf(expected, actual); | |
return try expectEqualDeep(@as(T, expected), @as(T, actual)); | |
} | |
pub const expectEqualSlices = expectEqualSlicesDeep; |
View zlox.zig
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
const Expr = union(enum) { | |
const Self = @This(); | |
const CRef = *const Self; | |
binary: struct { lhs: CRef, op: Token, rhs: CRef }, | |
grouping: struct { expression: CRef }, | |
literal: struct { value: String }, // HACK -- needs to be a union(enum) | |
unary: struct { op: Token, rhs: CRef }, | |
fn accept(self: Self, visitor: anytype) error{OutOfMemory}!void { |
View shell-1.txt
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
# Running: | |
.................F.................... | |
Finished in 0.033638s, 1129.6748 runs/s, 3389.0243 assertions/s. | |
1) Failure: | |
TestRuby2Ruby#test_case_in__find_pat [test/test_ruby2ruby.rb:874]: | |
not yet |
View test.rb
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
def sanitize_exception e # :nodoc: | |
Marshal.dump e | |
e # good: use as-is | |
rescue TypeError | |
neuter_exception e | |
end | |
def neuter_exception e | |
bt = e.backtrace | |
msg = e.message.dup |
View bisect.rb
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
#!/usr/bin/env ruby -w | |
# original test: | |
# rm -rf doc | |
# rdoc --verbose lib README.rdoc --main README.rdoc | |
# grep -q Minitest.html doc/index.html && echo good || echo bad | |
$: << "../../minitest-bisect/dev/lib" | |
require "fileutils" | |
require "minitest/find_minimal_combination" |
View bench_eq.rb
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
#!/usr/bin/env ruby | |
# thawed = Object.new | |
# frozen = Object.new.freeze | |
# b = backwards/arg second (ie thawed == n) | |
# u = unless instead of if | |
# eq2 = == | |
# neq2 = != | |
require 'benchmark/ips' |
View release_branch.rb
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
#!/usr/bin/env ruby -ws | |
$y ||= false | |
require "thread" | |
require "pry" | |
require "octokit" | |
require "zip" | |
require "fileutils" |
View reopen_github_prs.rb
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
#!/usr/bin/env ruby | |
# require_relative "octokit_extensions" | |
require "thread" | |
require "pry" | |
require "octokit" | |
require "zip" | |
require "fileutils" | |
github_token = `git config github.oauth-token`.chomp |
NewerOlder