Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 08:54
    straight-shoota closed #12158
  • 08:54
    straight-shoota closed #12141
  • 08:54
    straight-shoota closed #12123
  • 08:54
    straight-shoota closed #3835
  • 08:54
    straight-shoota closed #12094
  • 08:54
    straight-shoota closed #12061
  • Jun 27 19:37
    asterite synchronize #12165
  • Jun 27 19:34
    asterite synchronize #12165
  • Jun 27 17:55
    beta-ziliani milestoned #12149
  • Jun 27 12:32
    Blacksmoke16 unlabeled #12165
  • Jun 27 12:32
    Blacksmoke16 labeled #12165
  • Jun 27 12:32
    Blacksmoke16 labeled #12165
  • Jun 27 12:32
    Blacksmoke16 labeled #12165
  • Jun 27 11:56
    asterite opened #12165
  • Jun 26 21:23
    straight-shoota milestoned #12163
  • Jun 26 21:23
    straight-shoota edited #12163
  • Jun 26 21:18
    straight-shoota milestoned #11773
  • Jun 26 21:18
    straight-shoota milestoned #12008
  • Jun 26 21:15
    straight-shoota unlabeled #5659
  • Jun 26 21:12
    straight-shoota milestoned #11872
From IRC (bridge bot)
@FromIRC
<SamantazFox_> And I'd like to improve it a bit in order to deduplicate authentication code, e.g
<SamantazFox_> (Though, currently I'm working on rewriting the database code, and this kind of improvements will be for the future)
George Dietrich
@Blacksmoke16
i think i'd be easier if you used classes with a parent type, or included another module into the controllers
should be enough to get you started
ofc could have diff annotations for each method or whatever :shrug:
From IRC (bridge bot)
@FromIRC
<SamantazFox_> @Blacksmoke16: nice, thanks :⁠)
<SamantazFox_> I'm not really familiar with includes, especially in modules ^^
George Dietrich
@Blacksmoke16
basically just using it so we can more easily get an array of the types we want
From IRC (bridge bot)
@FromIRC
<SamantazFox_> mmh, I see
George Dietrich
@Blacksmoke16
other option would be to make the controllers a class/struct and use a parent type that you could do all_subclasses on
From IRC (bridge bot)
@FromIRC
<SamantazFox_> as in class BaseRoute; end; class MyRoute < BaseRoute; end?
George Dietrich
@Blacksmoke16
essentially yea
From IRC (bridge bot)
@FromIRC
<SamantazFox_> though, I was wondering what could be the performance impact of classes on a large codebase
George Dietrich
@Blacksmoke16
you'd never be instantiating them so prob not much diff than a module? :shrug:
they're both equivalent so using the module approach is prob fine for now
From IRC (bridge bot)
@FromIRC
<SamantazFox_> mmmh nods
<SamantazFox_> Also, what's that {{debug}} you used in your example?
<SamantazFox_> first time I'm seeing this!
George Dietrich
@Blacksmoke16
just so that it would print the generated code to stdout
From IRC (bridge bot)
@FromIRC
<SamantazFox_> Damn, that's nice! Would have helped when I struggled with macros xD
George Dietrich
@Blacksmoke16
indeed :P super helpful
oprypin
@oprypin:matrix.org
[m]
hmm I'm having real difficulties coming purely from the fact that STDOUT is a constant although it doesn't have to be
ddd
@Dan-Do
It seems I cannot subtract 2 arrays
ary1 = [[2,3,4], [1,2,3]]
ary2 = [1,2,3]
pp! ary1 - ary2 # return ary1
ddd
@Dan-Do
Edit: I used it wrong. Should be ary2 = [[1,2,3]]
oprypin
@oprypin:matrix.org
[m]
yep, i straight up had to hack into the memory region that stores STDOUT
https://gist.github.com/cec2361269f965985fda49a78a3c80f2
From IRC (bridge bot)
@FromIRC
<yxhuvud> in Ruby there is both $stdout and STDOUT, where the difference is that one is the canonical stdout and one is possible to reassign. perhaps something similar would be a good idea?
Paulo Coghi
@paulocoghi
Has anyone successfully used github.com/naqvis/webview on Linux?
I can't run the simple examples, even after installing the required libs: naqvis/webview#4
Paulo Coghi
@paulocoghi
Since the original library works normally on my machine (compilation and execution of the C, C++ and even Go versions), I will try to recreate the Crystal binding. Wish me luck :smile:
oprypin
@oprypin:matrix.org
[m]
yxhuvud, it would certainly be a good idea, just that there are no globals
From IRC (bridge bot)
@FromIRC
<yxhuvud> perhaps better to build an api for temporary replacement for the three std ios. It may be reasonable to have some minor specializations on those 3.
oprypin
@oprypin:matrix.org
[m]

yxhuvud, it would also hugely help to allow these to be any IO, not only FileDescriptor. almost all of the complexity is also due to that.

https://gist.github.com/cec2361269f965985fda49a78a3c80f2

From IRC (bridge bot)
@FromIRC
<yxhuvud> well they can't be IO::Memory - they need to be backed by a file descriptor.
oprypin
@oprypin:matrix.org
[m]
yxhuvud, they can be IO anything which eventually calls to that FD-backed one
not even necessarily, if you purely want to intercept it
From IRC (bridge bot)
@FromIRC
<yxhuvud> well you'd need a pipe or whatever in between
oprypin
@oprypin:matrix.org
[m]
not for the stdout case
it's all programmatic. any write call gets rewritten to a different write call and that's it
and i know about pipes because i certainly needed them in this latest example
From IRC (bridge bot)
@FromIRC
<yxhuvud> unless you want to keep it compatible wth c extensions or whatever, but yeah
oprypin
@oprypin:matrix.org
[m]
ah yea for stuff that directly accesses STDOUT descriptor then you probably need reopen into a pipe
but i think avoiding a pipe+fiber is a more worthy goal than catering to stuff that bypasses official interfaces
From IRC (bridge bot)
@FromIRC
<yxhuvud> both would probably be nice to have. for example to redirect std output for a c extension to avoid spamming the terminal
From IRC (bridge bot)
@FromIRC
<SamantazFox_> Hello there! How can I force some method override to take over something else?
George Dietrich
@Blacksmoke16
define it after the one you want to override
From IRC (bridge bot)
@FromIRC
<SamantazFox_> the problem is that I want to intercept an exception, but I'd like to not have a duplicate of the stdlib for a single line of code
George Dietrich
@Blacksmoke16
feels hacky to override stuff like this
could you not use a HTTP::Handler for this?