Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 18:53
    straight-shoota closed #11334
  • 18:53
    straight-shoota closed #11318
  • 18:13
    yxhuvud synchronize #11289
  • 18:11
    yxhuvud synchronize #11289
  • 17:34
    straight-shoota edited #11340
  • 17:33
    straight-shoota labeled #11340
  • 17:33
    straight-shoota labeled #11340
  • 17:33
    straight-shoota opened #11340
  • 17:04
    straight-shoota labeled #11339
  • 17:04
    straight-shoota labeled #11339
  • 17:02
    will closed #11339
  • 16:27
    will opened #11339
  • 16:27
    will labeled #11339
  • 13:06
    straight-shoota milestoned #11277
  • 12:39
    straight-shoota milestoned #11338
  • 11:33
    straight-shoota milestoned #11327
  • 11:33
    straight-shoota demilestoned #11326
  • 11:33
    straight-shoota milestoned #11326
  • 10:42
    straight-shoota labeled #11338
  • 10:42
    straight-shoota labeled #11338
George Dietrich
@Blacksmoke16
but i'd just use .hexstring no need to new up an instance/call update or anything
Digest::SHA1.hexdigest("foo\n")
manveru
@manveru:matrix.org
[m]
yeah, i have to use the #file method though, which isn't on the class unfortunately
anw, your suggestion works for that as well now, thanks :)
George Dietrich
@Blacksmoke16
Digest::SHA1.hexdigest &.file("/path/to/file")
manveru
@manveru:matrix.org
[m]
that sounds more like black magic, but guess it works too...
manveru
@manveru:matrix.org
[m]
yeah
but Yields a context object with an #update(data : String | Bytes) method available. doesn't really sound very obvious for using with files :)
i may just be dumb though
George Dietrich
@Blacksmoke16
it yields an instance of self, which when calling it on Digest::SHA1 that is an instance of Digest::SHA1
same type that provides #update
manveru
@manveru:matrix.org
[m]
how come none of those methods are documented at https://crystal-lang.org/api/1.1.1/Digest/SHA256.html ?
George Dietrich
@Blacksmoke16
"those methods" being #file and #update or .hexdigest?
manveru
@manveru:matrix.org
[m]
hexdigest
George Dietrich
@Blacksmoke16
the type extends ClassMethods, so they're all on there https://crystal-lang.org/api/1.1.1/Digest/ClassMethods.html
manveru
@manveru:matrix.org
[m]
shouldn't there be some kind of "Class methods inherited from Digest::ClassMethods" on that page then?
George Dietrich
@Blacksmoke16
:shrug: possibly?
mfiano
@mjfiano:matrix.org
[m]
oprypin: Do you think you could share the code you use to setup the ECR GLSL integration stuff sometime? Primarily wondering at how you load shaders at runtime, and how you compose programs together from re-usable methods instead of the #include nonsense.
That is one thing I had a very nice solution for in Lisp
mfiano
@mjfiano:matrix.org
[m]
@Blacksmoke16: Where did you hear about that a Crystal book is being written and should be released this year?
mfiano
@mjfiano:matrix.org
[m]
Well done testing vectors after a few thousand lines and the onset of RSI. now the more extensive quat and mat left...
oprypin
@oprypin:matrix.org
[m]

mfiano: i already shared some code and i don't really have more. well maybe a less cut-off example. but i don't have access to the code for the moment.

loading shaders at runtime is the normal mode of operation. just a string value. then u can use runtime interpolation, not only ECR.

and i didn't compose programs, I'm not big on shaders.

Spencer Williams
@spencerwi

@spencerwi do you know if you can write a tree-sitter implementation in Crystal rather than in C?

@asterite I've done an initial cursory search, and haven't come up with anything promising. From what I can tell, the "normal" path with tree-sitter is a grammar.js file (that gets "processed" and generates a parser.c file), and an optional accompanying scanner.cfile for cases where you need custom lexing. Presumably both of those eventually get compiled into a third artifact that tree-sitter uses, but I haven't yet found what that is.

If we could "cut out the middle-man" and jump straight to producing that third artifact from the existing Crystal compiler, that'd be pretty sick -- we'd just have to "wrap" it in something that converts Crystal's AST/intermediate-representation into the sort of Scheme-ish AST representation that tree-sitter expects to see as output from its parsers, I think?

In the short term, it'd be unpleasant for tree-sitter tooling that expects a "continue to parse despite errors" behavior instead of the Crystal compiler's "fail fast on errors" behavior, but there may be potential to figure out a solution there too
Jason Waldrip
@jwaldrip
What is the best way to proxy an HTTP request to an outgoing server?
HTTP::Client.new(target_host_uri).exec do |response|
  response.to_io server_context.response.output
end
that doesnt seem to be doing what I want
am I doing anything wrong there?
George Dietrich
@Blacksmoke16
what happens if you just do .response versus .output
Jason Waldrip
@jwaldrip
response wont get the the headers
George Dietrich
@Blacksmoke16
as the response is itself is anIO
Jason Waldrip
@jwaldrip
well it is, but it isnt
the response io is the body io
response.to_io will give me the full stream
but im trying that now anyway
that writes the headers to the body :-)
not what I wanted
George Dietrich
@Blacksmoke16
hmm
Jason Waldrip
@jwaldrip
I just want to do a straight copy of the incoming IO
Elias Perez
@eliasjpr

Hello Everyone, I want to share with you a small shard that I have been working on. The shard name is called JoobQ (https://github.com/azutoolkit/joobq) and is a job scheduler very much like Sidekiq, It has a nice set of features and a dashboard UI (https://github.com/azutoolkit/dashforge) https://dashforge.io/

Features:
Priority queues based on number of workers
Reliable queue
Error Handling
Retry Jobs with automatic Delays
Cron Like Periodic Jobs
Delayed Jobs
Stop execution of workers
Jobs expiration

Jason Waldrip
@jwaldrip
whats the webm?
video
got it
Very nice
Elias Perez
@eliasjpr
this is a lengthier demo
Elias Perez
@eliasjpr
Thank you Json
Jason*