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
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
#!/bin/bash | |
# Enable strict mode | |
set -e | |
# Check if DEBUG is set to true or 1, enable debug print statements if so | |
if [[ "$DEBUG" == "true" || "$DEBUG" == "1" ]]; then | |
set -x | |
fi |
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
package main | |
import ( | |
"fmt" | |
"io" | |
"os/exec" | |
"syscall" | |
"github.com/creack/pty" | |
) |
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
# typed: true | |
require "minitest/autorun" | |
require_relative "../lib/option" | |
class TestOption < Minitest::Test | |
extend T::Sig | |
def test_unwrap_on_some | |
o = Option.some("value") |
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
# typed: strict | |
require 'sorbet-runtime' | |
require_relative "./result" | |
module Option | |
extend T::Sig | |
extend T::Helpers | |
extend T::Generic |
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
# typed: true | |
require "minitest/autorun" | |
require_relative "../lib/result" | |
class TestResult < Minitest::Test | |
def test_unwrap_success_returns_value | |
r = Result.ok("val") | |
assert_equal r.unwrap, "val" | |
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
# typed: strict | |
require 'sorbet-runtime' | |
module Result | |
extend T::Sig | |
extend T::Helpers | |
extend T::Generic | |
interface! |
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
# typed: strict | |
require 'sorbet-runtime' | |
module Result | |
extend T::Sig | |
extend T::Helpers | |
extend T::Generic | |
interface! |
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
export default class CircularBuffer<T> { | |
readonly #capacity: number | |
readonly #values: T[] | |
#size: number | |
#head: number | |
#tail: number | |
constructor(capacity: number) { |
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
package retry | |
import ( | |
"context" | |
"errors" | |
"fmt" | |
"math" | |
"time" | |
) |
NewerOlder