Skip to content

Instantly share code, notes, and snippets.

require 'zlib'
file = File.read(".git/objects/f2/e2c063fb85137b4fc3bef895ed9d6eed03df42")
# f2e2c063fb85137b4fc3bef895ed9d6eed03df42
buf = Zlib::Inflate.inflate(file)
header, body = buf.split("\0", 2)
puts header
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
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,
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
= @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
@Caleb-T-Owens
Caleb-T-Owens / init.nvim
Created July 11, 2022 06:11
A beautiful, organised init.nvim that would make one shed a tear
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'
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)
class ParserError
attr_accessor :reason
attr_accessor :position
def initialize(position)
@position = position
@reason = "Failed to Parse at #{position}"
end
end
<div>
<table>
<thead>
<tr>
<th>Title</th>
<th>Is Unlisted</th>
<th>Edit</th>
<th>Delete</th>
<th>View</th>
</tr>
@Caleb-T-Owens
Caleb-T-Owens / guards.ts
Last active September 11, 2021 18:27
Hold execution untill some other asyncronus task has been completed
class JWTAuthenticator {
private static resolvers: (() => void)[] = []
private static resolved = false
public static authorizationGuard() {
if (this.resolved) {
return undefined
}
return new Promise<void>((resolve) => {