Skip to content

Instantly share code, notes, and snippets.

View hugoabonizio's full-sized avatar
👾

Hugo Abonizio hugoabonizio

👾
View GitHub Profile
@hugoabonizio
hugoabonizio / requir.rb
Created October 15, 2016 20:28
Load precompiled ruby file
def requir(path)
source = "#{path}.rb"
compiled = "#{source}c"
if File.exists? compiled
bin = File.binread compiled
bytecode = RubyVM::InstructionSequence.load_from_binary(bin)
elsif File.exist? source
bytecode = RubyVM::InstructionSequence.compile_file(source)
File.binwrite compiled, bytecode.to_binary
else
@hugoabonizio
hugoabonizio / program.cr
Last active November 10, 2017 12:06
This program breaks Crystal compiler
a = {1, 0}
b = {a, a}
c = {b, b}
d = {c, c}
e = {d, d}
f = {e, e}
g = {f, f}
h = {g, g}
i = {h, h}
j = {i, i}
import os
import tqdm
import gzip
import torch
import tarfile
import logging
from datetime import datetime
from torch.utils.data import DataLoader
from sentence_transformers import InputExample, LoggingHandler, util
from sentence_transformers.cross_encoder import CrossEncoder