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 'zlib' | |
file = File.read(".git/objects/f2/e2c063fb85137b4fc3bef895ed9d6eed03df42") | |
# f2e2c063fb85137b4fc3bef895ed9d6eed03df42 | |
buf = Zlib::Inflate.inflate(file) | |
header, body = buf.split("\0", 2) | |
puts header |
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
rspec ./spec/services/search_service_spec.rb:77 # SearchService#call with a non-url query when it matches a tag includes the tag in the results | |
rspec ./spec/controllers/api/v1/instances/translation_languages_controller_spec.rb:8 # Api::V1::Instances::TranslationLanguagesController GET #show when no translation service is configured returns empty language matrix | |
rspec ./spec/services/account_search_service_spec.rb:72 # AccountSearchService#call returns the fuzzy match first, and does not return suspended exacts | |
rspec ./spec/services/account_search_service_spec.rb:41 # AccountSearchService#call when there is a local domain returns exact match first | |
rspec ./spec/services/account_search_service_spec.rb:24 # AccountSearchService#call when searching for a simple term that is not an exact match does not return a nil entry in the array for the exact match | |
rspec ./spec/controllers/api/v2/search_controller_spec.rb:31 # Api::V2::SearchController with token GET #index when searching accounts returns all matching accounts |
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 Two < Day | |
ROCK_BONUS = 1 | |
PAPER_BONUS = 2 | |
SCISORS_BONUS = 3 | |
WIN = 6 | |
DRAW = 3 | |
A_SCORE_MAP = { | |
'A X' => ROCK_BONUS + DRAW, | |
'A Y' => PAPER_BONUS + WIN, |
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 One < Day | |
def initialize | |
file = File.open('one.txt').read | |
@sums = file # 1\n2\n\n3\n4 | |
.split("\n\n") # 1\n2, 3\n4 | |
.map { _1.split.sum(&:to_i) } | |
.max(3) | |
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
= @turbo.frame do | |
- if @closed | |
= link_to 'Open', @turbo.send(:open) | |
- else | |
.board-list | |
= link_to 'Close', @turbo.send(:close) | |
%p Boards: | |
- @boards.each do |board| | |
= link_to board.name, board |
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
call plug#begin() | |
Plug 'neoclide/coc.nvim', {'branch': 'release'} | |
Plug 'morhetz/gruvbox' | |
Plug 'ryanoasis/vim-devicons' | |
Plug 'preservim/nerdtree' | |
Plug 'nvim-lua/plenary.nvim' | |
Plug 'nvim-telescope/telescope.nvim' |
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 MemoryNode { | |
deleted: boolean = false // using this to indicate if the node has been deallocated | |
ownershipReferences: MemoryNode[] = [] | |
ownershipReferees: MemoryNode[] = [] | |
references: MemoryNode[] = [] | |
referees: MemoryNode[] = [] | |
addReference(node: MemoryNode) { | |
this.references.push(node) |
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 ParserError | |
attr_accessor :reason | |
attr_accessor :position | |
def initialize(position) | |
@position = position | |
@reason = "Failed to Parse at #{position}" | |
end | |
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
<div> | |
<table> | |
<thead> | |
<tr> | |
<th>Title</th> | |
<th>Is Unlisted</th> | |
<th>Edit</th> | |
<th>Delete</th> | |
<th>View</th> | |
</tr> |
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 JWTAuthenticator { | |
private static resolvers: (() => void)[] = [] | |
private static resolved = false | |
public static authorizationGuard() { | |
if (this.resolved) { | |
return undefined | |
} | |
return new Promise<void>((resolve) => { |
NewerOlder