Skip to content

Instantly share code, notes, and snippets.

View Grohden's full-sized avatar
:shipit:
*tec tec tec noises*

Gabriel Rohden Grohden

:shipit:
*tec tec tec noises*
View GitHub Profile
import qualified Data.Set as Set
fInput [] = []
fInput (_:b:c:others) =
(words b, c):fInput others
solve' _ target [] ans
| target /= [] = []
| otherwise = ans
solve' dict target (p:ps) ans =
@takanuva
takanuva / agt.h
Last active December 15, 2025 00:29
Simple generic print() and scan() macros
/*******************************************************************************
* Copyright 2022 Paulo Torrens *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy *
* of this software and associated documentation files (the "Software"), to *
* deal in the Software without restriction, including without limitation the *
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or *
* sell copies of the Software, and to permit persons to whom the Software is *
* furnished to do so, subject to the following conditions: *
* *
@andrepiske
andrepiske / redis_and_queues.rb
Last active October 17, 2025 15:36
redis_and_queues.rb
r = Redis.new(url: ENV['REDIS_URL'])
def fetch_all_keys(r, batch: 10_000, match: nil)
cursor = '0'
all_keys = []
loop do
cursor, k = r.scan(cursor, count: batch, match: match)
all_keys += k
break if cursor == '0'
end